[Biopython-dev] Rethinking Seq objects

Frédéric Sohm Frederic.Sohm at iaf.cnrs-gif.fr
Thu Apr 28 03:35:01 EDT 2005


I was following your discussion on Seq object. I more or less agree with Michiel.

But some thoughts :

1) get rid of MutableSeq and make all Seq mutable.
Will it not be a problem for some people there? I mean I only use MutableSeq so
noproblem there for me but I assume that someone uses non-mutable Seq or is it a
feature which is not needed?

2) Checking the alphabet. Yes. good. with the remark of Michael not force it for
people who don't want it. Can be painful for real long sequence.

4) circular sequences and indices. Nice. from experience not so easy to
implement correctly though.

5) Translate and transcribe. Yes obviously a good thing.

If you are interested you can have a look to DNA object in rana.
If you want it, take it under a Biopython licence. 
It's only DNA and it's certainly not worth using it but it can give you some
idea. A lot of complexity is added by supporting a biological indexation [1:len]
rather than a python one [0:len-1]. This is would not be a sensible thing to do
in biopython.

This is the C-implementation of Python String, modified with an alphabet
checking (a modif of the string translate() method with the alphabet hard coded
in) and support for circular sequences. 
If you want have a look at the DNA object for rana here :


The code is pretty bad, well my code not the python one.


Frédéric Sohm
Equipe INRA U1126 "Morphogenèse du système nerveux des Chordés"
Institut de Neurosciences A. Fessard
1 Avenue de la Terrasse
Phone: +33 (0) 1 69 82 34 12
Fax:+33 (0) 1 69 82 34 47

More information about the Biopython-dev mailing list