[Bioperl-l] blastall problem

Jason Stajich jason at bioperl.org
Fri Apr 6 18:40:42 UTC 2007


Looks like you need to deal with buffering:

http://perl.plover.com/FAQs/Buffering.html

So you need to add this:
close(OUTPUT);

Alternatively you can build a sequence object and pass that in to the  
BLAST factory, then you don't have to mess around with creating  
temporary files or run into this sort of problem.

-jason
On Apr 6, 2007, at 10:39 AM, DeeGee wrote:

>
> Following is the part of my script, which is in the 'htdocs'  
> directory:
>
> ####### part of my script #############
> #generate a new CGI object from the input to the CGI script
> my $query=new CGI;
>
> open(OUTPUT,">/export/home/local/apache2/htdocs/result/fasta.faa");
>
> print STDOUT $query->header();
> print STDOUT $query->start_html(-title=>"Response from blast",
> -BGCOLOR=>"#FFFFFF");
> print STDOUT "\n<h1><center>Results from the BLAST</center></h1>\n";
>
> #gets the sequence from the html textarea with “post” method
> my $fasta_file=$query->param('sequence');
> print OUTPUT $fasta_file;
>
close(OUTPUT);
> #Local blast of the input sequence against nr database
> my $Seq_in = Bio::SeqIO->new (-file => 'result/fasta.faa', -format =>
> 'Fasta');
> die "could not open fasta" if not defined $Seq_in;
> my $queryin = $Seq_in->next_seq();
> die "could not get seq" if not defined $queryin;
> my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  =>  
> 'blastp',
>                                                  'database' =>
> '/export/home/dorjee/database/nr',
>                                                  _READMETHOD =>  
> 'Blast'
>                                                    );
> $factory->outfile("result/out.blast");
> my $blastreport = $factory->blastall($queryin);
> .....
>
> Thank you.
>
>
>
> Jason Stajich-3 wrote:
>>
>> When/How are are you writing your sequences to this file result.faa?
>> are you using seqIO or bioperl to write the sequence  to a file?
>> I'm wondering if this is I/O buffering problem.
>>
>> On Apr 5, 2007, at 8:26 PM, DeeGee wrote:
>>
>>>
>>> hi Torsten,
>>> blastall -p blastp -i result/fasta.faa -d /export/home/database/nr
>>> works
>>> perfectly fine on the command line, and the 'fasta.faa' is in fasta
>>> format:
>>>
>>>> gi|18676474|dbj|BAB84889.1| FLJ00134 protein [Homo sapiens]
>>> HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAA 
>>> SV
>>> SPSMTVASSQ
>>> QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIP 
>>> LA
>>> GTAPGAEGPA
>>> PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGK 
>>> AF
>>> RRKEHLRRHR
>>> DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVL 
>>> RH
>>> QRIHGRAAAS
>>> AQGAVAPGPDGGGPFPPWPLG
>>>
>>> it seems like i'm just one bloody step away from success. ^ ^*
>>> can't figure
>>> out the prob.
>>> thanks for your help.
>>>
>>>
>>> Torsten Seemann wrote:
>>>>
>>>> Dorjee,
>>>>
>>>>> thanks alot for your reply again. as per your suggestion (using  
>>>>> 'die
>>>>> "could
>>>>> not get seq" if not defined $queryin;'), i now get the following
>>>>> error
>>>>> message:
>>>>> Software error:
>>>>> could not get seq at /usr/local/apache2/htdocs/remote_ncbi.pl
>>>>> line 50.
>>>>> i've attached the script. could you plz have a look at it and see
>>>>> where
>>>>> am i
>>>>> going wrong.
>>>>> cheers mate!
>>>>
>>>> This strongly suggests that your FASTA file is not actually in  
>>>> FASTA
>>>> format.
>>>> http://en.wikipedia.org/wiki/Fasta_format
>>>>
>>>> Does it work if you pass it to blastall on the command line?
>>>> eg. blastall -p blastp -i result/fasta.faa -d /export/home/
>>>> database/nr
>>>>
>>>>> Saier Lab.
>>>>> 858-534-2457
>>>>
>>>> Are you working at UCSD?
>>>>
>>>> --Torsten
>>>> _______________________________________________
>>>> Bioperl-l mailing list
>>>> Bioperl-l at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context: http://www.nabble.com/blastall-
>>> problem-tf3527412.html#a9867402
>>> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>> --
>> Jason Stajich
>> Miller Research Fellow
>> University of California, Berkeley
>> lab: 510.642.8441
>> http://pmb.berkeley.edu/~taylor/people/js.html
>> http://fungalgenomes.org/
>>
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>
> -- 
> View this message in context: http://www.nabble.com/blastall- 
> problem-tf3527412.html#a9875685
> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441
http://pmb.berkeley.edu/~taylor/people/js.html
http://fungalgenomes.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20070406/e9477659/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2613 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20070406/e9477659/attachment.p7s>


More information about the Bioperl-l mailing list