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

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

Hi all,

You may recall late last year I posted about adding a reverse
complement method to the SeqRecord, and addition support:

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:

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:



More information about the Biopython-dev mailing list