[Biococoa-dev] Base test

John Timmer jtimmer at bellatlantic.net
Sun Aug 15 21:24:33 EDT 2004

> Also, would it be wise to make some further organisation using folders. We
> have a Utils folder already. Perhaps both the sequence stuff and IO part could
> be placed in separate folders.
Speaking of Utils, I'm going to rename that DNA item to "DNAStringUtils or
something such like.  I'll keep it there, because it's easy to use if all
you're doing is converting a sequence in string form and using it as a
string immediately, but I'll focus on making things work with our base/amino
acid tokens.

> A few remarks that I had after my first quick look at the added code:
> - John shouldn't there be singleton objects for the "W, S, V, B, R" bases as
> well? I now only found ACGTN
> - I think it's impossible because of the needed statics, but would there be a
> way to COMPLETELY initialize all bases on the basis of the plist?
The static values and methods for the rest of the bases are on the way.
I'll also make a gap and non-base item, for alignments and such.  I can't do
anything with them until I fill out the .plist file.  When that's done, I'll
make the methods. 

A short summary of how things work:
The first time a base is called for, the class reads the .plist file.  All
the predefined base objects are created, but their
complements/representations are kept as strings in the dictionary, and held
on to within the base.  Any additional bases are kept in a static
dictionary, which is retained.

The first time a base has one of the complement/representation methods are
called, the string-based references there are converted into references to
the appropriate singleton reference, thanks to the work of Jim and Alex.

Any custom bases added to the .plist file have to be accessed with
+ (BCSequenceDNABase *) customBase: (NSString *)baseName
When that's called, the dictionary within is also converted to a base
object.  I still need to make a method for adding a base programmatically,
but that's just going to be 90% format validation code, so it shouldn't be

> - Then we encounter another problem. BCSequence should be a ancestor class
> that devides in aminoacid, dna or rna  sequence subclasses. Now you have
> something mixed, do we incorporate translations into the sequence? I guess
> not, these sequences should be mixed, either pure dna or pure protein. If we
> do, RNA translation must be there as well. So the aminoacid methods are
> strange here. The idea I would propose is that there is a shared translation
> util object that you could feed a dna sequence and get (in the requested
> frames) the translated sequences back as protein sequence objects. It's the
> app task to control/organize these. Likewise, one could argue this for
> complements as well -> a shared dna utils object returns you the complement
> sequence if you hand it a sequence. Alternatively these translations could be
> added as features, but in all cases there's again the "how to keep things in
> sync upon editing" problem. I think we should keep things as separate and
> clean entities as much as possible.
I was actually thinking we could have a BCGeneticCode, consisting of
BCCodons, again, extensible through .plists, to let us define the code for
different species.  Create a genetic code, hand it a dictionary, then submit
your sequence to it, and get the amino acid sequence back.

And finally, I think the CVS problem is with my login in general, rather
than CVS in particular.  I was hoping to get it sorted out, but I'm probably
going to create a new account on Monday if I don't hear something by then.


This mind intentionally left blank

More information about the Biococoa-dev mailing list