Biotech > FAQ > BioPerl FAQ (Frequently Asked Questions)

How do I get the frame for a translated search?

To see other biotech frequently asked questions, please visit http://biotech.fyicenter.com/faq/

(Continued from previous question...)

How do I get the frame for a translated search?

I'm using Bio::Search* and its frame() to parse BLAST but I'm seeing 0, 1, or 2 instead of the expected -3, -2, -1, +1, +2, +3. Why am I seeing these different numbers and how do I get the frame according to BLAST?

These are GFF frames - so +1 is 0 in GFF, -3 will be encoded with a frame of 2 with the strand being set to -1.

Frames are relative to the hit or query sequence so you need to query it based on sequence you are interested in:

$hsp->hit->strand;
$hsp->hit->frame;

or

$hsp->query->strand;
$hsp->query->frame;

So the value according to a blast report of -3 can be constructed as:

my $blastframe = ($hsp->query->frame + 1) * $hsp->query->strand;

(Continued on next question...)

Other Frequently Asked Questions