[Biococoa-dev] mass calculator bug

Alexander Griekspoor mek at mekentosj.com
Sun Aug 29 16:30:53 EDT 2004

>> Since we can't control what's in the array the user is handing us 
>> when it's
>> a raw array (as opposed to when we're handed a sequence) we need to 
>> make
>> sure that its contents will work with all the methods we're using on 
>> the
>> contents - hence the test for BCSymbols.
> If we keep the method private, we don't have to worry about that, I 
> guess. We could implement a validateInput method that checks (using an 
> NSScanner) if any character in the string are not allowed. Or we could 
> use an BCAlphabet class that manages the symbols.  But in the meantime 
> I'll leave it alone.

I think the initWithSequence method should be a public one, like 
NSString's initWithString.  See my mail "safety vs speed" why I think 
we don't have to worry for a different reason. But the validateSequence 
method you propose would be a very welcome addition which would help 
the developer to make sure he feeds us a proper sequence object. We 
leave him the choice then if he wants to trade some speed for safety.

>>> Is it possible to move all the rangeOfSubsequence variants that are 
>>> now
>>> in BCSequeneDNA to BCSequence? I think the same code can be useful 
>>> for
>>> proteins as well.
>> Please do!  And please fix my experimentation with the adenosine @"A" 
>> -> 'A'
>> conversion.  And rename anything you feel is necessary, as long as 
>> you're
>> careful with the find and replace!
> Ok, I will start working on that. I'll also replace 'sequence' with 
> 'sequenceArray'.

Very nice!

> Incidentally, have you done a "step into" in the debugger to see where
>> things actually error out? And what's the error message?
> If I step into the offending line I go straight to the assembly code, 
> which is not very helpful (to me atlast :)

As BCSymbol supports -description now, can you check that the 
enumerator at least returns symbols by putting in a NSLog(@"%@", 
aSymbol); ?


                     ** Alexander Griekspoor **
               The Netherlands Cancer Institute
               Department of Tumorbiology (H4)
          Plesmanlaan 121, 1066 CX, Amsterdam
                    Tel:  + 31 20 - 512 2023
                   Fax:  + 31 20 - 512 2029
                   AIM: mekentosj at mac.com
                  E-mail: a.griekspoor at nki.nl
               Web: http://www.mekentosj.com

               4Peaks - For Peaks, Four Peaks.
        2004 Winner of the Apple Design Awards
                Best Mac OS X Student Product


More information about the Biococoa-dev mailing list