在执行以下命令利用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文件