[BioPython] SeqUtils.antiparallel function

Michiel De Hoon mdehoon at c2b2.columbia.edu
Thu Jul 21 14:23:35 EDT 2005


The antiparallel function in SeqUtils has been deprecated. Please use the
function reverse_complement in Bio.Seq instead:

>>> from Bio.Seq import *
>>> x = 'atattatatat'
>>> reverse_complement(x)
'atatataatat'

This function is currently only in CVS, and is not included in Biopython
1.40b. You would need to download Seq.py from CVS and copy it to
c:\Python24\Lib\site-packages\Bio (overwriting the Seq.py that lives there).

If you want to use a Seq object instead of a string, use the
reverse_complement method on the Seq object:
>>> from Bio.Seq import *
>>> s = Seq('actactacta')
>>> s.reverse_complement()
Seq('tagtagtagt', Alphabet())
>>>

This function *is* in Biopython 1.40b, so you wouldn't need to install
anything.

--Michiel.


Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1150 St Nicholas Avenue
New York, NY 10032



-----Original Message-----
From: biopython-bounces at portal.open-bio.org on behalf of cgw501 at york.ac.uk
Sent: Thu 7/21/2005 12:37 PM
To: biopython at biopython.org
Subject: [BioPython] SeqUtils.antiparallel function
 
Hi,

I am parsing whole-chromosome genbank files, and need to get the reverse 
complement of some of the sequence. Here's what I get trying things out in 
the interpreter.

>>> x= 'atattatatat'
>>> from Bio.Seq import Seq
>>> a = Seq(x)
>>> from Bio.SeqUtils import antiparallel
>>> b = antiparallel(a)
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in ?
    b = antiparallel(a)
  File "C:\Python24\Lib\site-packages\Bio\SeqUtils\__init__.py", line 49, 
in antiparallel
    s = complement(seq)
  File "C:\Python24\Lib\site-packages\Bio\SeqUtils\__init__.py", line 38, 
in complement
    return seq.translate(_ttable)
AttributeError: Seq instance has no attribute 'translate'

Not sure what I'm doing wrong. Thanks,

Chris

_______________________________________________
BioPython mailing list  -  BioPython at biopython.org
http://biopython.org/mailman/listinfo/biopython




More information about the BioPython mailing list