symbol class and sequence class (was: [Biococoa-dev] Annotation)

Charles PARNOT charles.parnot at
Mon Feb 21 13:10:40 EST 2005

>>Also, Koen, I have one question about the symbolSet: it seems that all instances of one sequence type use the same symbol set. Is that right?
>No, each sequence should have it's own symbolset, just like each sequence has its own symbolArray.

Oups, I got confused. I actually meant: do you foresee that each sequence class will most of the time use a constant BCSymbol subclass? I am not sure what the BCSymbolSet will be used for.

I am asking this because I am still annoyed by the fact that the BCAbstractSequence class does not have a designated initializer. This is an issue that showed up no later than yesterday, when Koen added the annotations code. You set the annotations to nil in 'initWithString...' but not in 'initWithSymbolArray'... and you should not have had to if the latter was calling the first, in other words if it was calling the 'designated initializer'. The problem is those two initializations are encoded separately and in parallel, and are also encoded in all the subclasses, where the code is repeated exactly the same except for the BCSymbol subclass used.

I suggest we do the following:
* each subclass implements "+ (Class)defaultSymbolClass" to return the BCSymbol subclass to use;
* the initializer 'initWithString:skippingUnknownSymbols' and 'initWithSymbolArray' are fully implemented in the superclass and use 'defaultSymbolClass' to do the job; no more code needed in the subclass (except codon and BCSequence)
* the designated initializer is 'initWithSymbolArray', which is called by 'initWithString:skippingUnknownSymbols' after creating a symbol array

The BCSequence has to be treated separately (actually the code remains the same as now).

The BCSequenceCodon will also have to be treated separately at this point because it does not use an array of symbols, but of codons. Ultimately, maybe a codon could be made a symbol subclass?

Koen, let me know if that interferes with the symbolSet, because I suspect this issue may be related.

Help science go fast forward:

Charles Parnot
charles.parnot at

Room  B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)

Tel +1 650 725 7754
Fax +1 650 725 8021

More information about the Biococoa-dev mailing list