You have to tell StandAloneBlast it will be returning blasttable format, the default is 'blast' format and the parser doesn't try to guess.

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

In reply to Re^2: BioPerl StandAloneBlast is returning unexpected undefined SearchIO object by stajich
in thread BioPerl StandAloneBlast is returning unexpected undefined SearchIO object by WonkoTheSane

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.