[Bioperl-l] Regarding blast in Bioperl

Roopa Raghuveer rtbio.2009 at gmail.com
Thu Jan 21 18:28:43 UTC 2010


Hello Mark,

This is Roopa again. I have a small problem again. I am working on Remote
blast. The program works well. But the problem is this.  The program
accesses the server and gets the output correctly. I am trying to send the
result sequences into an array and I found that always the first sequence
among the Result sequences is missing. The code is

 my $str = Bio::SeqIO->new('-file' => $nuc , '-format' => 'fasta' ,
'-organism' => "$organ\[ORGN]");

while (my $input = $str->next_seq())
{
   #Blast a sequence against a database:
    #Alternatively, you could  pass in a file with many
    #sequences rather than loop through sequence one at a time
    #Remove the loop starting 'while (my $input = $str->next_seq())'
    #and swap the two lines below for an example of that.

             open(OUTFILE,'>',$debugfile);
               print OUTFILE $input;
              close(OUTFILE);


   my $r = $factory->submit_blast($input);

                open(OUTFILE,'>',$debugfile);
             #   print OUTFILE $r;
                close(OUTFILE);


   print STDERR "waiting...." if($v>0);

  while ( my @rids = $factory->each_rid ) {
      open(OUTFILE,'>',$debugfile);
            #   print OUTFILE "while entered";
              close(OUTFILE);
     foreach my $rid ( @rids ) {

               open(OUTFILE,'>',$debugfile);
 #  print OUTFILE "foreach entered";
              close(OUTFILE);

        my $rc = $factory->retrieve_blast($rid);

        if( !ref($rc) )
        {
        if( $rc < 0 )
        {
        $factory->remove_rid($rid);
        }
         open(OUTFILE,'>',$debugfile);
              # print OUTFILE "if entered";
              close(OUTFILE);
         print STDERR "." if ( $v > 0 );
         sleep 5;
        }
       else {
              open(OUTFILE,'>',$debugfile);
              # print OUTFILE "else entered";
              close(OUTFILE);

          my $result = $rc->next_result();
         #save the output
        $blastdebugfile = $serverpath."/blastdebug_".time().".txt";

          open(BLASTDEBUGFILE,'>',$blastdebugfile);
          print BLASTDEBUGFILE $result->next_hit();
          close(BLASTDEBUGFILE);

        my $filename = $serverpath."/blastdata_".time()."\.out";

         # open(DEBUGFILE,'>',$debugfile);
         # open(new,'>',$filename);
         # @arra=<new>;
         # print DEBUGFILE @arra;
         # close(DEBUGFILE);
         # close(new);

         $factory->save_output($filename);

       # open(BLASTDEBUGFILE,'>',$debugfile);
       # print BLASTDEBUGFILE  "Hello $rid";
       # close(BLASTDEBUGFILE);

       $factory->remove_rid($rid);

       open(BLASTDEBUGFILE,'>',$blastdebugfile);
       print BLASTDEBUGFILE  $organism;
        close(BLASTDEBUGFILE);

    # open(OUTFILE,'>',$outfile);
    # print OUTFILE "Test2 $result->database_name()";
    # close(OUTFILE);

#$hit = $result->next_hit;
#open(new,'>',$debugfile);
#print $hit;
#close(new);
$dummy=0;
   while ( my $hit = $result->next_hit ) {

            next unless ( $v >= 0);

          #     open(OUTFILE,'>',$debugfile);
           #    print OUTFILE "$hit in while hits";
            #  close(OUTFILE);
 my $sequ = $gb->get_Seq_by_version($hit->name);
           my $dna = $sequ->seq(); # get the sequence as a string
        $dummy++;
             open(OUTFILE,'>',$debugfile);
          #     print OUTFILE $dummy;
              close(OUTFILE);
          push(@seqs,$dna);
         }
        }
      }
    }
  }

$warum=@seqs;
 open(OUTFILE,'>',$debugfile);
             #  print OUTFILE $warum;
               print OUTFILE @seqs;
              close(OUTFILE);
return(@seqs);
}

open(OUTFILE, '>',$outfile) || die ;

print OUTFILE "<HTML>\n
<head><title>RNAi Result</title>
<meta http-equiv=\"expires\" content=\"0\"></head>\n
<body>\n
<p><font face=\"Courier, monospace font set\">
Inputsequence: <br>";


Here in the above code, I was trying to debug the code and trying to get the
count of the array and even the sequence. But when the output data was
giving 1 sequence, the count of the array was 0 and when I tried to print
the output sequence I could not get any. It was the same when the no of
output sequences was  3, I tried to print the sequences but was getting the
count of the array as 2 and was printing only two sequences.

Please help me in sorting out this problem.

Regards,
Roopa.






On Sun, Jan 10, 2010 at 1:03 AM, Mark A. Jensen <maj at fortinbras.us> wrote:

>  Excellent Roopa- it's my pleasure-- MAJ
>
> ----- Original Message -----
> *From:* Roopa Raghuveer <rtbio.2009 at gmail.com>
> *To:* Mark A. Jensen <maj at fortinbras.us>
> *Sent:* Saturday, January 09, 2010 6:41 PM
> *Subject:* Re: [Bioperl-l] Regarding blast in Bioperl
>
> Hi Mark,
>
> Thank you very very much. The code is working now. Thanks for the support
> and time you have spent on me.
>
> Thanks in advance
> Roopa.
>
> On Sat, Jan 9, 2010 at 10:56 PM, Mark A. Jensen <maj at fortinbras.us> wrote:
>
>>  There is still a bug with the double quotes. Use "$organ\[ORGN]", which
>> prevents perl from
>> looking for a member of an array called @organ. This would have shown up
>> if 'use strict;' had
>> been in place. Still don't know whether this would work precisely; can you
>> send me the query
>> sequence so I can reproduce your ouput?
>> thanks MAJ
>>
>>  ----- Original Message -----
>> *From:* Roopa Raghuveer <rtbio.2009 at gmail.com>
>>   *To:* Mark A. Jensen <maj at fortinbras.us>
>> *Sent:* Saturday, January 09, 2010 2:02 PM
>> *Subject:* Re: [Bioperl-l] Regarding blast in Bioperl
>>
>> Hi Mark,
>>
>> I tried it with double quotes but still i got the same o/p with sequences
>> from different species.
>>
>> ref|XM_822292.1|  Trypanosoma brucei TREU927 protein kinase A ...  1813
>> 0.0
>> ref|XM_822286.1|  Trypanosoma brucei TREU927 protein kinase A ...  1622
>> 0.0
>> ref|XM_816530.1|  Trypanosoma cruzi strain CL Brener protein k...   773
>> 0.0
>> ref|XM_816527.1|  Trypanosoma cruzi strain CL Brener protein k...   749
>> 0.0
>> ref|XM_838414.1|  Leishmania major strain Friedlin protein kin...   551
>> 3e-154
>> ref|XM_838409.1|  Leishmania major strain Friedlin protein kin...   551
>> 3e-154
>> ref|XM_001568451.1|  Leishmania braziliensis MHOM/BR/75/M2904 ...   542
>> 2e-151
>> ref|XM_001469171.1|  Leishmania infantum protein kinase A cata...   538
>> 2e-150
>> ref|XM_001469166.1|  Leishmania infantum protein kinase A cata...   538
>> 2e-150
>> ref|XM_001682462.1|  Leishmania major protein kinase A catalyt...   196
>> 3e-47
>> ref|XM_804361.1|  Trypanosoma cruzi strain CL Brener protein k...   190
>> 1e-45
>> ref|XM_002065851.1|  Drosophila willistoni GK20594 (Dwil\GK205...   181
>> 7e-43
>> ref|XM_822694.1|  Trypanosoma brucei TREU927 protein kinase A ...   179
>> 2e-42
>> ref|XM_001563990.1|  Leishmania braziliensis MHOM/BR/75/M2904 ...   178
>> 8e-42
>> ref|XM_814844.1|  Trypanosoma cruzi strain CL Brener protein k...   170
>> 1e-39
>> ref|XM_001763039.1|  Physcomitrella patens subsp. patens predi...   169
>> 4e-39
>> ref|XM_001464886.1|  Leishmania infantum JPCM5 protein kinase ...   167
>> 1e-38
>> ref|XM_001377302.1|  PREDICTED: Monodelphis domestica similar ...   150
>> 1e-33
>> ref|XM_001603485.1|  PREDICTED: Nasonia vitripennis similar to...   145
>> 5e-32
>> ref|XM_416852.2|  PREDICTED: Gallus gallus protein kinase, X-l...   143
>> 2e-31
>> ref|NM_001016403.2|  Xenopus (Silurana) tropicalis protein kin...   143
>> 2e-31
>> ref|XM_002009291.1|  Drosophila mojavensis GI11297 (Dmoj\GI112...   138
>> 7e-30
>> ref|NM_016979.1|  Mus musculus protein kinase, X-linked (Prkx)...   138
>> 7e-30
>> ref|XM_001495664.2|  PREDICTED: Equus caballus similar to Seri...   136
>> 2e-29
>> ref|XM_001111571.1|  PREDICTED: Macaca mulatta cAMP-dependent ...   136
>> 2e-29
>> ref|XM_001611655.1|  Babesia bovis protein kinase domain conta...   134
>> 9e-29
>> ref|NR_028062.1|  Homo sapiens protein kinase, Y-linked (PRKY)...   132
>> 3e-28
>> ref|XM_001517795.1|  PREDICTED: Ornithorhynchus anatinus simil...   132
>> 3e-28
>> ref|XM_685338.2|  PREDICTED: Danio rerio similar to Serine/thr...   132
>> 3e-28
>> ref|XM_002189865.1|  PREDICTED: Taeniopygia guttata protein ki...   131
>> 1e-27
>> ref|XM_001362299.1|  PREDICTED: Monodelphis domestica similar ...   131
>> 1e-27
>> ref|NM_001093198.1|  Xenopus laevis protein kinase, cAMP-depen...   129
>> 4e-27
>> ref|XM_001461322.1|  Paramecium tetraurelia hypothetical prote...   129
>> 4e-27
>> ref|NM_001099869.1|  Xenopus laevis cAMP-dependent protein kin...   129
>> 4e-27
>> ref|NM_001003470.1|  Danio rerio protein kinase, cAMP-dependen...   129
>> 4e-27
>> ref|XM_001141503.1|  PREDICTED: Pan troglodytes verus protein ...   127
>> 1e-26
>> ref|XM_001145269.1|  PREDICTED: Pan troglodytes protein kinase...   127
>> 1e-26
>> ref|XM_512434.2|  PREDICTED: Pan troglodytes cAMP-dependent pr...   127
>> 1e-26
>> ref|XM_001171457.1|  PREDICTED: Pan troglodytes cAMP-dependent...   127
>> 1e-26
>> ref|XM_001171437.1|  PREDICTED: Pan troglodytes cAMP-dependent...   127
>> 1e-26
>> ref|XM_847420.1|  PREDICTED: Canis familiaris similar to Serin...   127
>> 1e-26
>> ref|NM_207518.1|  Homo sapiens protein kinase, cAMP-dependent,...   127
>> 1e-26
>> ref|NM_002730.3|  Homo sapiens protein kinase, cAMP-dependent,...   127
>> 1e-26
>>
>>
>> Thanks in advance.
>>
>> Roopa.
>>
>> On Sat, Jan 9, 2010 at 7:46 PM, Mark A. Jensen <maj at fortinbras.us> wrote:
>>
>>>  I understand you. Put in the double quotes and see what happens.
>>>
>>>  ----- Original Message -----
>>> *From:* Roopa Raghuveer <rtbio.2009 at gmail.com>
>>> *To:* Mark A. Jensen <maj at fortinbras.us>
>>>   *Sent:* Saturday, January 09, 2010 1:40 PM
>>> *Subject:* Re: [Bioperl-l] Regarding blast in Bioperl
>>>
>>> Hi Mark,
>>>
>>> Thanks for your reply. It was working when I specifically use the name of
>>> the organism as Trypanosoma brucei in the code,but my idea is to introduce a
>>> $organ which takes the organism given by the user i.e., let it be anything
>>>
>>> Pseudomonas, Drosophila, Trypanosoma, Leishmania etc.,  I should get the
>>> sequences related to only those organisms.
>>>
>>> i.e., If the user enters Pseudomonas,the $organ parameter of the code
>>> takes Pseudomonas ,does BLAST and returns only those sequences that produce
>>> significant alignment with Pseudomonas(only).But this is not happening like
>>> that .
>>>
>>> Please help me in this regard.
>>>
>>> Thanks in advance
>>> Roopa
>>>
>>> On Sat, Jan 9, 2010 at 7:29 PM, Mark A. Jensen <maj at fortinbras.us>wrote:
>>>
>>>>  Hi Roopa-- You may get what you want if you make the change.
>>>> With single quotes, ENTREZ_QUERY is set to the literal string
>>>>
>>>>  $organ[ORGN]
>>>>
>>>> while, with double quotes, the variable value will be substituted,
>>>> and the parameter should be set to
>>>>
>>>>  Trypanosoma brucei[ORGN]
>>>>
>>>> I'm guess that it worked because the database ignored the strange
>>>> parameter,
>>>> and returned all the matches. Try this and if it doesn't work I look
>>>> harder.
>>>> cheers,
>>>> Mark
>>>>
>>>>  ----- Original Message -----
>>>> *From:* Roopa Raghuveer <rtbio.2009 at gmail.com>
>>>>   *To:* Mark A. Jensen <maj at fortinbras.us>
>>>> *Sent:* Saturday, January 09, 2010 1:24 PM
>>>> *Subject:* Re: [Bioperl-l] Regarding blast in Bioperl
>>>>
>>>> hello Mark,
>>>>
>>>> Thanks for your reply.It was working without enclosing $organ[ORGN] in
>>>> double quotations,but. I would like to have only those specific sequences
>>>> which are specific for my Organism i.e., I need sequences only from the
>>>> organism that I entered.
>>>>
>>>> When the organism is Trypanosoma brucei,I could get even Leishmania and
>>>> other species as the similar sequences. But I want to get only trypanosoma
>>>> brucei sequences.
>>>>
>>>> Could you please help me out in this regard?
>>>>
>>>> Roopa.
>>>>
>>>> My output
>>>>
>>>> I/P organism: Trypanosoma brucei
>>>>
>>>> O/P:-
>>>> ref|XM_822292.1|  Trypanosoma brucei TREU927 protein kinase A ...
>>>> 1813    0.0
>>>> ref|XM_822286.1|  Trypanosoma brucei TREU927 protein kinase A ...
>>>> 1622    0.0
>>>> ref|XM_816530.1|  Trypanosoma cruzi strain CL Brener protein k...
>>>> 773    0.0
>>>> ref|XM_816527.1|  Trypanosoma cruzi strain CL Brener protein k...
>>>> 749    0.0
>>>> ref|XM_838414.1|  Leishmania major strain Friedlin protein kin...
>>>> 551    3e-154
>>>> ref|XM_838409.1|  Leishmania major strain Friedlin protein kin...
>>>> 551    3e-154
>>>> ref|XM_001568451.1|  Leishmania braziliensis MHOM/BR/75/M2904 ...
>>>> 542    2e-151
>>>> ref|XM_001469171.1|  Leishmania infantum protein kinase A cata...
>>>> 538    2e-150
>>>> ref|XM_001469166.1|  Leishmania infantum protein kinase A cata...
>>>> 538    2e-150
>>>> ref|XM_001682462.1|  Leishmania major protein kinase A catalyt...
>>>> 196    3e-47
>>>> ref|XM_804361.1|  Trypanosoma cruzi strain CL Brener protein k...
>>>> 190    1e-45
>>>> ref|XM_002065851.1|  Drosophila willistoni GK20594 (Dwil\GK205...
>>>> 181    7e-43
>>>> ref|XM_822694.1|  Trypanosoma brucei TREU927 protein kinase A ...
>>>> 179    2e-42
>>>> ref|XM_001563990.1|  Leishmania braziliensis MHOM/BR/75/M2904 ...
>>>> 178    8e-42
>>>> ref|XM_814844.1|  Trypanosoma cruzi strain CL Brener protein k...
>>>> 170    1e-39
>>>> ref|XM_001763039.1|  Physcomitrella patens subsp. patens predi...
>>>> 168    4e-39
>>>> ref|XM_001464886.1|  Leishmania infantum JPCM5 protein kinase ...
>>>> 167    1e-38
>>>> ref|XM_001377302.1|  PREDICTED: Monodelphis domestica similar ...
>>>> 150    1e-33
>>>> ref|XM_001603485.1|  PREDICTED: Nasonia vitripennis similar to...
>>>> 145    5e-32
>>>> ref|XM_416852.2|  PREDICTED: Gallus gallus protein kinase, X-l...
>>>> 143    2e-31
>>>> ref|NM_001016403.2|  Xenopus (Silurana) tropicalis protein kin...
>>>> 143    2e-31
>>>> ref|XM_002009291.1|  Drosophila mojavensis GI11297 (Dmoj\GI112...
>>>> 138    7e-30
>>>> ref|NM_016979.1|  Mus musculus protein kinase, X-linked (Prkx)...
>>>> 138    7e-30
>>>> ref|XM_001495664.2|  PREDICTED: Equus caballus similar to Seri...
>>>> 136    2e-29
>>>> ref|XM_001111571.1|  PREDICTED: Macaca mulatta cAMP-dependent ...
>>>> 136    2e-29
>>>> ref|XM_001611655.1|  Babesia bovis protein kinase domain conta...
>>>> 134    9e-29
>>>> ref|NR_028062.1|  Homo sapiens protein kinase, Y-linked (PRKY)...
>>>> 132    3e-28
>>>> ref|XM_001517795.1|  PREDICTED: Ornithorhynchus anatinus simil...
>>>> 132    3e-28
>>>> ref|XM_685338.2|  PREDICTED: Danio rerio similar to Serine/thr...
>>>> 132    3e-28
>>>> ref|XM_002189865.1|  PREDICTED: Taeniopygia guttata protein ki...
>>>> 131    1e-27
>>>> ref|XM_001362299.1|  PREDICTED: Monodelphis domestica similar ...
>>>> 131    1e-27
>>>> ref|NM_001093198.1|  Xenopus laevis protein kinase, cAMP-depen...
>>>> 129    4e-27
>>>> ref|XM_001461322.1|  Paramecium tetraurelia hypothetical prote...
>>>> 129    4e-27
>>>> ref|NM_001099869.1|  Xenopus laevis cAMP-dependent protein kin...
>>>> 129    4e-27
>>>>
>>>> Roopa.
>>>>
>>>> On Sat, Jan 9, 2010 at 7:05 PM, Mark A. Jensen <maj at fortinbras.us>wrote:
>>>>
>>>>> I see it immediately (from making same bug many times) :
>>>>>
>>>>>
>>>>> my $factory = Bio::Tools::Run::RemoteBlast->new(@params, -ENTREZ_QUERY
>>>>> =>
>>>>> - '$organ[ORGN]');
>>>>> +"$organ[ORGN]");
>>>>>
>>>>>
>>>>> MAJ
>>>>>
>>>>> ----- Original Message ----- From: "Roopa Raghuveer" <
>>>>> rtbio.2009 at gmail.com>
>>>>> To: "Mark A. Jensen" <maj at fortinbras.us>
>>>>> Cc: <bioperl-l at lists.open-bio.org>
>>>>> Sent: Saturday, January 09, 2010 11:57 AM
>>>>> Subject: Re: [Bioperl-l] Regarding blast in Bioperl
>>>>>
>>>>>
>>>>>
>>>>> Hello all,
>>>>>>
>>>>>> Thanks alot for your reply Mark. It was working for Trypanosoma brucei
>>>>>> as
>>>>>> the organism parameter,but when I tried to use the Organism parameter
>>>>>> from
>>>>>> the user,it was not working i.e., I was unable to get the target
>>>>>> sequences.
>>>>>> Please help me in this regard. My code is
>>>>>>
>>>>>> #!/usr/bin/perl
>>>>>>
>>>>>> #path for extra camel module
>>>>>> use lib "/srv/www/htdocs/rain/RNAi/";
>>>>>> use Roopablast;
>>>>>>
>>>>>>
>>>>>> use Bio::SearchIO;
>>>>>> use Bio::Search::Result::BlastResult;
>>>>>> use Bio::Perl;
>>>>>> use Bio::Tools::Run::RemoteBlast;
>>>>>> use Bio::Seq;
>>>>>> use Bio::SeqIO;
>>>>>> use Bio::DB::GenBank;
>>>>>>
>>>>>> $serverpath = "/srv/www/htdocs/rain/RNAi";
>>>>>> $serverurl = "http://141.84.66.66/rain/RNAi";
>>>>>> $outfile = $serverpath."/rnairesult_".time().".html";
>>>>>> $nuc = $serverpath."/nuc".time().".txt";
>>>>>> $debugfile = $serverpath."/debug_".time().".txt";
>>>>>> $blastdebugfile = $serverpath."/blastdebug_".time().".txt";
>>>>>>
>>>>>> my $outstring ="";
>>>>>>
>>>>>> &parse_form;
>>>>>>
>>>>>> print "Content-type: text/html\n\n";
>>>>>> print "<HTML>\n";
>>>>>> print "<head><title>RNAi Result</title>";
>>>>>> print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30;
>>>>>> URL=$serverurl/rnairesult_".time().".html\"> \n";
>>>>>> print "</head>\n";
>>>>>> print "<body>\n";
>>>>>> print " Your results will appear <a
>>>>>> href=$serverurl/rnairesult_".time().".html>here</a><br>";
>>>>>> print " Please be patient, runtime can be up to 5 minutes<br>";
>>>>>> print " This page will automatically reload in 30 seconds. Roopa";
>>>>>> print "</BODY>\n";
>>>>>> print "</HTML>\n";
>>>>>>
>>>>>> defined(my $pid = fork) or die "Can't fork: $!";
>>>>>> exit if $pid;
>>>>>> open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
>>>>>> open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
>>>>>> open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
>>>>>>
>>>>>> open(OUTFILE, '>',$outfile);
>>>>>>
>>>>>> print OUTFILE "<HTML>\n
>>>>>> <head><title>RNAi Result</title>
>>>>>> <META HTTP-EQUIV=\"Refresh\" CONTENT=\"30;
>>>>>> URL=$serverurl//rnairesult_".time().".html\"> \n
>>>>>> <meta http-equiv=\"expires\" content=\"0\">
>>>>>> </head>\n
>>>>>> <body>\n
>>>>>>  Your results will appear <a
>>>>>> href=$serverurl/rnairesult_".time().".html>here</a><br>
>>>>>>  Please be patient, runtime can be up to 5 minutes wait wait
>>>>>> wait......<br>
>>>>>> This page will automatically reload in 30 seconds Roopa <br>
>>>>>> </BODY>\n
>>>>>> </HTML>\n";
>>>>>>
>>>>>> close(OUTFILE);
>>>>>>
>>>>>>
>>>>>> @compseqs = blastcode($in{'Inputseq'},$in{'Organism'});
>>>>>>
>>>>>> $in{'Inputseq'} =~ s/>.*$//m;
>>>>>> $in{'Inputseq'} =~ s/[^TAGC]//gim;
>>>>>> $in{'Inputseq'} =~ tr/actg/ACTG/;
>>>>>>
>>>>>> @out = similar($in{'Inputseq'}, \@compseqs, $in{'Windowsize'},
>>>>>> $in{'Threshold'});
>>>>>>
>>>>>>
>>>>>> sub blastcode
>>>>>> {
>>>>>>
>>>>>> $inpu1= $_[0];
>>>>>>
>>>>>> $organ= $_[1];
>>>>>>
>>>>>> open(NUC,'>',$nuc);
>>>>>> print NUC $inpu1,"\n";
>>>>>> close(NUC);
>>>>>>
>>>>>> my $prog = 'blastn';
>>>>>> my $db   = 'refseq_rna';
>>>>>> my $e_val= '1e-10';
>>>>>> my $organism= $organ;
>>>>>>
>>>>>> $gb = new Bio::DB::GenBank;
>>>>>>
>>>>>> my @params = ( '-prog' => $prog,
>>>>>>        '-data' => $db,
>>>>>>        '-expect' => $e_val,
>>>>>>        '-readmethod' => 'SearchIO',
>>>>>>       '-Organism'   => $organism );
>>>>>>
>>>>>>            open(OUTFILE,'>',$debugfile);
>>>>>>            print OUTFILE $inpu1;
>>>>>>             close(OUTFILE);
>>>>>>
>>>>>>
>>>>>> my $factory = Bio::Tools::Run::RemoteBlast->new(@params, -ENTREZ_QUERY
>>>>>> =>
>>>>>> '$organ[ORGN]');
>>>>>>
>>>>>> #my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
>>>>>>
>>>>>>  #change a paramter
>>>>>>
>>>>>> #$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Trypanosoma
>>>>>> Brucei[ORGN]';
>>>>>>
>>>>>> #change a paramter
>>>>>> # $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} =
>>>>>> '$input2[ORGN]';
>>>>>>
>>>>>>  my $v = 1;
>>>>>>  #$v is just to turn on and off the messages
>>>>>>
>>>>>> my $str = Bio::SeqIO->new('-file' => $nuc , '-format' => 'fasta' ,
>>>>>> '-organism' => $organ );
>>>>>>
>>>>>>
>>>>>> while (my $input = $str->next_seq())
>>>>>> {
>>>>>>  #Blast a sequence against a database:
>>>>>>   #Alternatively, you could  pass in a file with many
>>>>>>   #sequences rather than loop through sequence one at a time
>>>>>>   #Remove the loop starting 'while (my $input = $str->next_seq())'
>>>>>>   #and swap the two lines below for an example of that.
>>>>>>
>>>>>>            #open(OUTFILE,'>',$debugfile);
>>>>>>             # print OUTFILE $input;
>>>>>>             #close(OUTFILE);
>>>>>>
>>>>>>
>>>>>>  my $r = $factory->submit_blast($input);
>>>>>>
>>>>>>               open(OUTFILE,'>',$debugfile);
>>>>>>            #   print OUTFILE $r;
>>>>>>               close(OUTFILE);
>>>>>>
>>>>>>  print STDERR "waiting...." if($v>0);
>>>>>>
>>>>>>  while ( my @rids = $factory->each_rid ) {
>>>>>>  #   open(OUTFILE,'>',$debugfile);
>>>>>>   #           print OUTFILE "while entered";
>>>>>>    #         close(OUTFILE);
>>>>>>    foreach my $rid ( @rids ) {
>>>>>>
>>>>>>     #         open(OUTFILE,'>',$debugfile);
>>>>>>      #        print OUTFILE "foreach entered";
>>>>>>       #      close(OUTFILE);
>>>>>>
>>>>>>       my $rc = $factory->retrieve_blast($rid);
>>>>>>
>>>>>>       if( !ref($rc) )
>>>>>>       {
>>>>>>       if( $rc < 0 )
>>>>>>       {
>>>>>>       $factory->remove_rid($rid);
>>>>>>       }
>>>>>>        open(OUTFILE,'>',$debugfile);
>>>>>>        #      print OUTFILE "if entered";
>>>>>>             close(OUTFILE);
>>>>>>        print STDERR "." if ( $v > 0 );
>>>>>>        sleep 5;
>>>>>>       }
>>>>>>      else {
>>>>>>         #    open(OUTFILE,'>',$debugfile);
>>>>>>          #    print OUTFILE "else entered";
>>>>>>           #  close(OUTFILE);
>>>>>>
>>>>>>         my $result = $rc->next_result();
>>>>>>        #save the output
>>>>>>       $blastdebugfile = $serverpath."/blastdebug_".time().".txt";
>>>>>>
>>>>>>         open(BLASTDEBUGFILE,'>',$blastdebugfile);
>>>>>>         print BLASTDEBUGFILE $result->next_hit();
>>>>>>         close(BLASTDEBUGFILE);
>>>>>>
>>>>>>       my $filename =
>>>>>> $serverpath."/blastdata_".time().$result->query_name()."\.out";
>>>>>>
>>>>>>        # open(DEBUGFILE,'>',$debugfile);
>>>>>>        # open(new,'>',$filename);
>>>>>>        # @arra=<new>;
>>>>>>        # print DEBUGFILE @arra;
>>>>>>        # close(DEBUGFILE);
>>>>>>        # close(new);
>>>>>>
>>>>>>        $factory->save_output($filename);
>>>>>>  # open(BLASTDEBUGFILE,'>',$debugfile);
>>>>>>      # print BLASTDEBUGFILE  "Hello $rid";
>>>>>>      # close(BLASTDEBUGFILE);
>>>>>>
>>>>>>      $factory->remove_rid($rid);
>>>>>>
>>>>>>      open(BLASTDEBUGFILE,'>',$blastdebugfile);
>>>>>>      print BLASTDEBUGFILE  $organism;
>>>>>>       close(BLASTDEBUGFILE);
>>>>>>
>>>>>>   # open(OUTFILE,'>',$outfile);
>>>>>>   # print OUTFILE "Test2 $result->database_name()";
>>>>>>   # close(OUTFILE);
>>>>>>
>>>>>> #$hit = $result->next_hit;
>>>>>> #open(new,'>',$debugfile);
>>>>>> #print $hit;
>>>>>> #close(new);
>>>>>>
>>>>>>  while ( my $hit = $result->next_hit ) {
>>>>>>
>>>>>>           next unless ( $v > 0);
>>>>>>
>>>>>>         #     open(OUTFILE,'>',$debugfile);
>>>>>>          #    print OUTFILE "$hit in while hits";
>>>>>>           #  close(OUTFILE);
>>>>>>
>>>>>>      my $sequ = $gb->get_Seq_by_version($hit->name);
>>>>>>          my $dna = $sequ->seq();        # get the sequence as a string
>>>>>>                 push(@seqs,$dna);
>>>>>>         }
>>>>>>       }
>>>>>>     }
>>>>>>   }
>>>>>>  }
>>>>>>
>>>>>>  #open(OUTFILE,'>',$debugfile);
>>>>>>  #print OUTFILE $seqs[0];
>>>>>>  #close(OUTFILE);
>>>>>>
>>>>>> return(@seqs);
>>>>>>
>>>>>> }
>>>>>>
>>>>>> Regards,
>>>>>> Roopa.
>>>>>>
>>>>>>
>>>>>> On Fri, Jan 8, 2010 at 4:36 PM, Mark A. Jensen <maj at fortinbras.us>
>>>>>> wrote:
>>>>>>
>>>>>> Hi Roopa--
>>>>>>>
>>>>>>> I got your code to work with the following changes:
>>>>>>>
>>>>>>> +# the input should be a valid FASTA file...
>>>>>>> ...
>>>>>>> open(NUC,'>',$nuc);
>>>>>>> +print NUC ">seq (need a name line for valid fasta)\n";
>>>>>>> print NUC $inpu1, "\n";
>>>>>>> close(NUC);
>>>>>>> ...
>>>>>>>
>>>>>>> +# you can set these header parms in the call itself...
>>>>>>> - my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
>>>>>>> + my $factory = Bio::Tools::Run::RemoteBlast->new(@params,
>>>>>>> -ENTREZ_QUERY =>
>>>>>>> ''Trypanosoma Brucei[ORGN]');
>>>>>>>
>>>>>>>  #change a paramter
>>>>>>> +# commented this out...
>>>>>>> +# $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} =
>>>>>>> 'Trypanosoma
>>>>>>> Brucei[ORGN]';
>>>>>>>
>>>>>>> MAJ
>>>>>>> ----- Original Message ----- From: "Roopa Raghuveer" <
>>>>>>> rtbio.2009 at gmail.com
>>>>>>> >
>>>>>>> To: <bioperl-l at lists.open-bio.org>
>>>>>>> Sent: Friday, January 08, 2010 10:00 AM
>>>>>>> Subject: [Bioperl-l] Regarding blast in Bioperl
>>>>>>>
>>>>>>>
>>>>>>>  Hello all,
>>>>>>>
>>>>>>>>
>>>>>>>> I was trying Remote blast using Bioperl. My input data is a
>>>>>>>> Trypanosoma
>>>>>>>> brucei sequence in Fasta format. When I was trying to submit to
>>>>>>>> BLAST
>>>>>>>> using
>>>>>>>> the step
>>>>>>>> $r=$factory->submit_blast($input)
>>>>>>>> It was not returning anything which I checked by debugging the code.
>>>>>>>> It is
>>>>>>>> not blasting my input sequence even though I mentioned all the
>>>>>>>> parameters.I
>>>>>>>> would paste the code below.
>>>>>>>>
>>>>>>>> Please help me in solving put this problem. It is very urgent.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Roopa.
>>>>>>>>
>>>>>>>> #!/usr/bin/perl
>>>>>>>>
>>>>>>>> #path for extra camel module
>>>>>>>> use lib "/srv/www/htdocs/rain/RNAi/";
>>>>>>>> use Roopablast;
>>>>>>>>
>>>>>>>>
>>>>>>>> use Bio::SearchIO;
>>>>>>>> use Bio::Search::Result::BlastResult;
>>>>>>>> use Bio::Perl;
>>>>>>>> use Bio::Tools::Run::RemoteBlast;
>>>>>>>> use Bio::Seq;
>>>>>>>> use Bio::SeqIO;
>>>>>>>> use Bio::DB::GenBank;
>>>>>>>>
>>>>>>>> $serverpath = "/srv/www/htdocs/rain/RNAi";
>>>>>>>> $serverurl = "http://141.84.66.66/rain/RNAi";
>>>>>>>> $outfile = $serverpath."/rnairesult_".time().".html";
>>>>>>>> $nuc = $serverpath."/nuc".time().".txt";
>>>>>>>> $debugfile = $serverpath."/debug_".time().".txt";
>>>>>>>> $blastdebugfile = $serverpath."/blastdebug_".time().".txt";
>>>>>>>>
>>>>>>>> my $outstring ="";
>>>>>>>>
>>>>>>>> &parse_form;
>>>>>>>>
>>>>>>>> print "Content-type: text/html\n\n";
>>>>>>>> print "<HTML>\n";
>>>>>>>> print "<head><title>RNAi Result</title>";
>>>>>>>> print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30;
>>>>>>>> URL=$serverurl/rnairesult_".time().".html\"> \n";
>>>>>>>> print "</head>\n";
>>>>>>>> print "<body>\n";
>>>>>>>> print " Your results will appear <a
>>>>>>>> href=$serverurl/rnairesult_".time().".html>here</a><br>";
>>>>>>>> print " Please be patient, runtime can be up to 5 minutes<br>";
>>>>>>>> print " This page will automatically reload in 30 seconds. Roopa";
>>>>>>>> print "</BODY>\n";
>>>>>>>> print "</HTML>\n";
>>>>>>>>
>>>>>>>> defined(my $pid = fork) or die "Can't fork: $!";
>>>>>>>> exit if $pid;
>>>>>>>> open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
>>>>>>>> open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
>>>>>>>> open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> open(OUTFILE, '>',$outfile);
>>>>>>>>
>>>>>>>> print OUTFILE "<HTML>\n
>>>>>>>> <head><title>RNAi Result</title>
>>>>>>>> <META HTTP-EQUIV=\"Refresh\" CONTENT=\"30;
>>>>>>>> URL=$serverurl//rnairesult_".time().".html\"> \n
>>>>>>>> <meta http-equiv=\"expires\" content=\"0\">
>>>>>>>> </head>\n
>>>>>>>> <body>\n
>>>>>>>>  Your results will appear <a
>>>>>>>> href=$serverurl/rnairesult_".time().".html>here</a><br>
>>>>>>>>  Please be patient, runtime can be up to 5 minutes wait wait
>>>>>>>> wait......<br>
>>>>>>>> This page will automatically reload in 30 seconds Roopa <br>
>>>>>>>> </BODY>\n
>>>>>>>> </HTML>\n";
>>>>>>>>
>>>>>>>> close(OUTFILE);
>>>>>>>>
>>>>>>>>
>>>>>>>> @compseqs = blastcode($in{'Inputseq'});
>>>>>>>>
>>>>>>>> $in{'Inputseq'} =~ s/>.*$//m;
>>>>>>>> $in{'Inputseq'} =~ s/[^TAGC]//gim;
>>>>>>>> $in{'Inputseq'} =~ tr/actg/ACTG/;
>>>>>>>>
>>>>>>>> @out = similar($in{'Inputseq'}, \@compseqs, $in{'Windowsize'},
>>>>>>>> $in{'Threshold'});
>>>>>>>>
>>>>>>>>
>>>>>>>> sub blastcode
>>>>>>>> {
>>>>>>>>
>>>>>>>> $inpu1= $_[0];
>>>>>>>>
>>>>>>>> #$organ= $_[1];
>>>>>>>>
>>>>>>>> open(NUC,'>',$nuc);
>>>>>>>> print NUC $inpu1;
>>>>>>>> close(NUC);
>>>>>>>>
>>>>>>>> my $prog = 'blastn';
>>>>>>>> my $db   = 'refseq_rna';
>>>>>>>> my $e_val= '1e-10';
>>>>>>>> my $organism= 'Trypanosoma Brucei';
>>>>>>>>
>>>>>>>> $gb = new Bio::DB::GenBank;
>>>>>>>>
>>>>>>>> my @params = ( '-prog' => $prog,
>>>>>>>>       '-data' => $db,
>>>>>>>>       '-expect' => $e_val,
>>>>>>>>       '-readmethod' => 'SearchIO',
>>>>>>>>       '-Organism'   => $organism );
>>>>>>>>
>>>>>>>>          # open(OUTFILE,'>',$debugfile);
>>>>>>>>           #  print OUTFILE @params;
>>>>>>>>           # close(OUTFILE);
>>>>>>>>
>>>>>>>>
>>>>>>>> my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
>>>>>>>>
>>>>>>>>  #change a paramter
>>>>>>>>
>>>>>>>> $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Trypanosoma
>>>>>>>> Brucei[ORGN]';
>>>>>>>>
>>>>>>>> #change a paramter
>>>>>>>> # $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} =
>>>>>>>> '$input2[ORGN]';
>>>>>>>>
>>>>>>>>  my $v = 1;
>>>>>>>>  #$v is just to turn on and off the messages
>>>>>>>>
>>>>>>>> my $str = Bio::SeqIO->new('-file' => $nuc , '-format' => 'fasta' ,
>>>>>>>> '-organism' => 'Trypanosoma Brucei' );
>>>>>>>>
>>>>>>>>
>>>>>>>> while (my $input = $str->next_seq())
>>>>>>>> {
>>>>>>>>  #Blast a sequence against a database:
>>>>>>>>  #Alternatively, you could  pass in a file with many
>>>>>>>>  #sequences rather than loop through sequence one at a time
>>>>>>>>  #Remove the loop starting 'while (my $input = $str->next_seq())'
>>>>>>>>  #and swap the two lines below for an example of that.
>>>>>>>>
>>>>>>>>           open(OUTFILE,'>',$debugfile);
>>>>>>>>             print OUTFILE $input;
>>>>>>>>            close(OUTFILE);
>>>>>>>>
>>>>>>>>
>>>>>>>>  my $r = $factory->submit_blast($input);    #The program stops here
>>>>>>>> it
>>>>>>>> does not return any value and it does not enter the While
>>>>>>>> loop,Please help
>>>>>>>> me in this regard.#
>>>>>>>>              open(OUTFILE,'>',$debugfile);
>>>>>>>>              print OUTFILE $r;
>>>>>>>>              close(OUTFILE);
>>>>>>>>
>>>>>>>>
>>>>>>>>  print STDERR "waiting...." if($v>0);
>>>>>>>>
>>>>>>>>  while ( my @rids = $factory->each_rid ) {
>>>>>>>>    open(OUTFILE,'>',$debugfile);
>>>>>>>>             print OUTFILE "while entered";
>>>>>>>>            close(OUTFILE);
>>>>>>>>   foreach my $rid ( @rids ) {
>>>>>>>>
>>>>>>>>             open(OUTFILE,'>',$debugfile);
>>>>>>>>             print OUTFILE "foreach entered";
>>>>>>>>            close(OUTFILE);
>>>>>>>>
>>>>>>>>      my $rc = $factory->retrieve_blast($rid);
>>>>>>>>
>>>>>>>>      if( !ref($rc) )
>>>>>>>>      {
>>>>>>>>      if( $rc < 0 )
>>>>>>>>      {
>>>>>>>>      $factory->remove_rid($rid);
>>>>>>>>      }
>>>>>>>>       open(OUTFILE,'>',$debugfile);
>>>>>>>>             print OUTFILE "if entered";
>>>>>>>>            close(OUTFILE);
>>>>>>>>       print STDERR "." if ( $v > 0 );
>>>>>>>>       sleep 5;
>>>>>>>>      }
>>>>>>>>     else {
>>>>>>>>            open(OUTFILE,'>',$debugfile);
>>>>>>>>             print OUTFILE "else entered";
>>>>>>>>            close(OUTFILE);
>>>>>>>>
>>>>>>>>        my $result = $rc->next_result();
>>>>>>>>       #save the output
>>>>>>>>      $blastdebugfile = $serverpath."/blastdebug_".time().".txt";
>>>>>>>>
>>>>>>>>        open(BLASTDEBUGFILE,'>',$blastdebugfile);
>>>>>>>>        print BLASTDEBUGFILE $result->next_hit();
>>>>>>>>        close(BLASTDEBUGFILE);
>>>>>>>>
>>>>>>>>      my $filename =
>>>>>>>> $serverpath."/blastdata_".time().$result->query_name()."\.out";
>>>>>>>>
>>>>>>>>       # open(DEBUGFILE,'>',$debugfile);
>>>>>>>>       # open(new,'>',$filename);
>>>>>>>>       # @arra=<new>;
>>>>>>>>       # print DEBUGFILE @arra;
>>>>>>>>       # close(DEBUGFILE);
>>>>>>>>       # close(new);
>>>>>>>>
>>>>>>>>       $factory->save_output($filename);
>>>>>>>>
>>>>>>>>     # open(BLASTDEBUGFILE,'>',$debugfile);
>>>>>>>>     # print BLASTDEBUGFILE  "Hello $rid";
>>>>>>>>     # close(BLASTDEBUGFILE);
>>>>>>>>
>>>>>>>>     $factory->remove_rid($rid);
>>>>>>>>
>>>>>>>>     open(BLASTDEBUGFILE,'>',$blastdebugfile);
>>>>>>>>     print BLASTDEBUGFILE  $organism;
>>>>>>>>      close(BLASTDEBUGFILE);
>>>>>>>>
>>>>>>>>  # open(OUTFILE,'>',$outfile);
>>>>>>>>  # print OUTFILE "Test2 $result->database_name()";
>>>>>>>>  # close(OUTFILE);
>>>>>>>>
>>>>>>>> #$hit = $result->next_hit;
>>>>>>>> #open(new,'>',$debugfile);
>>>>>>>> #print $hit;
>>>>>>>> #close(new);
>>>>>>>>
>>>>>>>>  while ( my $hit = $result->next_hit ) {
>>>>>>>>
>>>>>>>>          next unless ( $v > 0);
>>>>>>>>
>>>>>>>>        #     open(OUTFILE,'>',$debugfile);
>>>>>>>>         #    print OUTFILE "$hit in while hits";
>>>>>>>>          #  close(OUTFILE);
>>>>>>>>
>>>>>>>>     my $sequ = $gb->get_Seq_by_version($hit->name);
>>>>>>>>         my $dna = $sequ->seq();        # get the sequence as a
>>>>>>>> string
>>>>>>>>                push(@seqs,$dna);
>>>>>>>>        }
>>>>>>>>      }
>>>>>>>>    }
>>>>>>>>  }
>>>>>>>>  }
>>>>>>>>
>>>>>>>>  #open(OUTFILE,'>',$debugfile);
>>>>>>>>  #print OUTFILE $seqs[0];
>>>>>>>>  #close(OUTFILE);
>>>>>>>>
>>>>>>>> return(@seqs);
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>> open(OUTFILE, '>',$outfile) || die ;
>>>>>>>>
>>>>>>>> print OUTFILE "<HTML>\n
>>>>>>>> <head><title>RNAi Result</title>
>>>>>>>> <meta http-equiv=\"expires\" content=\"0\"></head>\n
>>>>>>>> <body>\n
>>>>>>>> <p><font face=\"Courier, monospace font set\">
>>>>>>>> Inputsequence: <br>";
>>>>>>>>
>>>>>>>> for ($i=0; $i<length ($in{'Inputseq'}); $i++) {
>>>>>>>>
>>>>>>>>  print OUTFILE substr ($in{'Inputseq'}, $i, 1);
>>>>>>>>
>>>>>>>>  if ( ($i+1)%10==0){
>>>>>>>>      print OUTFILE " ";
>>>>>>>>  }
>>>>>>>>  if ( ($i+1)%60==0){
>>>>>>>>      print OUTFILE "<br>\n";
>>>>>>>>  }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> print OUTFILE "</font> <p>";
>>>>>>>>
>>>>>>>> $z=@compseqs;
>>>>>>>>
>>>>>>>> for($k=1;$k<$z;$k++) {
>>>>>>>>  print OUTFILE "<font face=\"Courier, monospace font
>>>>>>>> set\"><p>Compare
>>>>>>>> Sequence: <br>";
>>>>>>>>
>>>>>>>>  for ($i=0; $i<length ($compseqs[$k]); $i++) {
>>>>>>>>
>>>>>>>>      print OUTFILE substr ($compseqs[$k], $i, 1);
>>>>>>>>
>>>>>>>>      if ( ($i+1)%10==0){
>>>>>>>>          print OUTFILE " ";
>>>>>>>>      }
>>>>>>>>      if ( ($i+1)%60==0){
>>>>>>>>          print OUTFILE "<br>\n";
>>>>>>>>      }
>>>>>>>>  }
>>>>>>>>  print OUTFILE "<p></font>";
>>>>>>>> }
>>>>>>>>
>>>>>>>> print OUTFILE "<p>
>>>>>>>> Window: <br>$in{'Windowsize'}
>>>>>>>> <p>
>>>>>>>> <p>
>>>>>>>> Threshold: <br>$in{'Threshold'}
>>>>>>>> <p>";
>>>>>>>> my $j=0;
>>>>>>>>
>>>>>>>> for ($i=0; $i<length ($in{'Inputseq'}); $i++) {
>>>>>>>>
>>>>>>>>  if ($i<=length ($in{'Inputseq'})-$in{'Windowsize'}){
>>>>>>>>      if ($out[$i]->{similar}<=$in{'Threshold'}){
>>>>>>>>          $j=$in{'Windowsize'};
>>>>>>>>      }
>>>>>>>>      $height=$out[$i]->{similar}*5;
>>>>>>>>  }
>>>>>>>>
>>>>>>>>  if ($j>0) {
>>>>>>>>      print OUTFILE "<img src=\"$serverurl/blue.gif\" width=\"1\"
>>>>>>>> height=\"5\">";
>>>>>>>>      $outstring .= "<font color=\"green\">".substr ($in{'Inputseq'},
>>>>>>>> $i,
>>>>>>>> 1)."</font>";
>>>>>>>>      $j--;
>>>>>>>>  }
>>>>>>>>  else {
>>>>>>>>      print OUTFILE "<img src=\"$serverurl/red.gif\" width=\"1\"
>>>>>>>> height=\"5\">";
>>>>>>>>      $outstring .= "<font color=\"red\">".substr ($in{'Inputseq'},
>>>>>>>> $i,
>>>>>>>> 1)."</font>";
>>>>>>>>  }
>>>>>>>>
>>>>>>>>  if ( ($i+1)%10==0){
>>>>>>>>      $outstring .= " ";
>>>>>>>>  }
>>>>>>>>  if ( ($i+1)%60==0){
>>>>>>>>      $outstring .= "<br>\n";
>>>>>>>>
>>>>>>>>  }
>>>>>>>>  if ( ($i+1)%800==0){
>>>>>>>>      print OUTFILE "<br><br>\n";
>>>>>>>>
>>>>>>>>  }
>>>>>>>> }
>>>>>>>>
>>>>>>>> print OUTFILE "<br><br><font face=\"Courier, monospace font
>>>>>>>> set\">$outstring</font>";
>>>>>>>>
>>>>>>>> #foreach (@out) {
>>>>>>>> #print OUTFILE "<p>Sequence: $_->{sequence}: $_->{similar}
>>>>>>>> matchs<p>";
>>>>>>>> #if ($_->{similar}<=$in{'Threshold'}){
>>>>>>>>
>>>>>>>> #    }
>>>>>>>> #}
>>>>>>>>
>>>>>>>> print OUTFILE "</BODY>\n</HTML>\n";
>>>>>>>>
>>>>>>>> close OUTFILE;
>>>>>>>>
>>>>>>>> #nameprint();
>>>>>>>>
>>>>>>>> sub parse_form {
>>>>>>>>  local ($buffer, @pairs, $pair, $name, $value);
>>>>>>>>  # Read in text
>>>>>>>>  $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
>>>>>>>>  if ($ENV{'REQUEST_METHOD'} eq "POST")
>>>>>>>>  {
>>>>>>>>      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>>>>>>>>  }
>>>>>>>>  else
>>>>>>>>  {
>>>>>>>>      $buffer = $ENV{'QUERY_STRING'};
>>>>>>>>  }
>>>>>>>>  @pairs = split(/&/, $buffer);
>>>>>>>>  foreach $pair (@pairs)
>>>>>>>>  {
>>>>>>>>      ($name, $value) = split(/=/, $pair);
>>>>>>>>      $value =~ tr/+/ /;
>>>>>>>>      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>>>>>>>>      $in{$name} = $value;
>>>>>>>>  }
>>>>>>>> }
>>>>>>>> _______________________________________________
>>>>>>>> Bioperl-l mailing list
>>>>>>>> Bioperl-l at lists.open-bio.org
>>>>>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>> Bioperl-l mailing list
>>>>>> Bioperl-l at lists.open-bio.org
>>>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>



More information about the Bioperl-l mailing list