[Bioperl-l] Bio::LocatableSeq::location_from_column

Heikki Lehvaslaiho heikki@ebi.ac.uk
Mon, 06 Aug 2001 11:31:54 +0100


As promised, I wrote a complement of
Bio::SimpleAlign::columns_from_residue_number(). After some pondering
I realized that it is not a property of  the alignment but of a
sequence in the alignment. Also, gaps in the alignment complicate the
definition location from an integer into full blown Bio::LocationI
object.

Bio::LocatableSeq::location_from_column can return:

1. undef
   if location is before first sequence residue
2. a Bio::Location::Simple object
   if you are lucky (e.g $loc->to_FTstring eq '2' )
3. a Bio::Location::Fuzzy object
   hitting a gap (e.g $loc->to_FTstring eq '2^3' )


It turned out not to be possible to make this method foolproof:
If the column is after the last residue of the locatable sequence
(within trailing gap characters), there is no way of knowing weather
the next character exists in the original sequence. 

Suggestions welcome,

			-Heikki

-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________