[Biococoa-dev] translation demo

John Timmer jtimmer at bellatlantic.net
Sun Sep 26 09:44:05 EDT 2004

Unfortunately, the grant's not for me and isn't paying me.  It's the
department chairman's though, so it seems worth making some effort for ;).

Just to let you guys know, I'm planning on changing the DNATranslator to a
generic tool class (BCToolRibosome?) that can handle both DNA and RNA with
the same method.  The method's going to wind up looking very similar to the
existing one, but will be more broadly applicable.

Sorry about the #include - just must have gone braindead for a moment.

> That one is still there and happens here:
> + (NSMutableDictionary *) priv_createCodonArraysFromDictionary:
> (NSDictionary *)entry {
>      NSMutableArray *DNAArray = [NSMutableArray array];
>      NSMutableArray *RNAArray = [NSMutableArray array];
>      NSEnumerator *keyEnumerator = [entry keyEnumerator];
>      NSMutableString *aKey;
>      BCCodon *aCodon, *RNACodon;
>      while ( aKey = [keyEnumerator nextObject] ) {
>          aCodon = [[[BCCodonDNA alloc] initWithDNASequenceString: aKey
> andAminoAcidString: [entry objectForKey: aKey]] autorelease];
>          if ( aCodon != nil )
>              [DNAArray addObject: aCodon];
>   =====>>>       [aKey replaceOccurrencesOfString: @"T" withString: @"U"
> options: NSCaseInsensitiveSearch range: NSMakeRange(0, 3)];
> Although aKey is typed as a mutable string you probably get normal
> strings from the enumerator and thus you can't replace the occurences
> of T for U.
Right, I'll fix that to make a mutable copy.

> One other little thing. John you created two "private methods" in
> BCGeneticCode. They are not private however as they are in the public
> header file. The way to do this is to create kind of a private category
> inside the .m file. I changed it, so take a look at BCGeneticCode.m to
> see what I mean. This way they are completely invisible to the
> developer. Of course he has the source, so if he wants to per se, he
> can still call it, but at least he will get some warnings ;-)
Thanks, I'll look it over - that's something I'm not savvy with, so this
will be educational for me.



This mind intentionally left blank

More information about the Biococoa-dev mailing list