[Biopython-dev] complement, reverse_complement in Bio.Seq

Michiel Jan Laurens de Hoon mdehoon at ims.u-tokyo.ac.jp
Sat Aug 14 04:10:34 EDT 2004


Dear Biopythoneers (especially Dr. Chapman),

I have added the functions 'complement' and 'reverse_complement' to Bio.Seq's 
Seq and MutableSeq objects, which we discussed some weeks ago. Similar functions 
previously existed in various locations in BioPython:
- forward_complement, reverse_complement in Bio.GFF.easy
- complement, antiparallel in Bio.SeqUtils
These functions have now been deprecated, and will generate a DeprecationWarning
when used.

The functions complement and reverse_complement, when applied to a Seq object,
will return a new Seq object. The same function applied to a MutableSeq object
will modify the MutableSeq object itself, and don't return anything.

By the way, do we still need separate Seq and MutableSeq classes? As far as I 
understand, Seq is needed so that we can use strings, but since strings are 
immutable in Python we also need a MutableSeq. Wouldn't it be possible to 
implement this class in C, so that we can have mutable sequences that are still 
fast?

--Michiel.


-- 
Michiel de Hoon, Assistant Professor
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon





More information about the Biopython-dev mailing list