[Biopython-dev] [Biopython] SeqRecord reverse complement method?

Peter biopython at maubp.freeserve.co.uk
Mon Jun 14 10:44:50 EDT 2010


Hi all,

You may recall late last year I posted about adding a reverse
complement method to the SeqRecord, and addition support:
http://lists.open-bio.org/pipermail/biopython-dev/2009-September/006850.html
http://lists.open-bio.org/pipermail/biopython-dev/2009-October/006851.html

SeqRecord addition was included in Biopython 1.53, but
not the reverse_complement() method - which is something
I wanted to use again today to reverse complement an
annotated GenBank file and have all the SeqFeature
locations flipped for me. I've rescued my old code and
its unit tests and created a new branch for it:
http://github.com/peterjc/biopython/commits/seqrecord-rc

As I said at the end of last year, I think the general idea of
a SeqRecord reverse_complement() method is nice but the
details about handling the annotation is tricky. When we
discussed slicing and addition, it was agreed that we
should be cautious to avoid blindly transferring annotation
inappropriately. The code on this branch allows the user to
choose for each annotation type if it should be dropped
(False), kept (True) or set to a supplied new value. The
docstring has examples of how this works (which double
as doctests).

Jose - I've CC'd you since I know you wrote your own
SeqRecord subclass with a complement() method (but not
a reverse_complement() method) for Franklin. I'm curious
about this choice.

Cedar - I've CC'd you since you asked about this kind of
think last year:
http://lists.open-bio.org/pipermail/biopython/2009-June/005307.html

Regards,

Peter


More information about the Biopython-dev mailing list