计算化学公社

标题: ADCP多肽对接时使用AGFR出现报错以及解决方案 [打印本页]

作者
Author:
mengskl    时间: 2023-11-9 21:14
标题: ADCP多肽对接时使用AGFR出现报错以及解决方案
本帖最后由 mengskl 于 2023-11-9 21:41 编辑

最近在折腾ADCP(autodock crankpep)进行多肽对接,在跟着教程进行操作的时候,发现需要使用到AGFR生成affinity map,由于需要大批量操作,使用图形界面的AGFR十分不便,因此选择了使用命令好来操作。

但是在使用以下命令:
agfr -r receptor.pdbqt -l peptide.pdbqt -asv 1.1 -o output
以获取affinity map时出现了如下报错:

ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed.  Mostlikely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:  your installation is broken
- please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:  
1. Check that you are using the Python you expect (you're using /software/adcp/ADFRsuite_x86_64Linux_1.0/bin/python),   
     and that you have no directories in your PATH or PYTHONPATH that can     
     interfere with the Python and numpy versions you're trying to use.  
2. If (1) looks fine, you can open a new issue at     
    https://github.com/numpy/numpy/issues.  

Please include details on:     
- how you installed Python   
- how you installed numpy     
- your operating system     
- whether or not you have multiple versions of Python installed     
- if you built from source, your compiler versions and ideally a build log     
Note: this error has many possible causes, so please don't comment on     
an existing issue about this - open a new one instead.

Original error was: .local/lib/python2.7/site-packages/numpy/core/_multiarray_umath.so: undefined symbol: PyUnicodeUCS4_FromObject

由于ADCP是python2来编写的,对各种包的版本要求很严格,稍微不注意就摆烂了。
于是按报错提示,确认了python环境,属于adcp安装目录下的python2环境,删除了numpy并重装,mamba开了一个干净的环境来运行python2,均都不能解决问题

其实这个问题是由于Python的两个不同的Unicode版本(UCS2和UCS4)之间的不兼容导致的。为了确定具体是哪个版本,可以运行如下命令:

${adcp_path}/bin/python -c "import sys;print(sys.maxunicode)"


如果输出是65535则是UCS2编译的,如果输出是1114111则是UCS4编译的。(我的是1114111因此需要手动编译numpy,别用pip安装的会出错)

手动编译方法:
1.删除原有环境中的不兼容numpy
${adcp_path}/bin/python -m pip uninstall numpy

2.下载numpy源代码:  
wget https://github.com/numpy/numpy/archive/v1.16.6.tar.gz

3.解压缩源代码:
tar -xvzf v1.16.6.tar.gz

4.进入解压后的目录,并使用ADCP的python环境编译numpy(一定不要使用系统环境的python)
cd numpy-1.16.6
${adcp_path}/bin/python setup.py build


注意,这里有可能会提示缺少cython环境,使用对应python环境pip安装cython即可

完成编译后,再次运行agfr就不会有错误了,能顺利生成affinity map









作者
Author:
liangh36    时间: 2024-8-2 09:50
想问你对于含有非天然氨基酸的多肽,怎么用ADCP




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3