[Bioperl-l] SearchIO.pm: recalculate position between hit and qry

Jan Aerts jan.aerts at wur.nl
Mon Jun 7 08:54:54 EDT 2004

Hi all,

Every once in a while I BLAST a sequence against dbSNP to annotate SNPs
on it. To find the exact position of the SNP on the query, I find myself
writing code to check if the SNP position (which is known on the 'hit'
sequence) is within the alignment and recalculating the position on the
query, taking into account
*start and end positions of both query and hit
*strand of hit
*any gaps on query or hit.

I was not able to find code in SearchIO.pm to do this for me. Would it
be a good idea to include it?

Possible use:
  print $hsp->qry_pos('501');
where 501 is the position on the hit (e.g. the position of a SNP within
its flanking sequence). And the other way around:
  print $hsp->hit_pos('2965');
where 2965 is the position on the query.

Any suggestions?

More information about the Bioperl-l mailing list