[Biopython-dev] derive from Seq

Matthias Bernt MatatTHC at gmx.de
Tue Apr 22 12:49:02 EDT 2008


Hi, 

Despite of other messages on this list someone needs circular sequences 
.. me  :). I thought that the best way to get a circular behaviour is to make a derived class in order to keep all the nice features of Seq. 

So I've started to write a derived class which overwrites some of the methods from the Seq - especially __getitem__ - and I run quite fast into problems. E.g. the complement method returns a Seq object. 

The desired behaviour would be to return an instance of my derived class 
.. This could be done easily with self.__class__(s, self.alphabet). 

Unfortunately the __init__ method of my derived class has a third 
parameter (with default value) which sets the sequence to circular / linear. This could be done with copy or clone methods.  

So you see that there are problems when deriving from the Seq class. What 
is the best (or a good) strategy for deriving classes from Seq?  

Thanks 
-- Matthias 


-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the Biopython-dev mailing list