[Biojava-l] Should Alignment extend Sequence?

Bradford Powell bcpowell at email.unc.edu
Thu Jun 5 18:16:36 EDT 2003


There was a good bit of discussion on this list in the middle of last
month about making changes to the SequencePanel and 
TranslatedSequencePanel classes to allow them to be given SymbolLists
instead of Sequences, particularly for the purpose of being able to
display Alignments. I couldn't tell if this issue was resolved or not.

Anyway, I spent a portion of this afternoon hacking together some
Biojava-in-Anger-style code[1] for displaying a multiple sequence alignment,
following using Kalle Naeslund's message[2] from May 8 as a guide. Rather
than change TranslatedSequencePanel to accept SymbolLists, I decided to go
with the second suggestion-- wrapping the Alignment in a Sequence. Using
SimpleSequence to do this wouldn't work because AlignmentRenderer expects
TranlatedSequencePanel.getSymbols to return a SymbolList that is
specifically an Alignment.

So I scavenged much code from SimpleSequence to create a class
SimpleSequenceAlignment which implements both Sequence and Alignment. It is
basically a SimpleSequence that delegates to an Alignment instead of a
SymbolList. This is incredibly redundant.

At first I wasn't happy with the thought of wrapping an Alignment in a
Sequence-- after all, semantically an Alignment isn't really a Sequence, at
least not in the way we usually think of things. Then again, the
interpretation of an alignment as a sequence of characters in a cross-product
alphabet is not necessarily the way one would think of an alignment initially.

I looked at what extending Sequence would mean for Alignment:
	1. Addition of Name and URN attributes
	2. The ability to hold Features and Annotations
I think that both of these are sensible things for an Alignment to do. An
alignment is not just a collection of sequences and it would be useful for
alignments to have identifiers of their own (particularly if one were to
look at different alignments of the same sets of sequences). Also,
alignments may have "features" that the individual sequences do not have.


So, resulting questions are:

Are there established reasons for _not_ having Alignments extend Sequence?
(am I stepping into an old argument...?)

If not, what would people think about making a change so that Alignments
extend Sequence?

If Alignments should extend that interface that is currently called
"Sequence", should the name be changed to be semantically less confusing or
should we just accept a broader interpretation of what the word "sequence"
means?

-- Bradford Powell
-- bradford_powell at unc.edu

[1] http://diploid.med.unc.edu/~bradford/AlignmentViewer/
[2] http://biojava.org/pipermail/biojava-l/2003-May/003801.html



More information about the Biojava-l mailing list