[Biopython-dev] derive from Seq

Brad Chapman chapmanb at 50mail.com
Tue Feb 16 13:09:45 UTC 2010


Hi Matthias;

> I've implemented a class derived from Seq. Many of the Seq functions
> return Seq. Thus, I can not use those functions because I need
> instances of the derived class.
>
> This can easily be fixed by returning:
>
> self.__class__( .. ) 

Good catch. Would you be able to submit a patch for this to the bug
tracker?

More generally, it is interesting that you are subclassing Seq. Can
you describe your application for this? I was debating with Peter
and Michiel this week and arguing that the Seq class should be
switched to a standard string, with biological functions like
reverse_complement and the like moving to stand alone functions and
SeqRecord objects. I'd be interested in hearing the opposite case;
that additional functionality is needed on a Seq object.

Brad



More information about the Biopython-dev mailing list