blastall problem

View: New views
15 Messages — Rating Filter:   Alert me  

blastall problem

by DeeGee () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,
can anyone plz help me out with this problem that i've been dealing with for quite a while now. following is a part of my script that's not working for some reason. it is suppose to get the sequence from 'result/fasta.faa' and do the blast.

###my script ###########
......
my $Seq_in = Bio::SeqIO->new (-file => 'result/fasta.faa', '-format' => 'Fasta');
my $queryin = $Seq_in->next_seq();
my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  => 'blastp',
                                                 'database' => '/export/home/database/nr',
                                                 _READMETHOD => 'Blast'
                                                  );
$factory->outfile("result/out.blast");
my $blastreport = $factory->blastall($queryin);
.....

when i paste the protein sequence into the textarea of my html page and save the same as 'result/fasta.faa', so that the above script would do the blast, i get the following error:

Software error:
------------- EXCEPTION  -------------
MSG:    not Bio::Seq object or array of Bio::Seq objects or file name!
STACK Bio::Tools::Run::StandAloneBlast::blastpgp /usr/perl5/5.6.1/lib/Bio/Tools/Run/StandAloneBlast.pm:611
STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50
--------------------------------------
i would appreciate your help.
i would also like to add that the 'result/fasta.faa' has the sequence saved in it. i don't think that there's anything wrong with the open(OUTPUT,">result/fasta.faa"); line as i could get the 'fasta.faa' file with the sequence in it. it looks like the blast is not being able to read from the result/fasta.faa. ^ ^*

Re: blastall problem

by David Messina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The code snippet worked fine for me. I believe the problem is that  
'result/fasta.faa' is not getting passed to your code properly. You  
might try specifying a complete path to your input and output file --  
relative paths, especially through a web app, can be tricky.

> when i paste the protein sequence into the textarea of my html page  
> and save
> the same as 'result/fasta.faa', so that the above script would do  
> the blast,

I'm not sure from what you wrote -- did you try running your script  
on the command line (having created 'result/fasta.faa' manually  
first)? If that is working for you, then the problem is with getting  
the data from the webpage into the script, not with the blasting part.

Dave

This is what I did:

  % ls test.pl testp*
test.pl       testp.fa

% formatdb -i testp.fa

% ls test.pl testp*
test.pl       testp.fa      testp.fa.phr  testp.fa.pin  testp.fa.psq

% perl test.pl testp.fa
%  head -10 out.blast
BLASTP 2.2.10 [Oct-19-2004]


Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A.  
Schaffer,
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs",  Nucleic Acids Res. 25:3389-3402.

Query= gi|64654269|gb|AAH96193.1| HOXB1 protein [Homo sapiens]
          (235 letters)


Your code: I changed only the input filename and the input database  
name, and saved the script as test.pl
-----------------------
#!/usr/bin/perl

use strict;
use warnings;
use Bio::SeqIO;
use Bio::Tools::Run::StandAloneBlast;

my $Seq_in = Bio::SeqIO->new (-file => $ARGV[0], '-format' =>
'Fasta');
my $queryin = $Seq_in->next_seq();
my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  =>  
'blastp',
                                                  'database' =>
'testp.fa',
                                                  _READMETHOD => 'Blast'
                                                   );
$factory->outfile("out.blast");
my $blastreport = $factory->blastall($queryin);
------------------------------------------------------------------------
-----------
_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply Dave. I don't think that there's anything wrong with the open(OUTPUT,">result/fasta.faa"); line as I could get the 'fasta.faa' file with the sequence in it. I see it. It looks like the blast is not being able to read from the result/fasta.faa.
^ ^*



Dave Messina-2 wrote:
The code snippet worked fine for me. I believe the problem is that  
'result/fasta.faa' is not getting passed to your code properly. You  
might try specifying a complete path to your input and output file --  
relative paths, especially through a web app, can be tricky.

> when i paste the protein sequence into the textarea of my html page  
> and save
> the same as 'result/fasta.faa', so that the above script would do  
> the blast,

I'm not sure from what you wrote -- did you try running your script  
on the command line (having created 'result/fasta.faa' manually  
first)? If that is working for you, then the problem is with getting  
the data from the webpage into the script, not with the blasting part.

Dave

This is what I did:

  % ls test.pl testp*
test.pl       testp.fa

% formatdb -i testp.fa

% ls test.pl testp*
test.pl       testp.fa      testp.fa.phr  testp.fa.pin  testp.fa.psq

% perl test.pl testp.fa
%  head -10 out.blast
BLASTP 2.2.10 [Oct-19-2004]


Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A.  
Schaffer,
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs",  Nucleic Acids Res. 25:3389-3402.

Query= gi|64654269|gb|AAH96193.1| HOXB1 protein [Homo sapiens]
          (235 letters)


Your code: I changed only the input filename and the input database  
name, and saved the script as test.pl
-----------------------
#!/usr/bin/perl

use strict;
use warnings;
use Bio::SeqIO;
use Bio::Tools::Run::StandAloneBlast;

my $Seq_in = Bio::SeqIO->new (-file => $ARGV[0], '-format' =>
'Fasta');
my $queryin = $Seq_in->next_seq();
my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  =>  
'blastp',
                                                  'database' =>
'testp.fa',
                                                  _READMETHOD => 'Blast'
                                                   );
$factory->outfile("out.blast");
my $blastreport = $factory->blastall($queryin);
------------------------------------------------------------------------
-----------
_______________________________________________
Bioperl-l mailing list
Bioperl-l@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Torsten Seemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Software error:
> ------------- EXCEPTION  -------------
> MSG:    not Bio::Seq object or array of Bio::Seq objects or file name!
> STACK Bio::Tools::Run::StandAloneBlast::blastpgp
> /usr/perl5/5.6.1/lib/Bio/Tools/Run/StandAloneBlast.pm:611
> STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50

> my $Seq_in = Bio::SeqIO->new (-file => 'result/fasta.faa', '-format' => 'Fasta');

Does this still happen if you give the full path to the FASTA file?
eg. -file => /usr/local/apache2/htdocs/result/fasta.faa
(I'm guessing what the full path is here)

--Torsten
_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi Torsten,
Yes, it still gives me the same error even if I give the full path to the fasta file. Following is how I did:

####### part of my script #######
my $Seq_in = Bio::SeqIO->new (-file => '/export/home/local/apache2/htdocs/result/fasta.faa', -format => 'Fasta');
my $queryin = $Seq_in->next_seq();
my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  => 'blastp',
                                                 'database' => '/export/home/dorjee/database/nrpart',
                                                 _READMETHOD => 'Blast'
                                                   );
$factory->outfile("/export/home/local/apache2/htdocs/result/out.blast");
my $blastreport = $factory->blastall($queryin);
....

thanks man.


Torsten Seemann wrote:
> Software error:
> ------------- EXCEPTION  -------------
> MSG:    not Bio::Seq object or array of Bio::Seq objects or file name!
> STACK Bio::Tools::Run::StandAloneBlast::blastpgp
> /usr/perl5/5.6.1/lib/Bio/Tools/Run/StandAloneBlast.pm:611
> STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50

> my $Seq_in = Bio::SeqIO->new (-file => 'result/fasta.faa', '-format' => 'Fasta');

Does this still happen if you give the full path to the FASTA file?
eg. -file => /usr/local/apache2/htdocs/result/fasta.faa
(I'm guessing what the full path is here)

--Torsten
_______________________________________________
Bioperl-l mailing list
Bioperl-l@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Torsten Seemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DeeGee,

Please add the following lines to help deduce the problem:

> 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;

Does anything happen now?

...

Some other comments:

> my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  => 'blastp',
> STACK Bio::Tools::Run::StandAloneBlast::blastpgp

I'm not sure why it is in the blastpgp() method when you chose
$factory->blastall() ?

>                                                  _READMETHOD => 'Blast'

I don't think this is required anymore in modern Bioperl. Are you
using 1.5.x or bioperl-live ?

> when i paste the protein sequence into the textarea of my html page and
> STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50

So this is a CGI script?
Does the script run as user 'apache' or 'httpd', or as yourself via SuEXEC?
Does 'apache' have permissions to READ/WRITE the result/ directory?

--Torsten
_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks again, Torsten. I tried (die "could not get seq" if not defined $queryin;) as you suggested, and now I get the following error message:

Software error:
could not get seq at /usr/local/apache2/htdocs/remote_ncbi.pl line 50.

Does this mean that next_seq() method in 'my $queryin = $Seq_in->next_seq();' has some problem? How can I fix it? I would appreciate your help.
Cheers!




Torsten Seemann wrote:
DeeGee,

Please add the following lines to help deduce the problem:

> 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;

Does anything happen now?

...

Some other comments:

> my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  => 'blastp',
> STACK Bio::Tools::Run::StandAloneBlast::blastpgp

I'm not sure why it is in the blastpgp() method when you chose
$factory->blastall() ?

>                                                  _READMETHOD => 'Blast'

I don't think this is required anymore in modern Bioperl. Are you
using 1.5.x or bioperl-live ?

> when i paste the protein sequence into the textarea of my html page and
> STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50

So this is a CGI script?
Does the script run as user 'apache' or 'httpd', or as yourself via SuEXEC?
Does 'apache' have permissions to READ/WRITE the result/ directory?

--Torsten
_______________________________________________
Bioperl-l mailing list
Bioperl-l@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Chris Fields :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Apr 5, 2007, at 4:09 PM, DeeGee wrote:

>
> Thanks again, Torsten. I tried (die "could not get seq" if not defined
> $queryin;) as you suggested, and now I get the following error  
> message:
>
> Software error:
> could not get seq at /usr/local/apache2/htdocs/remote_ncbi.pl line 50.
>
> Does this mean that next_seq() method in 'my $queryin =
> $Seq_in->next_seq();' has some problem? How can I fix it? I would  
> appreciate
> your help.
> Cheers!

This indicates there is likely some problem with your sequence file  
(either it isn't fasta or something else is wrong), but w/o actually  
seeing it we can't be sure.  I can't be sure but I don't think it is  
a next_seq() issue.  Also, if there are problems accessing the file  
the stream object should throw an error so I don't think it is that  
either...

chris

>
> Torsten Seemann wrote:
>>
>> DeeGee,
>>
>> Please add the following lines to help deduce the problem:
>>
>>> 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;
>>
>> Does anything happen now?
>>
>> ...
>>
>> Some other comments:
>>
>>> my $factory = Bio::Tools::Run::StandAloneBlast->new('program'  =>
>>> 'blastp',
>>> STACK Bio::Tools::Run::StandAloneBlast::blastpgp
>>
>> I'm not sure why it is in the blastpgp() method when you chose
>> $factory->blastall() ?
>>
>>>                                                  _READMETHOD =>  
>>> 'Blast'
>>
>> I don't think this is required anymore in modern Bioperl. Are you
>> using 1.5.x or bioperl-live ?
>>
>>> when i paste the protein sequence into the textarea of my html  
>>> page and
>>> STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:50
>>
>> So this is a CGI script?
>> Does the script run as user 'apache' or 'httpd', or as yourself via
>> SuEXEC?
>> Does 'apache' have permissions to READ/WRITE the result/ directory?
>>
>> --Torsten
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l@...
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
>
> --
> View this message in context: http://www.nabble.com/blastall- 
> problem-tf3527412.html#a9864004
> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@...
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign



_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Torsten Seemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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]
HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAASVSPSMTVASSQ
QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIPLAGTAPGAEGPA
PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGKAFRRKEHLRRHR
DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVLRHQRIHGRAAAS
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@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Jason Stajich-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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]
HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAASVSPSMTVASSQ
QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIPLAGTAPGAEGPA
PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGKAFRRKEHLRRHR
DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVLRHQRIHGRAAAS
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.

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



-- 
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.

_______________________________________________
Bioperl-l mailing list

--
Jason Stajich 
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441
http://fungalgenomes.org/



_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

smime.p7s (3K) Download Attachment

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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;

#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]
> HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAASV
> SPSMTVASSQ
> QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIPLA
> GTAPGAEGPA
> PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGKAF
> RRKEHLRRHR
> DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVLRH
> 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@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@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@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Bernd Web :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dorjee,

Do you now use complete file paths everywhere (instead of some
relative paths that were in your script).  Did you check all read and
execute permission (turn r, x on for group and others)? And regarding
the fasta file I'd suggest closing the filehandle after you printed
the fasta sequence to the file.

open(OUTPUT,">result/fasta.faa"); #don't use this relative path and
use the "die" as was suggested earlier.
.... your other code lines
print OUTPUT
"$desc\n$seqo\n";
close(OUTPUT); #close the file.

Also check if your complete script runs from the command-line as to be
sure your problems are not related to the webserver enviroment.


BTW I do think you do not want to parse your fasta file like you do:
if ($fasta_file =~ /^(\>.+)\s+/){$desc=$1;}
$fasta_file=~s/[\n\r]//g;
if ($fasta_file =~ /([A-Z]{10}.+)/){$seqo=$1;}

$seqo will contain the description as well, so your sequence starts
with the description.
BioPerl provides code for fasta file parsing too ;-) If you really
want to stick to your code you can catch the $desc and $seqo in one
RegExp, or replace this line:
if ($fasta_file =~ /^(\>.+)\s+/){$desc=$1;}
with
if ($fasta_file =~ s/^(\>.+)\s+//){$desc=$1;}


I hope you will get your script working now.

Regards,
Bernd

On 4/6/07, Jason Stajich <jason@...> 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]
> HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAASVSPSMTVASSQ
> QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIPLAGTAPGAEGPA
> PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGKAFRRKEHLRRHR
> DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVLRHQRIHGRAAAS
> 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@...
> 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@...
> 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.htmlhttp://fungalgenomes.org/
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@...
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

Re: blastall problem

by Jason Stajich-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks like you need to deal with buffering:


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]
HLSAQKASVGPESVSGLGTRTWPRVSCEVTVQCWPGCHLKVGGFKMAPWQGVGRRPWFLTWGPLCGAASV 
SPSMTVASSQ
QGWDCTAGRRWLGEGEIEALAQVSEFKTVLSFQGPAASPDGSSATRVPQDVTQGPGATGGKEDSGMIPLA 
GTAPGAEGPA
PGDSQAVRPYKQEPSSPPLAPGLPAFLAAPGTTSCPECGKTSLKPAHLLRHRQSHSGEKPHACPECGKAF 
RRKEHLRRHR
DTHPGSPGSPGPALRPLPAREKPHACCECGKTFYWREHLVRHRKTHSGARPFACWECGKGFGRREHVLRH 
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.

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



-- 
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

--
Jason Stajich
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441



_______________________________________________
Bioperl-l mailing list


-- 
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.


_______________________________________________
Bioperl-l mailing list

--
Jason Stajich 
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441
http://fungalgenomes.org/



_______________________________________________
Bioperl-l mailing list
Bioperl-l@...
http://lists.open-bio.org/mailman/listinfo/bioperl-l

smime.p7s (3K) Download Attachment

Re: blastall problem

by DeeGee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I added the line:
close(OUTPUT);
and now following error comes up, where 'out.blast' is supposed to be the blast result file, but it not being created.

Software error:
------------- EXCEPTION  -------------
MSG: Could not open /export/home/dorjee/result/out.blast: No such file or directory
STACK Bio::Root::IO::_initialize_io /usr/perl5/5.6.1/lib/Bio/Root/IO.pm:273
STACK Bio::Root::IO::new /usr/perl5/5.6.1/lib/Bio/Root/IO.pm:213
STACK Bio::SearchIO::new /usr/perl5/5.6.1/lib/Bio/SearchIO.pm:135
STACK Bio::SearchIO::new /usr/perl5/5.6.1/lib/Bio/SearchIO.pm:167
STACK toplevel /usr/local/apache2/htdocs/remote_ncbi.pl:53

--------------------------------------


Jason Stajich-3 wrote:
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@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@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@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@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@lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l