[Biococoa-dev] mass calculator bug

Koen van der Drift kvddrift at earthlink.net
Sun Aug 29 21:15:16 EDT 2004

On Aug 29, 2004, at 6:46 PM, John Timmer wrote:

>> Already running into one problem here. These methods call
>> "isRepresentedByBase" a couple of times. But that is only defined in
>> BCNucleotideSymbol, not in BCSymbol.
>> I can think of a few solutions:
>> 1. Change the name to isRepresentedBySymbol, and put an empty method 
>> in
>> BCSymbol. I don;t think that the one in BCNucleotideSymbol gets called
>> then, because I am treating all symbols as BCSymbol
>> 2. Add an extra line that tests if the symbol is a BCNucleotideSymbol,
>> and then excecute the line containing isRepresentedBySymbol.
>> 3. ...
> I think Alex's 3 was to have the general method in the BCSequence 
> class, and
> leave them overridden in BCSequenceDNA, which makes the most sense to 
> me.

I need some help from you DNA dudes here.

Looking at the methods, they are all very similar, until the lines:

         if ( [selfSymbol isRepresentedByBase: entrySymbol]  || 
[entrySymbol isRepresentedByBase: selfSymbol] ) {

or variants thereof.  After that I really don't follow the flow of the 
code, too many counters and symbols ;-)

Here's my question:  isRepresentedByBase a specific test that is only 
needed for bases, or should amino acids be tested the same way using a 
similar method? What I am trying to get at is to see if it is possible 
to have a separate method to test the entrySymbol and selfSymbol that 
goes in BCNucleotideDNA and BCAminoAcid  (or BCSequenceDNA and 
BCSequenceProtein). Then we can keep all the rangeOfSubsequence in 

BTW, just saw that there is also a method subSequenceInRange which 
doesn't do all the checking - I guess I wrote that one ;D

- Koen.

More information about the Biococoa-dev mailing list