调整差距开放处罚

时间:2017-06-29 01:31:02

标签: biopython

我正在使用biopython包中的mafft来对齐我的序列:

output=open("aligned.fasta","w")
from Bio.Align.Applications import MafftCommandline
mafft_cline=MafftCommandline(input="test.fasta")
print(mafft_cline)
stdout, stderr = mafft_cline()
output.write(stdout) 

但是我想调整间隙开度惩罚(默认为-6),我想测试几个(这里是-1)。帮助页面将其称为--LOP,但我尝试了几种方法来改变它但不能。

我试过了:

mafft_cline=MafftCommandline(input="test.fasta") --LOP -1

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'LOP' is not defined

OR

mafft_cline.LOP=-1

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 410, in __setattr__
    self.set_parameter(name, value)  # treat as a parameter
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 358, in set_parameter
    self._check_value(value, name, parameter.checker_function)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 380, in _check_value
    % (value, name))
ValueError: Invalid parameter value -1 for parameter LOP

谢谢!

1 个答案:

答案 0 :(得分:1)

您需要通过object属性设置参数,例如

mafft_cline.lop = -1.0

请注意,参数值必须是浮点数,即-1.0而不是-1