[Bio] / FigWebServices / index.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44, Tue Jul 27 21:41:05 2004 UTC revision 1.45, Fri Aug 20 22:19:55 2004 UTC
# Line 297  Line 297 
297                  "<TABLE>\n",                  "<TABLE>\n",
298                  "    <TR>\n",                  "    <TR>\n",
299                  "        <TD>Sequence/Pattern: </TD>",                  "        <TD>Sequence/Pattern: </TD>",
300                  "        <TD>", $cgi->textarea(-name => 'seq_pat', -rows => 10, -cols => 70), "</TD>\n",                  "        <TD Colspan=3>", $cgi->textarea(-name => 'seq_pat', -rows => 10, -cols => 70), "</TD>\n",
301                  "    </TR>\n",                  "    </TR>\n",
302                  "    <TR>\n",                  "    <TR>\n",
303                  "        <TD>Search Program: </TD>",                  "        <TD>Search Program: </TD>",
304                  "        <TD>", $cgi->popup_menu(-name => 'Tool', -values => ['blastp','blastx','blastn','tblastn','blastp against complete genomes','Protein scan_for_matches','DNA scan_for_matches'], -default => 'blastp'), "</TD>",                  "        <TD>", $cgi->popup_menu(-name => 'Tool', -values => ['blastp','blastx','blastn','tblastn','blastp against complete genomes','Protein scan_for_matches','DNA scan_for_matches'], -default => 'blastp'), "</TD>",
305                    "        <TD> Program Options:</TD>",
306                    "        <TD>", $cgi->textfield( -name => "blast_options", -size => 27 ), "</TD>",
307                  "    </TR>\n",                  "    </TR>\n",
308                  "</TABLE>\n",                  "</TABLE>\n",
309                  $cgi->submit('Search for Matches'),                  $cgi->submit('Search for Matches'),
# Line 619  Line 621 
621      my($fig,$cgi,$html,$org,$tool,$seq) = @_;      my($fig,$cgi,$html,$org,$tool,$seq) = @_;
622      my($query,@out);      my($query,@out);
623    
624      my $tmp_seq = "$FIG_Config::temp/tmp$$.seq";      my $tmp_seq = "$FIG_Config::temp/run_blast_tmp$$.seq";
625    
626      #--------------------------------------------------------------------------      #--------------------------------------------------------------------------
627      #  Is the request for an id?  Get the sequence      #  Is the request for an id?  Get the sequence
# Line 647  Line 649 
649              return;              return;
650          }          }
651      }      }
652    
653      #--------------------------------------------------------------------------      #--------------------------------------------------------------------------
654      #  Is it a fasta format?  Get the query name      #  Is it a fasta format?  Get the query name
655      #--------------------------------------------------------------------------      #--------------------------------------------------------------------------
656      elsif ($seq =~ s/^>(\S+)[^\n\012\015]*//)  
657        elsif ( $seq =~ s/^>\s*(\S+[^\n\012\015]*)// )  #  more flexible match -- GJO
658      {      {
659          $query = $1;          $query = $1;
660      }      }
661    
662      #--------------------------------------------------------------------------      #--------------------------------------------------------------------------
663      #  Take it as plain text      #  Take it as plain text
664      #--------------------------------------------------------------------------      #--------------------------------------------------------------------------
665    
666      else      else
667      {      {
668          $query = "query";          $query = "query";
669      }      }
670    
671        #
672        #  The rest is taken as the sequence
673        #
674    
675      $seq =~ s/\s+//g;      $seq =~ s/\s+//g;
676      open(SEQ,">$tmp_seq")      open( SEQ, ">$tmp_seq" ) || die "run_blast could not open $tmp_seq";
         || die "could not open $tmp_seq";  
677      print SEQ ">$query\n$seq\n";      print SEQ ">$query\n$seq\n";
678      close(SEQ);      close(SEQ);
679    
680      if (! $ENV{"BLASTMAT"}) { $ENV{"BLASTMAT"} = "$FIG_Config::blastmat" }      if (! $ENV{"BLASTMAT"}) { $ENV{"BLASTMAT"} = "$FIG_Config::blastmat" }
681        my $blast_opt = $cgi->param( 'blast_options' );
682      my $blastall = "$FIG_Config::ext_bin/blastall";      my $blastall = "$FIG_Config::ext_bin/blastall";
683    
684      if ($tool eq "blastp")      if ($tool eq "blastp")
685      {      {
686          my $db = "$FIG_Config::organisms/$org/Features/peg/fasta";          my $db = "$FIG_Config::organisms/$org/Features/peg/fasta";
687          &verify_db($db,"p");          &verify_db($db,"p");
688          @out = map { &HTML::set_prot_links($cgi,$_) } `$blastall -i $tmp_seq -d $db -p blastp`;          @out = map { &HTML::set_prot_links($cgi,$_) } `$blastall -i $tmp_seq -d $db -p blastp $blast_opt`;
689      }      }
690    
691      elsif ($tool eq "blastx")      elsif ($tool eq "blastx")
692      {      {
693          my $db = "$FIG_Config::organisms/$org/Features/peg/fasta";          my $db = "$FIG_Config::organisms/$org/Features/peg/fasta";
694          &verify_db($db,"p");          &verify_db($db,"p");
695          @out = map { &HTML::set_prot_links($cgi,$_) } `$blastall -i $tmp_seq -d $db -p blastx`;          @out = map { &HTML::set_prot_links($cgi,$_) } `$blastall -i $tmp_seq -d $db -p blastx $blast_opt`;
696      }      }
697    
698      elsif ($tool eq "blastn")      elsif ($tool eq "blastn")
699      {      {
         # Typo fixed by GJO  
         # my $db = "$$FIG_Config::organisms/$org/contigs";  
700          my $db = "$FIG_Config::organisms/$org/contigs";          my $db = "$FIG_Config::organisms/$org/contigs";
701          &verify_db($db,"n");                               ### fix to get all contigs          &verify_db($db,"n");                               ### fix to get all contigs
702          #  Matrix changed by GJO for greater sensitivity          @out = `$blastall -i $tmp_seq -d $db -p blastn -r 1 -q -1 $blast_opt`;
         # @out = `$blastall -i $tmp_seq -d $db -p blastn`;  
         @out = `$blastall -i $tmp_seq -d $db -p blastn -r 1 -q -1`;  
703      }      }
704    
705      elsif ($tool eq "tblastn")      elsif ($tool eq "tblastn")
706      {      {
707          my $db = "$FIG_Config::organisms/$org/contigs";          my $db = "$FIG_Config::organisms/$org/contigs";
708          &verify_db($db,"n");                               ### fix to get all contigs          &verify_db($db,"n");                               ### fix to get all contigs
709          @out = `$blastall -i $tmp_seq -d $db -p tblastn`;          @out = `$blastall -i $tmp_seq -d $db -p tblastn $blast_opt`;
710      }      }
711    
712      elsif ($tool eq 'blastp against complete genomes')     ### this tool gets nonstandard treatment: RAO      elsif ($tool eq 'blastp against complete genomes')     ### this tool gets nonstandard treatment: RAO
713      {      {
714          &blast_complete($fig,$cgi,$html,$tmp_seq,$blastall);          &blast_complete($fig,$cgi,$html,$tmp_seq,$blastall);
715          unlink($tmp_seq);          unlink($tmp_seq);
716          return;          return;
717      }      }
718    
719      if (@out < 1)          #  This is really a bigger problem than no hits (GJO)      if (@out < 1)          #  This is really a bigger problem than no hits (GJO)
720      {      {
721          push(@$html,$cgi->h1("Sorry, no hits"));          push(@$html,$cgi->h1("Sorry, no hits"));
# Line 717  Line 729 
729      unlink($tmp_seq);      unlink($tmp_seq);
730  }  }
731    
732    
733  sub blast_complete {  sub blast_complete {
734      my($fig,$cgi,$html,$seq_file,$blastall) = @_;      my($fig,$cgi,$html,$seq_file,$blastall) = @_;
735      my($genome,@sims);      my($genome,@sims);

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3