Conda重新安装Alphafold2【Ubuntu24.04】

安装依赖包等

上篇中已经成功安装了部分东西
cmake, hmmer,Kalign,都测试可以用

conda env python=3.9

这次我们参考这位哥的方法安装, conda,必须conda
https://blog.youkuaiyun.com/weixin_40192882/article/details/135993286
但是因为我下载的af2版本里的requirement都需要python 3.9

conda create -n af python=3.9
conda activate af

hh-suite

上次编译安装不成功。

这次conda

conda install -c bioconda hhsuite==3.3.0

如果编译
git clone https://github.com/soedinglab/hh-suite.git
mkdir -p hh-suite/build && cd hh-suite/build
cmake -DCMAKE_INSTALL_PREFIX=. ..
make -j 4 && make install
export PATH="$(pwd)/bin:$(pwd)/scripts:$PATH"

安装requirements和其他

conda install -c conda-forge openmm==7.7.0 cudatoolkit==11.8.0
conda install -c conda-forge tensorflow-gpu=2.13 -y
##他自动给我装上cudnn-8.9.7.29,甚至我的cuda其实也不需要自己配,他也能给我找到对应的版本装
conda install -c bioconda hhsuite==3.3.0
conda install -c bioconda kalign2==2.04
pip install --user -r requirementsgpu.txt
#把原始的requirement里面tensorflow那行删除的文件

conda install pdbfixer 
conda install mock                 
#这两个都是跑测试运行时候提醒我没装,后来安装的                                 

requirement的列表

absl-py==1.0.0
biopython==1.79
chex==0.1.86
dm-haiku==0.0.12
dm-tree==0.1.8
docker==5.0.0
immutabledict==2.0.0
jax==0.4.26
ml-collections==0.1.0
numpy==1.24.3
pandas==2.0.3
setuptools<72.0.0
scipy==1.11.1

升级统一jax和jaxlib版本

pip install --upgrade "jax[cuda]==0.4.30" "jaxlib==0.4.30" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

#诶怎么cuda啥的都给变了
Successfully uninstalled jax-0.4.26
Successfully installed jax-0.4.30 jax-cuda12-pjrt-0.4.30 jax-cuda12-plugin-0.4.30 nvidia-cublas-cu12-12.8.4.1 nvidia-cuda-cupti-cu12-12.8.90 nvidia-cuda-nvcc-cu12-12.8.93 nvidia-cuda-runtime-cu12-12.8.90 nvidia-cudnn-cu12-9.8.0.87 nvidia-cufft-cu12-11.3.3.83 nvidia-cusolver-cu12-11.7.3.90 nvidia-c

Anyway, 试一下jax, tensorflow是不是能用了

>>> import jax
>>> print(jax.devices())
[cuda(id=0), cuda(id=1)]
>>> 
>>> import tensorflow as tf
>>> tf.config.list_physical_devices('GPU')
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU'), PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU')]

使用测试

因为数据文件都已经在上篇进行过下载了,这次不用重新设置

#安装aria2
sudo apt install aria2
# 数据库安装
## 下载全部数据库
#放在了大硬盘里(包括gitAF时候),SSD的硬盘可能不够大。运行命令在目录alphafold下,下载的数据库放在alphafold文件夹外
./scripts/download_all_data.sh /mnt/8a/afDatabase

确认conda activate af
cd到主文件夹下

python run_alphafold_test.py

Running tests under Python 3.9.21: /home/lenovo/anaconda3/envs/af/bin/python
[ RUN      ] RunAlphafoldTest.test_end_to_end_no_relax
I0401 13:49:36.664551 137912000828928 run_alphafold.py:245] Predicting test
I0401 13:49:36.665014 137912000828928 run_alphafold.py:276] Running model model1 on test
I0401 13:49:36.665124 137912000828928 run_alphafold.py:288] Total JAX model model1 on test predict time (includes compilation time, see --benchmark): 0.0s
I0401 13:49:36.703934 137912000828928 run_alphafold.py:414] Final timings for test: {'features': 4.315376281738281e-05, 'process_features_model1': 2.574920654296875e-05, 'predict_and_compile_model1': 1.5735626220703125e-05}
[       OK ] RunAlphafoldTest.test_end_to_end_no_relax
[ RUN      ] RunAlphafoldTest.test_end_to_end_relax
I0401 13:49:36.705569 137912000828928 run_alphafold.py:245] Predicting test
I0401 13:49:36.705774 137912000828928 run_alphafold.py:276] Running model model1 on test
I0401 13:49:36.705865 137912000828928 run_alphafold.py:288] Total JAX model model1 on test predict time (includes compilation time, see --benchmark): 0.0s
I0401 13:49:36.755175 137912000828928 run_alphafold.py:414] Final timings for test: {'features': 3.0279159545898438e-05, 'process_features_model1': 2.384185791015625e-05, 'predict_and_compile_model1': 1.5020370483398438e-05, 'relax_model1': 3.0517578125e-05}
[       OK ] RunAlphafoldTest.test_end_to_end_relax
----------------------------------------------------------------------
Ran 2 tests in 0.102s

成功!泪目
具体使用等咱再研究一下。
至此各种常用的东西就都本地化了
Rosetta, RFdiffusion, ProteinMPNN, Alphafold2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值