[Biococoa-dev] More on BCSymbolSets
Koen van der Drift
kvddrift at earthlink.net
Sun Feb 27 22:41:22 EST 2005
On Feb 27, 2005, at 10:26 PM, John Timmer wrote:
> I think the idea of using a symbol set to limit the possible options
> for
> initializing a sequence is a good one, provided we make the process
> very
> streamlined. The class itself looks to be good in that regard.
Not only in the init methods. They can be used all throughout the
framework.
>
> I've got a couple of ideas on the implementation. One idea that
> suggests
> itself is to have a BCSequencType variable for the symbol set - that
> way the
> sequence being initialized could pick up its sequence type from the
> set it
> gets passed during initialization.
Then we might have to extend the different BCSequenceTypes to include
strict, ambiguous, etc.
>
> The other thing I'd do is take the methods like "baseForSymbol" and
> "aaForSymbol" and formalize them to be a single selector, like
> "symbolForCharacter". That way, you could call the same selector on
> any
> class. This would allow you to make code that looked something like
> this
> (given passedString and passedSet as the arguments):
> TheClass = [passedSet anyObject];
> TheChar = [passedString characterAtIndex: loopCounter];
> TheSymbol = [theClass symbolForCharacter: theChar];
> If ( [passedSet containsObject: theSymbol] )
> // add it to our sequence
This is indeed similar to what I have in mind, yes.
> If we're making symbol sets this central to sequence creation, though,
> I'd
> make a lot of combinations, rather than the two we have for each type.
> We
> don't want any of the commonly used sets more than a single call away.
Sets can always be combined, using formUnionWithSymbolSet and
formIntersectionWithSymbolSet.
> Basically, I'd do strict, ambiguous, those with gap, those with
> undefined,
> those with both, etc. We may also want to make the standard ones
> singletons.
Sounds good.
- Koen.
More information about the Biococoa-dev
mailing list