• 回答数

    0

  • 浏览数

    3253

  • 收藏数

    0

作者:要疼你一辈子 发表于 2018-12-5 13:55:47
跳转到指定楼层
写在前面:该问题目前并没有解决。

最近使用autodock进行对接,过程中出现两个错误:
1, 运行autogrid4时直接报的error2,这是因为进行autogrid时候没有指定autogrid4.exe的路径,指定绝对路径后,运行,没有问题。
2, 运行autogrid4,autodock4后得到dlg文件,点击Analyse --> Dockings ---> Open, 打开dlg文件,报错,错误如下:

Traceback (most recent call last):
  File "C:\Program Files (x86)\MGLTools-1.5.6\lib\site-packages\ViewerFramework\VF.py", line 898, in tryto
    result = command( *args, **kw )
  File "C:\Program Files (x86)\MGLTools-1.5.6\lib\site-packages\AutoDockTools\autoanalyzeCommands.py", line 3852, in doit
    d.readDlg(dlgFile)
  File "C:\Program Files (x86)\MGLTools-1.5.6\lib\site-packages\AutoDockTools\Docking.py", line 105, in readDlg
    self.ch = ConformationHandler(self.ligMol,
AttributeError: Docking instance has no attribute 'ligMol'

查看原始代码:
autoanalyzeCommands.py 中执行了代码如下(部分代码):


[Python] 纯文本查看 复制代码
[backcolor=white !important]
1

2

3

4

5

from Docking import Docking

if not addToPrevious or not self.vf.docked:

    d = self.vf.docked = Docking()

d = self.vf.docked

d.readDlg(dlgFile)







而readDlg正是Docking类的一个方法,见Docking.py, Docking类下readDlg方法的定义如下(部分代码):


[Python] 纯文本查看 复制代码
[backcolor=white !important]
01

02

03

04

05

06

07

08

09

10

11

12

13

14

def readDlg(self, dlgFile, ligand=None):

    if ligand is not None:

        self.ligMol = ligand

    if self.defaultParser:

        dlo = DockingLogObject(self, dlgFile)

    else:

        dlo = DockingLogObject(self, dlgFile, self.parser)


    if len(dlo.parser.WARNINGS):

        self.warnings.extend(dlo.parser.WARNINGS)


    self.version = dlo.version

    if not self.ch:

        self.ch = ConformationHandler(self.ligMol, dlo.dpo['about']['value'])






                                                                          
从代码中可以看到ConformationHandler中有self.ligMol参数。而self.ligMol参数在前面的if语句中定义了,即:


[Python] 纯文本查看 复制代码
[backcolor=white !important]
1

2

if ligand is not None:

    self.ligMol = ligand







这里是关键,ligand默认是None, 而调用的时候是用的d.readDlg(digFile),并没有传入ligand参数,也就是,这里ligand=None,该if语句不执行,也即self.ligMol不存在。这也是出现AttributeError: Docking instance has no attribute 'ligMol'的原因。

问题在于:不论digFile长什么样子,ligand始终为None,self.ligMol始终不存在。程序始终会报错。

分享:
回复

使用道具

成为第一个回答人

高级模式 评论
您需要登录后才可以回帖 登录 | 立即注册 微信登录