[Bioperl-l] AlignIO warning

Jason Stajich jason at cgt.duhs.duke.edu
Wed Feb 18 09:33:46 EST 2004


Short answer, add -report_type => 'reporttype' - I recognize documentation
was lacking there - I am fixing that.  Now that SearchIO can parse bl2seq
reports, the AlignIO parser is just a shortcut convience for folks, if you
look at the code you'll  see this is the case.

my $str = Bio::AlignIO->new(-file => 'bl2seq.out', -format => 'bl2seq', -report_type => 'blastn');



However you don't have to create the output file and re-feed it to AlignIO.
If you have passed in
'_READMETHOD' => 'BLAST' (which is the default for 1.4 StandAloneBlast)
for initializing the factory object, then you get back a SearchIO object
for bl2seq and blast alignments runs:

my $searchio = $factory->bl2seq($seq1,$seq2);
my $r = $searchio->next_result;
my $hit = $r->next_hit;
for my $hsp ( $hit->hsps ) {
 my $aln = $hsp->get_aln;  # Bio::SimpleAlign object
}

In the TMTOWTDI - you can also get a Bio::Tools::BPbl2seq parser if you
pass in 'BPlite' to _READMETHOD in StandAloneBlast and get back an object
with slightly different API. This is the old way of parsing these reports
now superceeded by SearchIO.

-jason
On Wed, 18 Feb 2004, Alexandre Irrthum wrote:

> Hi there,
>
> The snippet of code shown below works fine (with bioperl 1.4), but it
> issues this warning when next_aln() is called:
>
>
> -------------------- WARNING ---------------------
> MSG: Must provide which type of BLAST was run (blastp,blastn, tblastn,
> tblastx, blastx) if you want strand information to get set properly for
> DNA query or subjects
>
>
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
> use Bio::Seq;
> use Bio::Tools::Run::StandAloneBlast;
> use Bio::AlignIO;
>
> my $seq1 = Bio::Seq->new(-display_id => 'Sequence1', -seq =>
> 'AGGATAGGGCGGATAGGTAGCGCCGATTTACGCGATACGCG');
> my $seq2 = Bio::Seq->new(-display_id => 'Sequence2', -seq =>
> 'AGGATAGGGCAGATAGGTAGCGCCGATTTACGTGATACGCG');
> my $factory = Bio::Tools::Run::StandAloneBlast->new(program => 'blastn',
> outfile => 'bl2seq.out');
> $factory->bl2seq($seq1, $seq2);
> my $str = Bio::AlignIO->new(-file => 'bl2seq.out', -format => 'bl2seq');
> my $aln = $str->next_aln(); ###### Warning issued here ######
> foreach my $seq ($aln->each_seq()) {
>     print $seq->seq(), "\n";
> }
>
> How am I supposed to provide program name ?
>
> Thank you for your help.
>
> Alex
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list