[Bioperl-l] bl2seq and next_aln()

Jason Stajich jason.stajich at duke.edu
Wed Aug 3 13:43:33 EDT 2005


Not sure - could be bug in AlignIO::bl2seq -- although it just uses SearchIO...
But could also be silly file sync problem in that filehandle is not closed
(although this is also unlikely as the output it written to file by bl2seq).  So
not sure - does it only show the 1st alnment?

Personally I would use the report object to get the aln directly.

if( my $r = $report->next_result ) {
 while( my $hit = $r->next_hit ) {
  while( my $hsp = $hit->next_hsp ) {
    print $hsp->get_aln->consensus_iupac()."\n";
  }
 }
}
-- 
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/


Quoting Gregory Drake Wilson <gdw1 at cornell.edu>:

> I am trying to parse a bl2seq file but am only being returned one of the
> alignments when there are 2+.
> Code:
>         my @params = (program  => 'blastn' , 'outfile' => 'bl2seq.out');
>         my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
>         my $report = $factory->bl2seq($seq1, $seq2);
> 
>         my $str = Bio::AlignIO->new(-file=> 'bl2seq.out','-format' =>
> 'bl2seq');
> 
>         while ( my $aln = $str->next_aln() ) {
>            print $aln->consensus_iupac()."\n";
>         }
> 
> Opening 'bl2seq.out' shows mutiple alignments, yet this code only returns
> the first one in the file. Any thoughts?
> 
> Greg
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list