#!/usr/bin/perl chdir "func" ; # not that portable use CGI ':standard'; $file1="pdb100id_to_julpdb.dat"; $file2="prejullookup.txt"; $file3="jullookup.txt"; print header; $bk = "background1.gif"; # print "
"; ## print ""; #print ''; # print ' ![]() | ';
#
# print '![]() ![]() ';
#
# print ' |
"; if (param()) { $id100 = param('sid'); if ($id100 eq "") { $id100 = param('pdb') ; if ($id100 eq "") { print ("Invalid parameter's name ", "is passed to search.cgi
"), p; print "Acceptable names are: 'sid' or 'pdb' (can be used interchangeably)\n"; die; } } $opt1 = param('opt1'); $found = 0; my %scop_pid; open F1, $file1; while () { ($in_id100, $in_idclass, $in_pid) = split (' ', $_, 3); if($in_id100 =~ m/^d?$id100/) { $found = 1; $scop_pid{$in_idclass} = $in_pid; # print "$in_id100, $in_idclass, $in_pid", p; } } # while close F1; $print_id = "query"; if(scalar(keys %scop_pid) > 1) {$print_id = "PDB ID";} if(scalar(keys %scop_pid) eq 1) {$print_id = "SCOP ID";} print (" Functional Classification of the ". "$print_id "."$id100
"); # print 'Genome Occurrence'; # print ''; print ("Augmented Flybase+ENZYME ". "Classification
"); if ($found){ open F2, "<$file2"; foreach $scop_idclass (sort keys %scop_pid){ $in_idclass = $scop_idclass; $in_pid = $scop_pid{$scop_idclass}; # $in_idclass = $_; print "
\n"; print "The representative SCOP ID is ". "$in_idclass" . " with an identity of $in_pid %." , p; # GOTO: prejullookup.txt, get "$let" and preprocessed "$num"; then $prejfound = 0; seek F2, 0, SEEK_SET; while () { ($in_id, $in_strangenum, $let, $num) = split (' ', $_, 4); if($in_id eq $in_idclass) { $prejfound = 1; last; } # } # while if($prejfound) { print "This is classified as $let-$num.
" . "This initial assignment was made based on an identity of $in_strangenum %.In words, this classification is:\n", p; @nnum = split(/[^0-9\.]+/,$num); for $inum (@nnum) { next if ($inum eq ""); # print "$inum\n\r"; if($inum =~ /\.$/) { chop $inum; } # print "$inum\n\r"; if($inum =~ /^\./) { $inum = substr ($inum, 1); } # print "$inum\n\r"; push @nnum_out, $inum; } # for if($#nnum_out == -1) { # print 'Level II SCOP database search failed:',"\n"; # print 'Unknown foreign key is found:', $num, "\n"; print "$num (a complete classification is not available ". "at the present time)."; } else { $"="\n"; #" # print "@nnum_out\n"; # call julloopkup on each of @nnum_out print p; # print scalar(@nnum_out), p; for $nnum_count (0 .. length(@nnum_out)-1) { # GOTO: jullookup.txt and get the DESCRIPTION $jfound = 0; open F3, "<$file3"; while (
) { ($in_let, $in_num, $in_stuff) = split (' ', $_, 3); if($in_let eq $let && $in_num eq $nnum_out[$nnum_count]) { $jfound = 1; last; } } # while ( ) close F3; if($jfound) { @aaa = split /\s*\|\s*/, $in_stuff; # print $#aaa; $" = "\n"; # print "@aaa\n"; # " for $i (0 .. $#aaa) { print $aaa[$i] , p ; } } # if $jfound else { print "similar to the functions of the other $num ". "domains
(a more detailed description is not available ". "at the present time)",p; } # else $jfound } # for $nnum_count } } else { print "\n Sorry, Level I of SCOP database failed to locate your entry",p; print "$in_id, $in_strangenum, $let, $num",p; } } #foreach } # if $found else { print "Sorry, your entry is not found in our SCOP database" , p; } print "\n\n
\n"; ###################### Riley classification: ###################### print ("GenProtEC ". "Classification
"); $rfound = 0; my %riley_pid; open(F1, ") { ($in_id100, $in_idclass, $in_pid) = split (' ', $_, 3); if($in_id100 =~ m/^d?$id100/) { $rfound = 1; $riley_pid{$in_idclass} = $in_pid; # print "$in_id100, $in_idclass, $in_pid", p; } } # while print p; close F1; if($rfound){ foreach $riley_idclass (sort keys %riley_pid){ $in_idclass = $riley_idclass; $in_pid = $riley_pid{$riley_idclass}; print "
\n"; print "The representative RILEY ID is ". "$in_idclass " . "with an identity of $in_pid %." , p; if($in_pid > 85) { $riley_num = get_mmmming_riley_number($in_idclass, "riley_scop_relate.txt"); if($riley_num eq "") { print "Level II Riley database search failed: no functional description " . "is available. Please, try again later after we augment our database.",p; } else { print "This is classified as $riley_num." . "(No extra fields at the moment.)In words, this classification is:\n", p; @riley_str = get_mmmming_riley_strings($riley_num, "riley_cat_decode.txt"); $" = "
\n"; print "@riley_str
\n"; } #if($riley_num eq "") } else { print "Function can not be reliably assigned ". "due to the low identity value.
",p; } } # foreach } else { print "Sorry, your entry is not found in our Riley database.", p; } #rfound print "
\n"; ######################### MIPS classification: ################################# print ("MIPS ". "Classification
"); $mfound = 0; my %mips_pid; open(F1, ") { ($in_id100, $in_idclass, $in_pid) = split (' ', $_, 3); if($in_id100 =~ m/^d?$id100/) { $mfound = 1; $mips_pid{$in_idclass} = $in_pid; } } # while close F1; if($mfound) { foreach $mips_idclass (sort keys %mips_pid){ $in_idclass = $mips_idclass; $in_pid = $mips_pid{$mips_idclass}; print "
\n"; print "The representative MIPS ID is ". "$in_idclass " . "with an identity of $in_pid %." , p; if($in_pid > 85) { @aa = get_mmmming_mips_numbers($in_idclass,'mips_scop_relate.txt'); for(@aa) { print "This is classified as $_." . "(Multiple Classifications possible in MIPS.)In words, this classification is:\n", p; $_string = get_mmmming_mips_string($_, 'mips_cat_decode.txt'); if ( ($s=get_superclass ($_)) ne "") { $s_string = get_mmmming_mips_string($s,'mips_cat_decode.txt'); if ( ($ss=get_superclass ($s)) ne "") { $ss_string = get_mmmming_mips_string($ss,'mips_cat_decode.txt'); } } print "$ss_string
\n"; print "$s_string
\n"; print "$_string
\n"; print "
\n"; } # for } else { # if($in_pid > 85) print "Function can not be reliably assigned ". "due to the low identity value.
"; } } #foreach } else { print "Sorry, your entry is not found in our MIPS database"; } #if(mfound) print "\n\n
\n"; #----------- } # if param else { print "Parameters were not passed properly to search.cgi", p; } print ''; #+++++ Subrutines: +++++++++++++++++++++++++++++++++++++++++++++++ sub get_mmmming_riley_number { my $key = shift; my $file1 = shift; my $found = 0; my $in_key, $number, $rest; local *F1; open F1, "<".$file1; while() { # print $_; ($in_key, $number, $rest) = split(' ',$_,3); if($key eq $in_key) { $found = 1; $in_pid *= 1.00 ; last; } } if ( not $found ) { print "riley number not found. Alas!\n"; return my $xyi = ""; } # print "$number\n"; return $number; } #---------------------------------------------------- sub get_mmmming_riley_strings { my $key = shift; my $file = shift; my $found = 0; my $in_key, $rest; local *F1; open F1, "<".$file; # print $key, " : ", length($key), "\n"; while( ) { ($in_key, $rest)= split(' ',$_,2); # print length($in_key),"\n"; if($key eq $in_key) { $found = 1; $in_pid *= 1.00 ; last; } } if ( not $found ) { print "riley string not found. Alas!\n"; return my $xyi = (); } # print "$in_key\n"; # print "$rest\n"; my @a; ($a[0],$a[1],$a[2])= split(/\s*[0-9\.]+\s*/,$rest,3); return @a; } #---------------------------------------------------- sub get_mmmming_mips_numbers { my $key = shift; my $file = shift; my $found = 0; my $in_key, $rest; local *F1; open F1, "<".$file; # print $key, " : ", length($key), "\n"; while( ) { ($in_key, $rest)= split(' ',$_,2); # print length($in_key),"\n"; if($key eq $in_key) { $found = 1; $in_pid *= 1.00 ; last; } } if ( not $found ) { print "MIPS Supercategory was not found.",p; return my $xyi = (); } # print "$in_key\n"; # print "$rest\n"; my @a, @b; @a = split(' ',$rest); @b = split(';',$a[9]); return @b; } #---------------------------------------------------- sub get_mmmming_mips_string { my $key = shift; my $file = shift; my $found = 0; my $in_key, $rest; local *F1; open F1, "<".$file; # print $key, " : ", length($key), "\n"; while( ) { chomp; next unless /^[0-9]/ ; ($in_key, $rest)= split(' ',$_,2); # print length($in_key),"\n"; if($key eq $in_key) { $found = 1; $in_pid *= 1.00 ; last; } } if ( not $found ) { print "MIPS category was not found.",p; return my $xyi = ""; } return $rest; } #---------------------------------------- sub get_superclass { my $a = shift; if ( /(.*)\.[0-9][0-9]/ ) { return $1; } return ""; }