[Bioperl-l] AlignIO and bl2seq

Jason Stajich jason.stajich at duke.edu
Mon Jun 6 15:58:22 EDT 2005

> I know I should be using SearchIO to get the HSPs

Not to be trite, so why don't you? The AlignIO bl2seq parsing is just  
a hack to delegate to the SearchIO objects for the parsing.  I only  
updated it to use SearchIO when we stopped supporting BPbl2seq  
parsing.  Look at the code and you'll see what it is  doing I hope.   
I would be more in favor of removing AlignIO::bl2seq anyways but I am  
a big believer in keeping the API as stable as possible - at least  
not removing functionality without good reason.

To answer you question - probably because when the aln object is made  
from the HSP object we don't initialize the score field.  The  
question would be which score would you want - bit score or some  
people might expect e-value (even if it isn't a score).  The Search  
objects are just going to be richer wrt the pairwise aln data so I  
would start with SearchIO - you can always get Bio::SimpleAlign  
objects back out with the $hsp->get_aln method.

On Jun 2, 2005, at 3:39 PM, Ryan Golhar wrote:

> Hi all,
> I'm trying to parse some alignments performed using bl2seq.  My  
> code is
> as follows:
> my $output = `bl2seq -p blastn -i seq1 -j seq2`;
> my $in = Bio::AlignIO->new(-fh => new IO::String($output), -format =>
> 'bl2seq');
> my $aln = $in->next_aln();
> if (defined($aln)) {
>   print "Score: ", $aln->score, "\n";
> } else {
>   print "n/a";
> }
> When it comes to printing the score, nothing gets printed out, which
> makes sense because blast gives a list of HSPs or none if there aren't
> any.  So, how do I get the first HSP from the output using AlignIO?
> I know I should be using SearchIO to get the HSPs, but I thought I  
> would
> try it with AlignIO as its documented, but I can't get it working.   
> Any
> ideas???
> Ryan
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
jason.stajich at duke.edu

More information about the Bioperl-l mailing list