[Biococoa-dev] more on BCCodon

John Timmer jtimmer at bellatlantic.net
Mon Sep 6 18:13:04 EDT 2004

>>  Given that, it
>> seemed more useful to have a BCSequenceCodon, so I specifically avoided
>> using it as a superclass.  While I'm on my flights later this week, I'm
>> going to try to figure out a way to squeeze them in as a subclass of
>> BCSymbol, but I'm not optimistic.
> What's the advantage of subclassing BCSymbol compared to BCSequence?
> Again, it's a sequence, so subclassing BCSequence seems more logical to
> me.

Well, in addition to class inheritance, we have to think about what these
things are supposed to represent biologically.  A sequence is an ordered
list of objects.  A symbol is a single instance of one of these objects.

Given those definitions, a codon isn't actually a sequence.  A codon is a
single instance of something that typically occurs as an ordered list,
meaning an mRNA transcript can be thought of as an ordered list of codons.
By most standards, a codon should be a symbol.  The only reason to view it
as a sequence is that it contains a short sequence as one of its properties.

Putting it another way, all the properties of a BCSequence subclass are (or
at least should be) derived from the sequence itself.  The properties of a
codon aren't - they depend on external information, namely what (if any)
amino acid it codes for in a given genetic code.

Given all that, Symbol seems a better fit, but it's also awkward - there's
both nucleotide and amino acid information, and unlike all the other
symbols, its meaning can vary (again, based on the genetic code).  The only
reason I see to try to wrench it into being a symbol is that I can see
advantages to allowing our BCSequence class to assume its contents are
always symbols.  I haven't looked over the class in detail in order to
determine if it does anything that requires that yet.

I hope that's clear - it is to me, but it's also obvious that codons are
something I worry about on  a much more regular basis in my real life as a
scientist as opposed to when I'm pretending to be a programmer.


This mind intentionally left blank

More information about the Biococoa-dev mailing list