[Biococoa-dev] mass calculator bug

Alexander Griekspoor mek at mekentosj.com
Sun Aug 29 16:50:52 EDT 2004

>>> Is it possible to move all the rangeOfSubsequence variants that are 
>>> now
>>> in BCSequeneDNA to BCSequence? I think the same code can be useful 
>>> for
>>> proteins as well.
>> Please do!

can I add that reverse is a method that could apply to general sequence 
as well?

> 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. ...

In general these methods do the same thing, except that DNA sequence 
can be ambiguous, thus need additional stuff. Wouldn't it an idea to 
implement the general way in the BCSequence class, but override the 
method in BCSequenceDNA to do it the "DNA" way. This way you don't have 
to check if a symbol is of type BCNucleotide on every aminoacid, and 
also not on every nucleotide as the method implementation is 
automatically different for both types.


                         ** Alexander Griekspoor **
                  The Netherlands Cancer Institute
                  Department of Tumorbiology (H4)
             Plesmanlaan 121, 1066 CX, Amsterdam
                        Tel:  + 31 20 - 512 2023
                        Fax:  + 31 20 - 512 2029
                       AIM: mekentosj at mac.com
                       E-mail: a.griekspoor at nki.nl
                    Web: http://www.mekentosj.com

MacOS X: The power of UNIX with the simplicity of the Mac


More information about the Biococoa-dev mailing list