[Biococoa-dev] BCSequence

John Timmer jtimmer at bellatlantic.net
Mon Aug 23 12:10:45 EDT 2004

>>>>> 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.
>> Indeed, this is exactly what we don't want to do!! Therefore, this should NOT
>> be a variable, rather a METHOD. Please change it to something like:
>> -(NSString *)stringRepresentation;

Okay, so given all this, how about the following:
We delete the "sequenceString" variable from BCSequence
We implement " -(NSString *)stringRepresentation" to generate the string on
the fly using "symbolString" on each Symbol (already done and waiting on
approval to commit).
Since the "initWithString" is not meant to be used in the base class anyway,
and there's no variable to stick a string into anymore, we can have it
return nil.  Subclasses should override it, as they should have.

As far as thread safety, I agree it is probably too early to start locking
various methods down, but I think we should try as best we can to design our
classes so that if/when it's time to do so, things are as simple as adding a
few locks in critical places, rather than discovering that we need to
redesign the class then.

Thanks to Google, I now know the difference between these
    float   monoisotopicMass;
    float   averageMass;
And I'll see if I can't look up some values for the nucleotides.
Koen, since this is your field:  for the average mass of the ambiguous
nucleotides, I was just averaging all possible nucleotides (ie, for Y, I
took the average of the values for C and T).  Since monoisotopic mass is
supposed to not be an average, should I return 0 for those cases?



This mind intentionally left blank

More information about the Biococoa-dev mailing list