[Biococoa-dev] BCSymbol Nomenclature

Koen van der Drift kvddrift at earthlink.net
Fri Aug 20 17:55:10 EDT 2004

On Aug 20, 2004, at 3:43 PM, John Timmer wrote:

>> I'm not in favour of this one, can you identify what exactly you do
>> differently? I would strongly ask you guys to agree on one of the two
>> implementations as both classes are descendents of BCSymbol it would 
>> be
>> not more than logical to keep implementations as similar as possible 
>> as
>> well. The aminoacids are encoded through a plist as well aren't they?

I agree with Alex, we should try to put as much as possible in 
BCSequence and BCSymbol, specialized stuff can go in the subclasses.

> Koen's dictionary is symbol based, and I could switch to that easily, 
> and he
> could add a chemical name to his.  I could change my 
> "initWithDictionary" to
> an "initWithName" and look things up in the dictionary as he does.

I suggest to rename initWithName to initWithSymbol. But we can have 
both an initWithDictionary, and initwithSymbol class. Put the same 
stuff in BCSymbol, and then the subclass can call [super 
initWithSymbol], etc and do any additional specialized stuff.

John, in what case would you call initWithDictionary? If I create a 
sequence from a string or other BCSequence I have to iterate through 
each symbol and then call initwithSymbol passing that symbol, so I am 
not sure in what situation one needs to call initWithDictionary.

> I see the point that having as many parallels as possible would make it
> easier for new people to come in and work on the code, but I'm just 
> not sure
> how easily that would work in this case.

See above, just override the same method in your subclass and add any 
specialized stuff.

Additionally I wrote this before I read this email, but it is on the 
same subject, so I just put it here:

We should be thinking about a better synchronization between the 
methods in BCSequence and BCSequenceDNA.The following methods in 
BCSequenceDNA have an equivalent in BCSequence:

-(NSArray*)sequenceBaseArray		<-> 		-(NSArray *)sequence
-(void)setSequenceBaseArray			<-> 		-(void)setSequence

-(void)removeBasesInRange			<-> 		-(void)removeSymbolsInRange
-(BCSequenceDNA *)sequenceInRange	<-> 		-(NSArray *)partialSequence
-(int)length						<-> 		-(unsigned int)numberOfSymbols

Most of the above can be removed from BCSequenceDNA and use the 
equivalent method in BCSequence. The nice thing about inheretance is 
that you can just ask for a sequence, no need to specify if it is a 
DNA, protein, etc. The method that calls it can then if needed do a 
validation to make sure that the right symbols are in the sequence.

Also, I suggest that the two init methods return (id) instead of 

If you agree, I will update the BCSymbol, BCAminoAcid and BCSequence 
class later tonight.

- Koen.

More information about the Biococoa-dev mailing list