下载
If you want to set up RFdiffusion locally, follow the steps below:
To get started using RFdiffusion, clone the repo:
git clone https://github.com/RosettaCommons/RFdiffusion.git
You’ll then need to download the model weights into the RFDiffusion directory.
cd RFdiffusion
mkdir models && cd models
wget http://files.ipd.uw.edu/pub/RFdiffusion/6f5902ac237024bdd0c176cb93063dc4/Base_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/e29311f6f1bf1af907f9ef9f44b8328b/Complex_base_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/60f09a193fb5e5ccdc4980417708dbab/Complex_Fold_base_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/74f51cfb8b440f50d70878e05361d8f0/InpaintSeq_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/76d00716416567174cdb7ca96e208296/InpaintSeq_Fold_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/5532d2e1f3a4738decd58b19d633b3c3/ActiveSite_ckpt.pt
wget http://files.ipd.uw.edu/pub/RFdiffusion/12fc204edeae5b57713c5ad7dcb97d39/Base_epoch8_ckpt.pt
Optional:
wget http://files.ipd.uw.edu/pub/RFdiffusion/f572d396fae9206628714fb2ce00f72e/Complex_beta_ckpt.pt
# original structure prediction weights
wget http://files.ipd.uw.edu/pub/RFdiffusion/1befcb9b28e2f778f53d47f18b7597fa/RF_structure_prediction_weights.pt
退回到RFdiffusion目录
安装
conda env create -f env/SE3nv.yml
conda activate SE3nv
cd env/SE3Transformer
pip install --no-cache-dir -r requirements.txt
python setup.py install
cd ../.. # change into the root directory of the repository
pip install -e . # install the rfdiffusion module from the root of the repository
运行到pip install时候报错,看样子是git不到东西
e3nn==0.3.3
wandb==0.12.0
pynvml==11.0.0
git+https://github.com/NVIDIA/dllogger#egg=dllogger
decorator==5.1.0
~
打开requirments是这样的,先把line 4以外的都install,
git的有问题就先下载了代码,再用
pip install .
回到env/SE3Transformer folder,
python setup.py install
cd ../..
pip install -e . # install the rfdiffusion module from the root of the repository
返回一串,最后一句
#Successfully installed rfdiffusion
Anytime you run diffusion you should be sure to activate this conda environment by running the following command:
conda activate SE3nv
测试&使用
tar -xvf examples/ppi_scaffolds_subset.tar.gz -C examples/
Let’s first look at how you would do unconditional design of a protein of length 150aa.
For this, we just need to specify three things:
- The length of the protein
- The location where we want to write files to
- The number of designs we want
./scripts/run_inference.py 'contigmap.contigs=[150-150]' inference.output_prefix=test_outputs/test inference.num_designs=10
然后提示cuda有问题,检查是系统本身的cuda版本是12, yml文件配置的cuda是11,pytorch是1.9. 把系统外部的cuda卸载了(上次AF2没成功,干脆把外部环境清理掉,稍后再用conda安装)
sudo apt remove --purge '^cuda-.*' nvidia-cuda-toolkit
nvcc --version
#bash: /usr/bin/nvcc: No such file or directory 卸载干净了
#重新安装
conda install cudatoolkit=11.1 -c conda-forge
conda install pytorch==1.9.1 torchvision==0.10.1 torchaudio==0.9.1 cudatoolkit=11.1 -c pytorch
nvcc --version
Command 'nvcc' not found, but can be installed with:
#没有,但是conda list里有
直接python验证
>>> import torch
>>> print(torch.__version__)
1.9.1
>>> print(torch.version.cuda)
11.1
>>> print(torch.cuda.is_available())
True
>>> print(torch.cuda.get_device_name(0))
NVIDIA RTX A6000
>>>
./scripts/run_inference.py 'contigmap.contigs=[150-150]' inference.output_prefix=test_outputs/test inference.num_designs=10
[2025-03-31 10:13:04,221][__main__][INFO] - Finished design in 0.52 minutes
成功了,output有10个pdb, 结构各种各样的,但是序列都是GGG。Anyway, 收工~