[Biococoa-dev] BCSequence
Koen van der Drift
kvddrift at earthlink.net
Sun Aug 22 14:23:05 EDT 2004
On Aug 22, 2004, at 2:01 PM, John Timmer wrote:
> I'm looking over BCSequence in order to start implementing
> BCSequenceDNA.
> There's a couple of places where I'm not entirely sure what your long
> term
> intentions are, so I thought I'd clarify things before digging in.
>
> I'm not entirely sure about the use of the following variables -
> SequenceCountedSet
> range
> startposition, endposition
>
> It looks like you use them to report back information generated by
> calling
> other methods, with a process that looks like:
> Call method, store information in these variables
> Call other methods to get information
> Reset information when 1st method is called again
>
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.
> Is that correct? My big worry about this approach is what might
> happen with
> a threaded app, where the first method might be called from a different
> thread before the information could be retrieved.
But isn't that true for every variable, such as the NSArray of Symbols
itself?
>
>
> The "sequenceString" variable appears to be separate from the sequence
> itself - what is it used for? I know Alex asked, but I can't seem to
> find
> the email.
>
It's a NSSting representation of the array of Symbols, using their
'symbolString' variable.
>
> If we're going to have a generic "initWithString" method, we're going
> to
> have to define some order of preference for what type of sequence to
> generate. Maybe try DNA, if that doesn't work for all letters, try
> RNA, if
> that doesn't work, try protein? If we keep a BCSequenceType variable,
> then
> something like:
> - (void)insertSymbolsFromString:(NSString *)s atIndex:(int)index;
> Can use that in order to decide what type of sequence to add.
Or, have a validation method in each initWithString method that checks
if it is really a DNA, protein, etc. So the user does something like:
mysequence = [[BCSequenceProtein] alloc] initWithString: @"ELVISLIVES"];
It will return nil, or an NSError if it is not a protein, eg when the
string @"KOENVANDERDRIFT" is passed.
>
>
> For a consistent naming convention:
> When setting/getting an array of symbols, use SymbolArray in the method
> name.
> When setting/getting a sequence object, use Sequence in the method
> name.
sounds good!
>
> It's probably worth creating both types of methods for all the methods
> like
> "partialSequence", since we don't know what's going to be most useufl
> for
> the users.
I'm not sure what you mean here.
- Koen.
More information about the Biococoa-dev
mailing list