[Bioperl-l] need subject length

Hilmar Lapp hilmarl@yahoo.com
Sun, 08 Apr 2001 03:26:19 -0700


Ann Loraine wrote:
> 
> The old Blast object lets me get this info like so:
> 
>         my $slen = $hsp->subject->length()
> 
> The equivalent call using BPLite only returns the length of the
> aligned portion of the subject.  What method should I call instead
> to get this information using BPlite?
> 

Unlike Blast.pm, BPlite is pretty well integrated with the rest of
BioPerl. $hsp is actually a Bio::SeqFeature::SimilarityPair, with
$hsp->subject() and $hsp->query() returning
Bio::SeqFeature::Similarity objects. These all implement
SeqFeatureI, which means length() will return the length of the
feature (which is the length of the aligned portion).

To obtain the length of the subject or query sequence, call
seqlength() on the respective object, i.e., you want
$hsp->subject->seqlength().

	Hilmar
-- 
-----------------------------------------------------------------
Hilmar Lapp                              email: hilmarl@yahoo.com
GNF, San Diego, Ca. 92122                phone: +1 858 812 1757
-----------------------------------------------------------------