Bioperl: Alignment Thoughts
Thu, 28 Jan 1999 14:54:21 -0200
Ewan's proposal is really very thought provoking. After reading
through it, I thought of an API that might be a useful avenue to
The Alignment class (or whatever we want to call it) should appear to
be array-like to the application programmer. Conceptually, the
alignment uses the indexing system of the fully-gapped consensus
sequence, without necessarily generating a consensus. One nice way to
implement Alignment objects would be a tied array.
To create an Alignment, you pass it a series of Alignable objects,
which implement an Alignable "interface" (Multiple inheritance
anyone?) Wouldn't it be neat if Alignable implemented array tieing as
When you index into an Alignment object, what value do you get? You
get an AlignmentIndex object, which contains all the information
needed to recover the state of each Alignable within the Alignment.
When you index into an Alignable, you get an Alignment::Info object,
or some such.
$index = $alignment;
$info1 = $sequence1[$index];
$info2 = $sequence2[$index];
$start = $info1->start;
$end = $info1->end;
$type = $info1->type;
All the smarts is now moved into the AlignmentIndex object, which can
be treated as an opaque object that the programmer just passes around.
One of the nice things about the Alignment tie interface is that it
should be possible to implement push(), pop(), splice() and so forth
by passing AlignmentIndex objects to those operators, allowing the
alignment to be edited in an (almost) natural way.
Lincoln D. Stein Cold Spring Harbor Laboratory
firstname.lastname@example.org Cold Spring Harbor, NY
Positions available at my lab: see http://stein.cshl.org/#hire
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc: