[Bioperl-l] AlignIO and bl2seq
Ryan Golhar
golharam at umdnj.edu
Mon Jun 6 16:15:42 EDT 2005
I went for AlignIO because I came across it first and it looked like the
most simply way of doing it.
I think what you just wrote in your message should either be in the docs
or tutorial as a recommendation indicating we should use SearchIO
instead.
Ryan
-----Original Message-----
From: Jason Stajich [mailto:jason.stajich at duke.edu]
Sent: Monday, June 06, 2005 3:58 PM
To: golharam at umdnj.edu
Cc: 'Bioperl List'
Subject: Re: [Bioperl-l] AlignIO and bl2seq
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.
HTH,
-jason
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
http://www.duke.edu/~jes12/
More information about the Bioperl-l
mailing list