
今天在研究 BioPython教程里面的一个代码。把它写到脚本里面一运行啊 ,出现咯错误:
bash-4.1# python Translate1.py
Traceback (most recent call last):
File "Translate1.py", line 7, in <module>
my_seq=Seq("GATCGATGGGCCTATATAGGATCGAAAATCGC",IUPAC.unambiguous_dna)
TypeError: 'module' object is not callable
上古鸽一搜索 ,说的大多是导入模块时写得有问题 。于是本座仔细检查咯一下自己保存到脚本中的代码,果然 ,有一句少写了一点东西 。
本座写入的脚本是 :
#!/usr/bin/python
#coding:utf-8
from Bio import Seq
from Bio.Alphabet import IUPAC
my_seq=Seq("GATCGATGGGCCTATATAGGATCGAAAATCGC",IUPAC.unambiguous_dna)
print my_seq
而教程里面是 :
#!/usr/bin/python
#coding:utf-8
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
my_seq=Seq("GATCGATGGGCCTATATAGGATCGAAAATCGC",IUPAC.unambiguous_dna)
print my_seq
原来是本座抄代码的时候漏咯一个 “Seq”。
也就是说 ,my_seq实际上是一个Bio.Seq.Seq对象。
改过来之后,就好咯 。
HxLauncher: Launch Android applications by voice commands