[Biococoa-dev] Annotation

Charles PARNOT charles.parnot at stanford.edu
Fri Feb 18 23:50:26 EST 2005


It seems logical and simple to start with the ivar being a dictionary, and I afree this is better than an array for the reasons you say. I would not add a BCAnnotations class. But some constant for some important keys would be useful.

The real question is what can be an annotation? It seems that for most databases and sequence file formats, a key-value design is very appropriate, right?

have a nice week-end!

charles

At 8:37 PM -0500 2/18/05, Koen van der Drift wrote:
>Hi,
>
>This weekend I might be trying to implement the code for annotations. Unless someone else feels the urge to do so ;-) I noticed that Charles has added the following instance variable to BCAbstractSequence.h:
>
>NSMutableArray	*annotationArray;    //coming soon!!
>
>
>Not sure what you had in mind here, Charles. Would this be an array of BCAnnotation objects? In that case each BCAnnotation object would be take care of just one annotation. However, I suggest we use a NSDictionary instead. The next decision would be if we add a NSMutableDictionary variable to the sequence, or create a separate BCAnnotations class that manages the annotations (basically a wrapper). In the latter case, to add a annotation, we could use the following code
>
>
>[mySequence addAnnotation: @"value" forKey: @"key"];
>
>
>This will then call in BCAbstractSequence
>
>- (id) addAnnotation:(NSString *)aValue forKey:(NSString *) aKey
>{
>	[[self annotations] addAnnotation: aValue forKey: aKey];
>}
>
>
>And then in BCAnnotations:
>
>- (id) addAnnotation:(NSString *)aValue forKey:(NSString *) aKey
>{
>	[[self annotationDictionary] setObject: aValue forKey: aKey];
>}
>
>etc.
>
>It seems redundant to add almost two similar calls, my thought here is is that if we keep the interaction with the dictionary in a wrapper, it becomes easier to change things, and add more possibilities (searching, eg).
>
>
>
>What do you think of this approach?
>
>
>cheers,
>
>- Koen.
>
>
>_______________________________________________
>Biococoa-dev mailing list
>Biococoa-dev at bioinformatics.org
>https://bioinformatics.org/mailman/listinfo/biococoa-dev


-- 
Help science go fast forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford/

Charles Parnot
charles.parnot at stanford.edu

Room  B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)

Tel +1 650 725 7754
Fax +1 650 725 8021



More information about the Biococoa-dev mailing list