Alphafold2使用docker运行,需要注意的很多小细节

在执行以下命令利用docker执行Alphafold2预测蛋白结构时,使用以下命令

python3 /public/home/tmp/protein_test/alphafold/docker/run_docker.py \

--fasta_paths=rcsb_pdb_9FH9.fasta  \   ###建议使用根目录

--max_template_date=2023-05-16 --model_preset=monomer  \

--models_to_relax=all --enable_gpu_relax=True  \

--data_dir=/public/image/alphafold_data/ \

--output_dir=/public/home/tmp/protein_test/result  ###注意一定要使用根目录,不然就会报错!

最新版本会发生报错:

/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
 Traceback (most recent call last):
File "/app/alphafold/run_alphafold.py", line 39, in <module>
from alphafold.model import data
File "/app/alphafold/alphafold/model/data.py", line 19, in <module>
from alphafold.model import utils
File "/app/alphafold/alphafold/model/utils.py", line 23, in <module>
import haiku as hk
File "/opt/conda/lib/python3.10/site-packages/haiku/__init__.py", line 25, in <module>
from haiku import testing
File "/opt/conda/lib/python3.10/site-packages/haiku/testing.py", line 18, in <module>
from haiku._src.test_utils import transform_and_run
 File "/opt/conda/lib/python3.10/site-packages/haiku/_src/test_utils.py", line 24, in <module>
 from absl.testing import parameterized
File "/opt/conda/lib/python3.10/site-packages/absl/testing/parameterized.py", line 218, in <module>
 from absl.testing import absltest
 File "/opt/conda/lib/python3.10/site-packages/absl/testing/absltest.py", line 238, in <module>
get_default_test_tmpdir(),
File "/opt/conda/lib/python3.10/site-packages/absl/testing/absltest.py", line 176, in get_default_test_tmpdir
 tmpdir = os.path.join(tempfile.gettempdir(), 'absl_testing')
File "/opt/conda/lib/python3.10/tempfile.py", line 299, in gettempdir return _os.fsdecode(_gettempdir())
File "/opt/conda/lib/python3.10/tempfile.py", line 292, in _gettempdir
tempdir = _get_default_tempdir()
File "/opt/conda/lib/python3.10/tempfile.py", line 223, in _get_default_tempdir
raise FileNotFoundError(_errno.ENOENT,
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/app/alphafold']

此问题的核心表现为权限问题(之前不存在这个问题,后来出现的)

解决方式:

在脚本 /public/home/tmp/protein_test/alphafold/docker/run_docker.py中第91行,

修改'docker_user', f'{os.geteuid()}:{os.getegid()}',

docker_user', 'root',

即可正常运行

注意:输出的文件也都为root文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值