1、前言
第一次安装了两天终于解决,结果用完了直接删掉了。结果最近又需要,用了一下午重新摸清楚了,又走了一些弯路。因此需要记录下来便于各位少走弯路。
该工具是发表在nature communication中的,2024年发表,Chen, Y., et al., An end-to-end framework for the prediction of protein structure and fitness from single sequence. Nature Communications, 2024. 15(1)
2、安装
这个软件还可以用于结构预测,但是这个功能我不想用因此安装变得简单地太多了。不过也有一些细节。需要注意。不然还需要鼓捣很多天。
1、首先把软件报给下载下来,要是git失败的话,进入网址,下载SPIRED-Fitness的zip文件,再解压缩即可。解压缩的文件名要改成SPIRED-Fitness(不改也行,不改就是SPIRED-Fitness-main了)
git clone https://github.com/Gonglab-THU/SPIRED-Fitness.git
cd SPIRED-Fitness
2.创建环境这个没得说
conda create -n spired_fitness python=3.11
conda activate spired_fitness
3.安装包,注意,这里的conda install跟github上的不同,我做了修改!,github上的cpuonly版本的pytorch居然有问题奇怪
# 推荐 conda 安装
conda install pytorch torchvision torchaudio -c pytorch
pip install click==8.1.7
pip install einops==0.7.0
pip install pandas==2.1.4
pip install biopython==1.82
4、几乎结束了,下面要开始使用了
使用方式,进入SPIRED-Fitness的目录直接用就行。
但注意我的安装过于简单了,导致其中一个模块没有安装,所以该命令:
bash run_spired.sh -i example_spired/test.fasta -o example_spired
是执行不了的,这个是结构预测的我没安装
# run SPIRED
bash run_spired.sh -i example_spired/test.fasta -o example_spired
# run SPIRED-Fitness
bash run_spired_fitness.sh -i example_fitness/test.fasta -o example_fitness
# run SPIRED-Stab
bash run_spired_stab.sh -i example_stab/test.fasta -o example_stab
5、补充安装之一
如果执行老多SPIRED-Fitness就会发现,首先会自动安装一个东西,之后就开始报错了,原因是——————SPIRED的模型权重没有安装
这个网站,把model文件夹下载下来
,放到当前文件夹中的model文件夹中,并且解压
6 补充安装之二
再次运行,SPIRED-Fitness仍旧会有报错,这个原因我找了很久!原因是这个github根本就没有提————我们还需要下载ESM蛋白质语言模型的权重!这个是最坑的。因为这个github上根本没说。
运行过一会儿后,他会下一些文件,但是后来会卡住,因为权重文件太大了,有40GB左右!
需要在~/.cache/torch/hub/下新建一个文件夹checkpoints,然后在里面安装如下的权重:
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm2_t33_650M_UR50D.pt # 650M参数(最常用)
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm2_t36_3B_UR50D.pt # 3B参数(更高精度)
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1v_t33_650M_UR90S_1.pt # 5个ensemble模型中的第1个
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1v_t33_650M_UR90S_2.pt
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1v_t33_650M_UR90S_3.pt
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1v_t33_650M_UR90S_4.pt
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1v_t33_650M_UR90S_5.pt # 需全部下载用于ensemble
一共是这么多!!!!
等全部下载完成之后,就可以正常运行了。
温馨提示!:使用wget的下载速度超快,不需要上VPN的。