#!/usr/bin/perl #print this MIME data no matter what print "Content-type: text/html\n\n"; #flush stdout buffer $| = 1; &parse_form_data (*data); #Calculations use Table; $loc_data_table = "sc_loc_web"; $scid = $data{'scid'}; $scid =~ s/^\s*(.*?)\s*$/$1/; #get rid of bordering white space $scid = uc($scid); #mips id if (length($scid) == 8) { $mpid = substr($scid,0,7)."-".substr($scid,7,1); } else {$mpid = $scid;} #mips id; hyphens are required for proteins such as YBR084C-A $scid =~ s/-//g; #remove any hyphens from scid #first see if the id format is correct foreach (T_LoadRows ($loc_data_table)) { if ($_->{"scid_"} eq $scid) { ($pred1,$pred2,$thresh,$thresh_localize,$entropy,$entropy_localize,$cyt,$nuc,$mit,$me2,$en2) = T_GetFields($_,"pred1","pred2","thresh","thresh_localize","entropy","entropy_localize","cyt","nuc","mit","me2","en2"); #our results ($ypd99_orig,$sny99_orig,$sny99_std,$sny99_col,$sny99_qual,$mips_orig,$mips_std,$mips_col,$mips_qual,$sp38_orig,$sp38_std,$sp38_col,$sp38_qual,$spid) = T_GetFields($_,"ypd99_orig","sny99_orig","sny99_std","sny99_col","sny99_qual","mips_orig","mips_std","mips_col","mips_qual","sp38_orig","sp38_std","sp38_col","sp38_qual","spid"); #outside info last; } } if (not defined $cyt){ #ORF not found print "The ORF you specified does not exist."; exit(1); } %better_name = ("cyt"=>"cytoplasm", "nuc"=>"nucleus", "mit"=>"mitochondria", "me2"=>"membrane-related", "en2"=>"ER related", "?"=>"?"); $pred1 = $better_name{$pred1}; $pred2 = $better_name{$pred2}; %collapsed_name = ("cyt"=>"C", "nuc"=>"N", "mit"=>"M", "me2"=>"T", "en2"=>"E", "-"=>"-", "?"=>"?"); foreach ($sny99_col,$mips_col,$sp38_col) { $_ = $collapsed_name{$_}; } %expand = ("y"=>"yes", "n"=>"no"); $thresh_localize = $expand{$thresh_localize}; $entropy_localize = $expand{$entropy_localize}; #SwissProt link line if ($spid ne "?") { $sp_link = "Swiss-Prot"; } else {$sp_link = "Swiss-Prot";} foreach $item ($cyt,$nuc,$mit,$me2,$en2,$thresh) { $item = $item/1000; } ############################################################################### #CGI Output #Create html document print < Location HTML my $hvar = `perl /web/genecensus/header/header.cgi localize`; print $hvar; print <Localization Prediction

$scid

Predicted Location
$pred1

Available Resources

Database Collapsed Quality Standard Original
Snyder$sny99_col$sny99_qual$sny99_std$sny99_orig
MIPS$mips_col$mips_qual$mips_std$mips_orig
$sp_link$sp38_col$sp38_qual$sp38_std$sp38_orig

Localization Quality

 Value Well-localized?
Entropy$entropy$entropy_localize
Top-two difference$thresh$thresh_localize

Probability State Vector

C N M T E
$cyt$nuc$mit$me2$en2

Other Resources

Pedant SGD COG
HTML exit; sub parse_form_data { local (*FORM_DATA) = @_; local ($request_method, $query_string, @key_value_pairs, $key_value, $key, $value); $request_method = $ENV{'REQUEST_METHOD'}; if ($request_method eq "GET") { $query_string = $ENV{'QUERY_STRING'}; } elsif ($request_method eq "POST") { read(STDIN, $query_string, $ENV{'CONTENT_LENGTH'}); #no. of bytes to receive } else { &return_error (500, "Server Error", "Server uses unsupported method"); } @pairs = split(/&/, $query_string); #making list of keyword-value pair foreach $pair (@pairs) { ($key, $value) = split(/=/, $pair); $value =~ tr/+/ /; #translate "+" to space #decipher ASCI hexadecimal escaped characters $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if (defined ($FORM_DATA{$key})) { $FORM_DATA{$key} = join ("\0", $FORM_DATA{$key}, $value); } else { $FORM_DATA{$key} = $value; } } } sub return_error { local ($status, $keyword, $message) = @_; print "Content-type: text/html", "\n"; print "Status: ", $status, " ", $keyword, "\n\n"; print < CGI Program - Unexpected Error

$keyword


$message
Please contact the webmaster for more information. End_of_Error exit(1); }