(防坑)Alphafold 非docker 安装指南

本指南适用于Linux系统。Alphafold官方也强调尽量使用Linux系统!官方提供了docker版安装步骤。
在这里插入图片描述

  • Alphafold简介:

    • 强大的蛋白质结构预测。
    • 开源地址:https://github.com/deepmind/alphafold
    • 在线结构数据库:https://alphafold.ebi.ac.uk/
    • 在线版Alphafold:https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb
    • 论文:https://www.nature.com/articles/s41586-021-03819-2
  • 软硬件条件:

    • python版本:建议使用python3.8。

    • 建议使用conda创建python环境。

      conda安装参见:https://conda.io/projects/conda/en/latest/user-guide/install/index.html

    • 硬件条件(搭建本地预测服务器参考条件):

      • 硬盘1T至2T以上,建议3T。

        注1:Alphafold预测的准确度依赖于共进化信息的丰富度,所以要完整的预测或全提高准确度,就需要下载好几个数据库,下载的脚本在Alphafold包的script文件夹下。所以需要这么大的存储,在超算上这都不是事。但是,个人PC就有点大了!

        注2:如果只是简单预测或测试,可以不用下载官方给出的全部数据库,准备1T足以,视所需数据库的大小。

      • CPU: 8至12核以上。

      • 内存:16G至48G以上。

      • GPU:支持CUDA11(不用GPU会很费时间,尽量使用GPU加速。)

      • 注:如果只是想在个人PC上简单测试,以上硬件条件可忽略。也可以使用在线版Alphafold进行预测。

  • 安装步骤:

    • 第一步:从github下载Alphafold包。

      git clone https://github.com/deepmind/alphafold.git

    • 第二步:进入alphafold文件夹,配置python环境。

      pip install -r requirements.txt

    • 第三步:修改jaxlib版本。

      使用官方的jaxlib会报错:AttributeError: module ‘jaxlib.pocketfft’ has no attribute ‘pocketfft’

      pip install --upgrade jax== 0.2.14 jaxlib==0.1.69

    • 第四步:安装openMM。

      官方建议使用conda安装。参见:https://openmm.org/

      建议使用openmm7.5.1版本,7.6.0会报错:ModuleNotFoundError: No module named ‘simtk.openmm.app.internal’

      • conda install -c conda-forge openmm=7.5.1

      • 验证openmm:python -m simtk.testInstallation

        • 直接执行python -m openmm.testInstallation 会报错找不到openmm

        • 输出以下内容就说明安装好了。

          OpenMM Version: 7.5.1
          Git Revision:

          There are 4 Platforms available:

          1 Reference - Successfully computed forces
          2 CPU - Successfully computed forces
          3 CUDA - Successfully computed forces
          4 OpenCL - Successfully computed forces

          Median difference in forces between platforms:

          Reference vs. CPU:
          Reference vs. CUDA:
          CPU vs. CUDA:
          Reference vs. OpenCL:
          CPU vs. OpenCL:
          CUDA vs. OpenCL:

          All differences are within tolerance.

        • 如果输出内容里出现:CUDA - Error computing forces with CUDA platform,原因在于cudatookit不对。首先使用 nvidia-smi 查看CUDA Version,然后使用 conda install -c conda-forge cudatoolkit= CUDA Version(对应的版本号),就可以解决问题。当然没有cuda也能跑起来,只是费时间。

    • 验证Alphafold:

      • 进入alphafold,执行 python run_alphafold_test.py

      • 出现以下内容,就说明安装好了。

        [ RUN ] RunAlphafoldTest.test_end_to_end_no_relax
        I0814 21:46:41.874690 140372256589632 run_alphafold.py:161] Predicting test
        I0814 21:46:41.875205 140372256589632 run_alphafold.py:190] Running model model1 on test
        I0814 21:46:41.875339 140372256589632 run_alphafold.py:202] Total JAX model model1 on test predict time (includes compilation time, see --benchmark): 0.0s
        I0814 21:46:41.878139 140372256589632 run_alphafold.py:271] Final timings for test: {‘features’: 3.409385681152344e-05, ‘process_features_model1’: 3.838539123535156e-05, ‘predict_and_compile_model1’: 2.0742416381835938e-05}
        [ OK ] RunAlphafoldTest.test_end_to_end_no_relax
        [ RUN ] RunAlphafoldTest.test_end_to_end_relax
        I0814 21:46:41.880331 140372256589632 run_alphafold.py:161] Predicting test
        I0814 21:46:41.880626 140372256589632 run_alphafold.py:190] Running model model1 on test
        I0814 21:46:41.880749 140372256589632 run_alphafold.py:202] Total JAX model model1 on test predict time (includes compilation time, see --benchmark): 0.0s
        I0814 21:46:41.883405 140372256589632 run_alphafold.py:271] Final timings for test: {‘features’: 3.0994415283203125e-05, ‘process_features_model1’: 3.409385681152344e-05, ‘predict_and_compile_model1’: 1.6450881958007812e-05, ‘relax_model1’: 2.9087066650390625e-05}

        [ OK ] RunAlphafoldTest.test_end_to_end_relax

        Ran 2 tests in 0.011s

        OK

  • 后记:

    • 未完待续,后续Alphafold使用将继续更新。
    • 本文提到的一些软件可以通过下列连接获取。
      • minicoda:链接: https://pan.baidu.com/s/1HOvUef7m0TffRdC-caUzVQ 提取码: dwwc
      • Alphafold:链接: https://pan.baidu.com/s/1D0CXpumKFo21kJLd29xvNw 提取码: ri6s
    • GPU环境配置(cuda等安装)可参考这篇博文:https://blog.csdn.net/Zqinstarking/article/details/80713338
    • 转载引用请注明出处:https://blog.csdn.net/Zqinstarking/article/details/126342410
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值