<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">You think?! Just kidding ;-)<DIV><BR class="khtml-block-placeholder"></DIV><DIV>About the implementation, even if we use single byte const chars, I still like the idea a lot of Charles to use NSMutableData as the internal datastore and provide an accessor to it. The NSData -bytes method casted to const char will give you direct access to the c array. Indeed the ivars can best be held read only as all editing should occur through class methods that also do the syncing of features/annotations. I would have absolutely no problem (certainly for performance reasons) to just have the accessor be - (NSData *)sequenceData; while internally it really is an NSMutableData. John uses to be very picky about this one, but it is fair I think that the user should respect that things only work for what we tell that we hand him, not what he really gets. I know that also Apple does this, their methods sometimes tell you you will get an NSArray, while in fact it is a NSMutableArray. But don't blame them if you start editing the array and things behave weird. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Again the main reason for going for NSMutableData instead of directly using a char array is that we don't have to do the memory allocation/management. For instance from the NSMutableData  documents:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><P style="margin: 0.0px 0.0px 12.0px 0.0px"><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">- (void)replaceBytesInRange:(</SPAN></FONT><A href="file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Reference/Foundation/ObjC_classic/TypesAndConstants/FoundationTypes.html#//apple_ref/doc/c_ref/NSRange"><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;"><FONT class="Apple-style-span" color="#0024F8">NSRange</FONT></SPAN></FONT></A><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">)range withBytes:(const void *)replacementBytes length:(unsigned)replacementLength</SPAN></FONT></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Lucida Grande">Replaces the </FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">range</SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande"> within the contents of the receiver with </FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">replacementBytes</SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande">. If the length of </FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">range</SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande"> is not equal to </FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">replacementLength</SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande">, the receiver is resized to accommodate the new bytes. Any bytes past </FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">range</SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande"> in the receiver are shifted to accommodate the new bytes.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Lucida Grande"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This is just fantastic instead of having to do all malloc and pointer shifting etc ourselves!</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Cheers,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Alex</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Ps. Any clues on the spam stuff, I think none of my 5 messages have yet been posted to the list while you Koen for instance got the direct one immediately so it seems. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> <BR><DIV><DIV>On 9-jul-2005, at 21:16, Koen van der Drift wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Jul 9, 2005, at 2:36 PM, Alexander Griekspoor wrote:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm not sure, the question is how heavy the annotations will be, I think not too much. The question why I'm kind of reluctant is the idea for instance that NSAttributedString would be separated into an NSString and an NSStringAttributes object, somehow this doesn't make sense to make. It will also be more problematic to keep things in sync after editing, and would certainly require all kinds of notification and delegates "hacks" to make it work. In the end I don't think we even need light weight sequences so much. After all, we're passing around pointers to objects, so imagine a bcalignment, it will get the pointers to the sequences, it will use the ivar to the raw data to get access to the char arrays, and do it stuff. Whether or not the bcsequence object contains the annotations or not doesn't make a millisecond or kb or ram difference!! This is one of the nicest things of the char array setup in fact. I don't like the idea of a separate record for the annotations too much. The question in the end comes to whether we see the sequence as the center of our universe, also containing annotations, or whether we see the metadata as the most important part, with one of its attributes being the sequence data in the form of a bcsequence object. I don't get the overall picture. If you really want to do the separation, it would make even more sense to me to make BCSequence the metadata/annotations object and have a separate BCSequenceData object...</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Alex</DIV> <BR></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi Alex,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I think you convinced me :)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Let's start implementing the char array and BCSequence structure first.<SPAN class="Apple-converted-space">  </SPAN>Are we merging BCSeqeunce and BCAbstractSequence so that we just will have a regular subclass - superclass structure?<SPAN class="Apple-converted-space">  </SPAN>For the ivars I suggest to make them immutable:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">const char *sequence</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">NSArray *symbolArray</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">And what will be the role of the BCParser class? It's still not very clear to me how this will fit into the BCFOundation picture.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">cheers,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- Koen.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BR class="Apple-interchange-newline"></BLOCKQUOTE></DIV><BR><DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">*********************************************************<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">                    </SPAN>** Alexander Griekspoor **</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">*********************************************************<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">              </SPAN>The Netherlands Cancer Institute</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">              </SPAN>Department of Tumorbiology (H4)</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">         </SPAN>Plesmanlaan 121, 1066 CX, Amsterdam</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">                  </SPAN>Tel:<SPAN class="Apple-converted-space">  </SPAN>+ 31 20 - 512 2023</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">                  </SPAN>Fax:<SPAN class="Apple-converted-space">  </SPAN>+ 31 20 - 512 2029</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">                  </SPAN>E-mail: <A href="mailto:a.griekspoor@nki.nl">a.griekspoor@nki.nl</A></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space"><SPAN class="Apple-converted-tab">    </SPAN>        </SPAN>AIM: <A href="mailto:mekentosj@mac.com">mekentosj@mac.com</A></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">              </SPAN>Web: <A href="http://www.mekentosj.com">http://www.mekentosj.com</A></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">                 </SPAN>EnzymeX - To cut or not to cut<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space">             </SPAN><A href="http://www.mekentosj.com/enzymex">http://www.mekentosj.com/enzymex</A></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">*********************************************************</FONT></DIV>  </DIV><BR></DIV></BODY></HTML>