[Bioperl-l] BLAST objects OR Generic objects
Jason Stajich
jason@cgt.mc.duke.edu
Mon, 15 Jul 2002 15:37:58 -0400 (EDT)
On Mon, 15 Jul 2002, Ken wrote:
> Hello again,
> Jason, You were right about confusing people.....
These are all part of the API documentation available from doc.bioperl.org
or from perldoc Bio::Search::HSP::HSPI
> What do I use to get the start and the end of a BLAST hit?
In what coordinates? The documentation for Bio::Search::HSP::HSPI
*should* cover this. If not we'll get on that.
$hsp->query->start, $hsp->query->end are coordinates for the HSP
alignment to the query.
The corresponding $hsp->hit->start, $hsp->hit->end
are the HSP alignment coordinates to the subject sequence.
This is part of the Bio::SeqFeature::SimilarityPair definition as
HSPI is-A SimilarityPair.
> Should I iterate over all the HSPs and find the min and max? Also, you
Or you can just do a sort on start and pull the beginning and ending hsp
from the list; start should always be before end, and you infer strand
from the strand() method for either the query or hsp. I think Steve wrote
a tile_hsp method and it is in Bio::Search::BlastUtils which might also do
what you want but I'm not 100% sure that he wrote it without using any
methods that are specific to BlastHSP objects. Would have to check.
> mentioned that BlastHSP is going away. Should I be changing my code
> now, or at least start using another object?
Your code shouldn't care what kind of object as long as you only call
methods that are in the Bio::Search::HSP::HSPI interface.
If you use the blast.pm parser via
Bio::SearchIO(-format => 'blast', -file => 'blastfile.bls');
you'll get back GenericXXX objects anyways. If you use Steve's psiblast
module then you'll get BlastXXX objects.
The key is if you use methods that aren't in the interface defined by
Bio::Search::HSP::HSPI there is no guarantee that other modules which
implement the interface will have these methods which breaks the whole
transparency of the design. Those implementation specific methods should
be used only when you are clear that you only want to process results
returned by a specific type of parser or for a specific type of data (like
my new HMMerHSP and WABAHPSs).
-jason
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu