[Biococoa-dev] BCSequence
Koen van der Drift
kvddrift at earthlink.net
Sun Aug 22 22:10:28 EDT 2004
On Aug 22, 2004, at 5:07 PM, John Timmer wrote:
>> I used them internally in my own app to indicate where a subsequence
>> begins and ends in a complete sequence, eg if the user selects a part
>> in a view. So whenever a sequence is created/edited these variables
>> are
>> set. A view can use it through a controller to eg show these numbers.
> Okay, so I can more or less ignore them in the DNA subclass, at least
> for
> now, correct?
>
Sure, but they work for every sequence, DNA, protein, etc
>>>
>> It's a NSSting representation of the array of Symbols, using their
>> 'symbolString' variable.
>
> Okay, so I'll just make sure to update it whenever a method changes the
> sequence.
Isn't that what we tried to avoid by using a string to contain a
sequence? I think it's better just to recreate an NSString, when
someone asks for it, instead of updating it with every edit.
> I was thinking more along the lines of when a user calls:
> aSequence = [[BCSequence alloc ] initWithString: @"ELVISLIVES"];
> We should probably return some sort of useful subclass, but the
> question is
> which one?
The generic initWithString can be regarded as 'abstract'. Just use
[BCSequenceDNA alloc ] initWithString] or [BCSequenceProtein alloc ]
initWithString], etc. We can use a Factory class (BCSequenceFactory)
that figures out what kind of sequence we are dealing with, the
BCSequence should be unaware of its subclasses.
>> I'm not sure what you mean here.
>>
>
> One example - provide both:
> - (NSArray *) symbolArrayFromRange: (NSRange) entry;
> And
> - (BCSequence *)sequenceFromRange: (NSRange) entry;
>
>
Ah ok, sounds good to me. But for the second one you need to create a
BCSequence, so you might want to call it using init or copy in its
name.
- Koen.
More information about the Biococoa-dev
mailing list