[Biococoa-dev] More on BCSymbolSets

Charles PARNOT charles.parnot at stanford.edu
Thu Mar 3 21:58:14 EST 2005

At 8:12 PM -0500 3/3/05, Koen van der Drift wrote:
>On Mar 3, 2005, at 1:25 AM, Charles PARNOT wrote:
>>There are probably more basic questions that I am missing. After answering the design questions, we can move to the details of the implementations.
>I already made some changes, the symbolsets are now singletons, as discussed earlier.

I hate to be picky with words, but I had a hard time following this idea because a 'singleton' class is a class with only one instance... so I was confused. What you guys mean is to provide a bunch of pre-built immutable symbolSets accessible through factory methods.
I think this is excellent design, and the user will rarely need anything outside of these instances.

I suggested in a previous emails that we made all instances immutables (basically sticking to NSSet), for simplicity. In particular, one should not be able to change the symbolSet of a sequence, that would be disastrous. A mutable symbol set would have these problems.
What do you think?

>Other things that come to mind:
>* when using a symbolset in the initializer, which method should be the designated initializer?
>My preference would be to make the initWithString:usingSymbolSet: the designated initializer. This is probably the most common case. When using an array of symbols, the symbolset is already known from the original sequence, so that one can be used. If no symbolset is used, the code in sequencetypefromstring can be used to determine what the symbolset should be.

Yes, that is exactly what I think! Did you look at my code? ;-)

If no symbolset is passed as argument in the initializer, I propose instead to use a default symbol set provided as a method and overriden in each subclass:
- (BCSymbolSet *)defaultSymbolSet;
This default symbol set can then be accessed in the implementation of the initializer in the superclass. This default set would be the most general. I think if the user starts a sequence with @"ATGTG" and later add  @"BYTGTG", the symbols "BY" should be recognized (in what you propose, this would not be recognized). That should really be standard. In the absence of choice, we should leave the symbol set as open as possible, or the user will have different behavior depending on how the sequence was initialized.

>* do we still need the 'skippingunknownsymbols' flag?
>I would say no. I cannot think of a situation when that flag will be NO.  And also using a symbolset will filter these out.
I vote no too. Symbol sets will take care of that, yes!!

NB: I will try to post an updated version of the code I posted previously on the list. Tell me

I can't wait to read your responses to my responses to your responses!


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