in reply to Re: BioPerl StandAloneBlast is returning unexpected undefined SearchIO object
in thread BioPerl StandAloneBlast is returning unexpected undefined SearchIO object
I'm really confused why you are doing the translation yourself and not running BLASTX, but anyways the code for doing translation is described below?
The StandAloneBlast module is pretty fragile unfortunately - I really prefer to just code the cmdline parameters myself. But I think the problem from before is that it assumes you are passing in a Bio::Seq object (or Bio::PrimarySeqI interface object).
Here's a part of a script to generate your query sequences in FASTA format and then run your blast with a system call or better yet do the parsing on the fly... The translate function has a lot of capabilities as well like finding ORFs for you.
use Bio::SeqIO; use Bio::SearchIO; my $input = Bio::SeqIO->new(-format => 'fasta', -file => "inputseqs.fa +"); my $output = Bio::SeqIO->new(-format => 'fasta', -file => ">translated +.fa"); while(my $seq = $input->next_seq ){ my $id = $seq->id; # fwd strand for my $frame ( 0..3 ) { my $translated = $seq->translate($frame); $translated->id($id. "_F$frame"); $output->write_seq($translated); } # rev strand my $revcom = $seq->revcom; for my $frame ( 0..3 ) { my $translated = $revcom->translate($frame); $translated->id($id. "_R$frame"); $output->write_seq($translated); } $output->close(); } my $blastexe = "blastall -p blastp -d swissprot -e 1e-3 -i translated. +fa -m 9"; open(my $fh => "$blastexe |" ) || die $!; my $blastparser = Bio::SearchIO->new(-format => 'blasttable', -fh => $ +fh); # now do something with this as a SearchIO object # if you wanted the full alignment details, change blasttable to 'blas +t' and remove the '-m 9' in the exe string. # OR `$blastexe -o result.BLASTP.tab`;
|
|---|