[Biococoa-dev] BCSymbolSet

Charles PARNOT charles.parnot at stanford.edu
Thu Mar 10 15:44:45 EST 2005

At 14:43 -0500 3/10/05, John Timmer wrote:
> >>> i'd like to make the suggestion to make BCSymbolSet a subclass of
>>>> NSMutableSet, to get all set features for free. I for example need the
>>>> allObjects: method for my BCScoringMatrix class.
>>> I think we were going to make BCSymbolSet already.  I think the root
>>> class
>>> was going to be non-mutable and hold standard sets, like all
>>> nucleotides,
>>> etc.
>> Yes i noticed that, but it derives from NSObject, would be cleaner if
>> it derives from NS(Mutable)Set. (just my opinion)
>Ah, but NSMutableSet's a class cluster, so you can't really subclass it very

Sorry I did not step in the discussion earlier and I am quite busy, so just a quick note on that.

I think John's argument is good. We don't understand enough of Apple's class guts. Wrapping the NSSet inside a BCSymbolSet object adds a little bit of overhead, but in 99% of the cases, it should not matter. And when it does matter, one can always get the underlying NSSet to work with.

I already made the modifications to BCSymbolSet to make it immutable (much safer if we are going to use it in BCSequence, where it is not going to be modified). We may have a mutable subclass, but this may not be necessary with a few clever factory methods. Philip, tell me if you really need a mutable symbol set. We should probably add a mutable one only if really needed.

I also added a method called 'allSymbols' to get an array with the symbols.

I did not commit any of that yet, because I have to modify the code for the prebuilt symbol sets to fit with the new implementation. But you can assume 'allSymbols' exists and returns an NSArray. Add more methods in the BCSymbolSet header if you need more! Please do not put code in the implementation file if possible, as I am not sure how I would then merge the modifs with my current non-commited modifs.

I will also try to add my 2 cents about the alignment implementation when I have some time tonight or tomorrow :-)


Help science go fast forward:

Charles Parnot
charles.parnot at stanford.edu

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