[Biopython-dev] [Bug 1675] complement() returns string instead of Seq object

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Dec 7 03:48:07 EST 2004


mdehoon at ims.u-tokyo.ac.jp changed:

           What    |Removed                     |Added
         AssignedTo|biopython-dev at biopython.org |mdehoon at ims.u-tokyo.ac.jp

------- Additional Comments From mdehoon at ims.u-tokyo.ac.jp  2004-12-07 03:48 -------
This has been fixed in the CVS version of Biopython. For a Seq object, there is
currently no reverse() function. You can use s[-1::-1] instead, but that will
still give you a string instead of a new Seq object.

>>> from Bio.Seq import *
>>> s = Seq('ATCGACTG')
>>> s.reverse_complement()
Seq('CAGTCGAT', Alphabet())
>>> s.complement()
Seq('TAGCTGAC', Alphabet())

>>> m = MutableSeq('ATCGACTAG')
>>> m.reverse()
>>> m
MutableSeq(array('c', 'GATCAGCTA'), Alphabet())
>>> m.complement()
>>> m
MutableSeq(array('c', 'CTAGTCGAT'), Alphabet())
>>> m.reverse_complement()
>>> m
MutableSeq(array('c', 'ATCGACTAG'), Alphabet())

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Biopython-dev mailing list