[Bioperl-l] AlignIO and bl2seq

Ryan Golhar golharam at umdnj.edu
Thu Jun 2 15:39:06 EDT 2005


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



More information about the Bioperl-l mailing list