Skip to content

Commit 7ad8c42

Browse files
Merge pull request #4 from RosettaCommons/documentation
README update and minor environment fix
2 parents 6beb9f1 + a84a6c9 commit 7ad8c42

16 files changed

+222
-716
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
# Contributing to RFDpoly
2+
Thank you for helping RFDpoly grow! Please follow the
3+
guidelines below to ensure the consistency of the code
4+
and documentation quality.
5+
6+
To contribute to RFDpoly - either through code or
7+
documentation contributions - please fork the repository,
8+
make changes, and create a pull request (PR). The pull
9+
request should have `main` as the base branch.
10+
11+
If your PR is a result of an Issue or Discussion, make
12+
sure to mention it in your description.
13+
14+
## Issues vs. Discussions
15+
An issue should be opened if there is an issue with the
16+
code or there is a request for a new feature.
17+
18+
The Discussions section should be used to answer questions
19+
about best practices, usage, etc.
220

321
## Code Contributions
422

23+
### Code Style and Quality
24+
When contributing to the code base, please adhere to the [PEP8 style guide](https://peps.python.org/pep-0008/).
25+
26+
### Tests
27+
Please write tests for any contributed code or append to
28+
existing tests.
29+
30+
Existing tests can be found in `rf_diffusion/test_inference_commands.py`
31+
32+
### Approving and Merging Pull Requests
33+
Currently only the original developers and the Devel Team
34+
at Rosetta Commons can approve and merge pull requests. PRs
35+
will be merged via a merge commit, so all commits from the
36+
feature branch will be added to the base branch.
37+
538
## Documentation Contributions
639

740
To preview the changes you made to the documentation before making a Pull Request you will need to

README.md

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,40 @@ This repository contains the code for the [associated preprint](https://www.bior
1212
publisher={Cold Spring Harbor Laboratory}
1313
}
1414
```
15+
## Documentation
16+
More information and documentation can be found [here](https://rosettacommons.github.io/RFDpoly/).
1517

16-
You can clone this repository using git, then inference can be run when you have downloaded model weights and the necessary apptainer to run (see below).
17-
18-
To download model weights:
19-
* [click here for the best RNA-design weights](https://files.ipd.uw.edu/pub/2025_RFDpoly/train_session2024-07-08_1720455712_BFF_3.00.pt)
20-
* [click here for the best general multi-polymer weights](https://files.ipd.uw.edu/pub/2025_RFDpoly/train_session2024-06-27_1719522052_BFF_7.00.pt)
21-
22-
This software runs using apptainers. To download the associated apptainer `.sif` file, [click here](https://files.ipd.uw.edu/pub/2025_RFDpoly/SE3nv.sif)
23-
Equivalent setup instructions for conda are in progress.
24-
25-
Once you have these files, you can follow the [design tutorial](https://github.com/RosettaCommons/RFDpoly/blob/main/RFDpoly_tutorial.pdf) to see various design tasks and the associated documentation/syntax.
18+
## Installation and setup
2619

27-
Contact [email protected] if you have trouble accessing files or hit any bugs.
20+
### 1. Clone the repository
21+
```bash
22+
git clone [email protected]:RosettaCommons/RFDpoly.git
23+
```
2824

25+
### 2. Set environment variables and create directories
2926

27+
*This section is not necessary for running RFDpoly,
28+
but te example commands below use these environment
29+
variables.*
3030

3131

32+
Set relevant paths for installation and then create the directories the paths point to:
3233

33-
## Installation and setup
34+
```bash
35+
# Feel free to change the exact names of the directories
36+
RFDPOLY_DIR=/path/to/RFDpoly
37+
WEIGHTS_DIR=/path/to/RFDpoly/weights
3438

35-
1. Set relevant paths for installation and navigate to directory for setup (change accordingly given your filesystem and choice of storage location):
36-
```Bash
37-
# Where you choose to install things (CHANGE THESE):
38-
RFDPOLY_DIR=~/git/RFDpoly_paper_version
39-
WEIGHTS_DIR=~/git/RFDpoly_paper_version/weights
40-
ENV_DIR=~/git/RFDpoly_paper_version/exec
41-
42-
# Wherever you want to run some design jobs (ALSO CHANGE THIS):
43-
DESIGN_DIR=~/git/RFDpoly_paper_version/design_jobs
39+
# path for where to put the Apptainer .sif file
40+
ENV_DIR=/path/to/RFDpoly/exec
4441

4542
# Make the directories
4643
mkdir -p $RFDPOLY_DIR
4744
mkdir -p $WEIGHTS_DIR
4845
mkdir -p $ENV_DIR
49-
mkdir -p $DESIGN_DIR
50-
51-
```
52-
53-
2. Navigate to the directory where you want to set up the repo, and clone it:
54-
```Bash
55-
cd $RFDPOLY_DIR
56-
git clone [email protected]:RosettaCommons/RFDpoly.git
57-
5846
```
5947

60-
3. Navigate to the directory where you want to save model weights, download them, and set path variable for weights of your choice:
48+
### 3. Navigate to the directory where you want to save model weights, download them, and set path variable for weights of your choice:
6149
```Bash
6250
# Download model weights:
6351
cd $WEIGHTS_DIR
@@ -68,64 +56,72 @@ curl -O https://files.ipd.uw.edu/pub/2025_RFDpoly/train_session2024-06-27_171952
6856
curl -O https://files.ipd.uw.edu/pub/2025_RFDpoly/train_session2024-07-08_1720455712_BFF_3.00.pt
6957

7058
# Set weights path (replace with your choice of weights):
71-
MODEL_WEIGHTS_PATH=$WEIGHTS_DIR/train_session2024-07-08_1720455712_BFF_3.00.pt
72-
export RFDPOLY_CKPT_PATH="$MODEL_WEIGHTS_PATH"
73-
59+
export RFDPOLY_CKPT_PATH=\$WEIGHTS_DIR/train_session2024-07-08_1720455712_BFF_3.00.pt
7460
```
7561

76-
4. Setting up the environment:
77-
Navigate to the directory where you want to apptainer file, download it, and set path variable:
62+
### 4. Setting up the environment:
63+
Navigate to the directory where you want to [Apptainer](https://apptainer.org/) file, download it, and set path variable:
7864
```Bash
7965
cd $ENV_DIR
8066
curl -O https://files.ipd.uw.edu/pub/2025_RFDpoly/SE3nv.sif
8167
APPTAINER_PATH=$ENV_DIR/SE3nv.sif
82-
8368
```
69+
Downloading the `.sif` file may take several minutes.
70+
71+
You can find alternative installation instructions in the
72+
[external documentation](https://rosettacommons.github.io/RFDpoly/).
73+
74+
## Basic Use Case Example: Testing Your Setup
8475

85-
Equivalent python environments can be set up using conda, or an environment manager of your choice.
86-
All dependencies and packages are specified in the files found in `rf_diffusion/environment` (see `environment.yml` and `SE3nv.spec`)
76+
In this example, RFDpoly will create a single design
77+
with three chains:
78+
1. A DNA chain with 33 segments
79+
2. An RNA chain with 33 segments
80+
3. A protein chain with 75 residues
81+
82+
Make a directory to store the outputs of the demo and store
83+
it in the `DESIGN_DIR` environment variable:
84+
```bash
85+
export DESIGN_DIR=/path/to/your/output/directory
86+
```
8787

88-
## Testing that everything works (the *DEMO*):
89-
Change directory to run from within the RFDpoly directory useful for filepath searches if you are not providing an input pdb), and run example inference script.
90-
Be sure to specify your desired output directory with `$DESIGN_DIR`.
9188
```Bash
9289
cd $DESIGN_DIR/
9390

94-
$APPTAINER_PATH $RFDPOLY_DIR/RFDpoly/rf_diffusion/run_inference.py --config-name=multi_polymer \
91+
apptainer run --nv $APPTAINER_PATH $RFDPOLY_DIR/rf_diffusion/run_inference.py --config-name=multi_polymer \
9592
diffuser.T=50 \
96-
inference.ckpt_path=$MODEL_WEIGHTS_PATH \
93+
inference.ckpt_path=$RFDPOLY_CKPT_PATH \
9794
inference.num_designs=1 \
9895
contigmap.contigs=[\'33\ 33\ 75\'] \
9996
contigmap.polymer_chains=[\'dna\',\'rna\',\'protein\'] \
10097
inference.output_prefix=$DESIGN_DIR/test_outputs/basic_uncond_test01
101-
10298
```
10399
The initial run will take a little while to precompute the IGSO3 cache, but subsequent runs will be more direct and quick.
104100

105101

106102
if that throws errors, then try:
107-
```
108-
$APPTAINER_PATH $RFDPOLY_DIR/RFDpoly/rf_diffusion/run_inference.py --config-name=multi_polymer \
103+
```bash
104+
cd $DESIGN_DIR
105+
106+
apptainer run --nv $APPTAINER_PATH $RFDPOLY_DIR/rf_diffusion/run_inference.py --config-name=multi_polymer \
109107
diffuser.T=50 \
110-
inference.ckpt_path=$MODEL_WEIGHTS_PATH \
111-
inference.input_pdb=$RFDPOLY_DIR/RFDpoly/rf_diffusion/test_data/DBP035.pdb \
112-
inference.num_designs=3 \
108+
inference.ckpt_path=$RFDPOLY_CKPT_PATH \
109+
inference.input_pdb=$RFDPOLY_DIR/rf_diffusion/test_data/DBP035.pdb \
110+
inference.num_designs=1 \
113111
contigmap.contigs=[\'33\ 33\ 75\'] \
114112
contigmap.polymer_chains=[\'dna\',\'rna\',\'protein\'] \
115113
inference.output_prefix=$DESIGN_DIR/test_outputs/basic_uncond_test01
116-
117-
118114
```
115+
119116
explanation: model initialization searches for an input pdb filepath, even if you aren't performing motif scaffolding. Providing a (real) dummy filepath will fix this is the default search paths are unsuccessful.
120117

121-
**Expected output:** a three chain .pdb file, containing a complex of DNA (chain A), RNA (chain B), and protein (chain C).
122118
**NOTE:** using the `--config-name=multi_polymer` specification is the best way to ensure that all settings work together as expected, and are consistent with the behavior reported in the manuscript.
123119

124120
## If the example (demo) command above works, proceed to exploration of the full [design tutorial](https://github.com/RosettaCommons/RFDpoly/blob/main/RFDpoly_tutorial.pdf).
125121
The full design tutorial contains many inference commands for the types of designs reported in the RFDpoly paper.
126-
The design tutorial also is intented to provide documentation, and explain arguments in the context of their use-cases.
127-
122+
The design tutorial is intended to provide documentation, and explain arguments in the context of their use-cases.
128123

124+
Contact **[email protected]** if you have trouble accessing files or hit any bugs.
129125

130126
# Additional Software Policy checklist items:
131127
## System requirements
@@ -134,10 +130,8 @@ The design tutorial also is intented to provide documentation, and explain argum
134130
- Primary workflow: Linux host with [Apptainer](https://apptainer.org/) ≥ 1.1 (or Singularity equivalent). The bundled container image runs Ubuntu 22.04.2 LTS.
135131
- Alternative workflow: macOS 13+/Windows 11 via Conda (CPU only unless you install CUDA-capable PyTorch wheels).
136132
- **Software dependencies**
137-
- Apptainer runtime to execute `SE3nv.sif`.
138133
- For native/Conda installs: Python 3.10, PyTorch 1.13.1, CUDA 11.7 toolchain (if using an NVIDIA GPU), PyRosetta 2023.09+, DGL 1.0.1, e3nn 0.5.1, hydra-core 1.3.2, and the packages listed in `rf_diffusion/environment/environment.yml`.
139134
- **NOTE:** All dependencies are specified in `rf_diffusion/environment/`, such that users can set up an equivalent working environment on any operating system.
140-
- Downloaded assets: model checkpoints (`*.pt`, ~2.3 GB each) and the container image (`SE3nv.sif`, ~8 GB).
141135
- **Tested configurations**
142136
- Ubuntu 22.04 host with Apptainer 1.1.9, NVIDIA driver ≥ 515, CUDA 11.7 runtime.
143137
- PyTorch 1.13.1+cu117, Python 3.10.8, PyRosetta 2023.09 inside the container.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
html_theme_options = {
3434
"sidebar_hide_name":False,
35-
"announcement": "<em>THIS DOCUMENTATION IS CURRENTLY UNDER CONSTRUCTION</em>",
35+
#"announcement": "<em>THIS DOCUMENTATION IS CURRENTLY UNDER CONSTRUCTION</em>",
3636
"light_css_variables": {
3737
"color-brand-primary": "#F68A33", # Rosetta Teal
3838
"color-brand-content": "#37939B", # Rosetta Orange

docs/source/contributing_link.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONTRIBUTING to RFDpoly
2+
=======================
3+
4+
.. include:: ../../CONTRIBUTING.md
5+
:parser: myst_parser.sphinx_

docs/source/index.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
RFDpoly documentation
77
=====================
88

9-
Add your content using ``reStructuredText`` syntax. See the
10-
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11-
documentation for details.
9+
.. include:: readme_link.rst
1210

1311

1412
.. toctree::
15-
:maxdepth: 2
13+
:titlesonly:
1614
:caption: Contents:
1715

16+
readme_link.rst<self>
17+
license_link.rst
18+
contributing_link.rst
19+
installation_guide.md
20+

docs/source/installation_guide.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Installation Guide
2+
3+
## Using the Apptainer Image
4+
If possible, we highly recommend using the provided apptainer image which can be obtained via:
5+
```bash
6+
curl -O https://files.ipd.uw.edu/pub/2025_RFDpoly/SE3nv.sif
7+
```
8+
9+
Here is an example for how to use this image to run RFDpoly:
10+
```bash
11+
apptainer run --nv /path/to/SE3nv.sif /path/to/RFDpoly/rf_diffusion/run_inference.py --config-name=multi_polymer \
12+
diffuser.T=50 \
13+
inference.ckpt_path=/path/to/train_session2024-07-08_1720455712_BFF_3.00.pt \
14+
inference.num_designs=1 \
15+
contigmap.contigs=[\'33\ 33\ 75\'] \
16+
contigmap.polymer_chains=[\'dna\',\'rna\',\'protein\'] \
17+
inference.output_prefix=/path/to/your/output/directory/basic_uncond_test01
18+
```
19+
20+
If you see an error when attempting to run this related to
21+
a lack of an input file, try adding this option:
22+
```bash
23+
inference.input_pdb=/path/to/RFDpoly/rf_diffusion/test_data/DBP035.pdb
24+
```
25+
26+
## Creating a Conda Environment
27+
28+
### Linux:
29+
If the apptainer image is not compatible with your system
30+
or you are doing development with RFDpoly, you can create
31+
a [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) or [mamba](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html) environment with a provided `environment.yml` file:
32+
33+
```bash
34+
conda env create -f /path/to/RFDpoly/rf_diffusion/environment/environment.yml
35+
conda activate RFDpoly_env
36+
pip install /path/to/RFDpoly/rf_diffusion/RF2-allatom/rf2aa/SE3Transformer
37+
```
38+
The last command installs a slightly modified version of
39+
se3-transformer. If installing this package does not work,
40+
you can try installing [`se3-transformer-pytorch`](https://pypi.org/project/se3-transformer-pytorch/) instead,
41+
but we do not guarantee that your results will be exactly
42+
the same.
43+
44+
You can test your installation by running:
45+
```bash
46+
python /path/to/RFDpoly/rf_diffusion/run_inference.py \
47+
--config-name=multi_polymer \
48+
diffuser.T=50 \
49+
inference.ckpt_path=/path/to/RFDpoly/weights/train_session2024-07-08_1720455712_BFF_3.00.pt \
50+
inference.num_designs=1 \
51+
contigmap.contigs=[\'33\ 33\ 75\'] \
52+
contigmap.polymer_chains=[\'dna\',\'rna\',\'protein\'] \
53+
inference.output_prefix=./basic_uncond_test01
54+
```
55+
56+
If using the `environment.yml` file does not work, please
57+
create an issue. Or, if you modified the `.yml` file to
58+
work for your system, make a pull request to add it to
59+
the `rf_diffusion/environment` folder.
60+
61+
### MacOS
62+
If the apptainer image is not compatible with your system
63+
or you are doing development with RFDpoly, you can create
64+
a [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) or [mamba](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html) environment with a provided `macos_environment.yml` file:
65+
66+
```bash
67+
conda env create -f /path/to/RFDpoly/rf_diffusion/environment/macos_environment.yml
68+
conda activate RFDpoly_env
69+
pip install /path/to/RFDpoly/rf_diffusion/RF2-allatom/rf2aa/SE3Transformer
70+
```
71+
The last command installs a slightly modified version of
72+
se3-transformer. If installing this package does not work,
73+
you can try installing [`se3-transformer-pytorch`](https://pypi.org/project/se3-transformer-pytorch/) instead,
74+
but we do not guarantee that your results will be exactly
75+
the same.
76+
77+
You can test your installation by running:
78+
```bash
79+
python /path/to/RFDpoly/rf_diffusion/run_inference.py \
80+
--config-name=multi_polymer \
81+
diffuser.T=50 \
82+
inference.ckpt_path=/path/to/RFDpoly/weights/train_session2024-07-08_1720455712_BFF_3.00.pt \
83+
inference.num_designs=1 \
84+
contigmap.contigs=[\'33\ 33\ 75\'] \
85+
contigmap.polymer_chains=[\'dna\',\'rna\',\'protein\'] \
86+
inference.output_prefix=./basic_uncond_test01
87+
```
88+
89+
If using the `macos_environment.yml` file does not work,
90+
please create an issue. Or, if you modified the `.yml` file
91+
to work for your system, make a pull request to add it to
92+
the `rf_diffusion/environment` folder.

docs/source/license_link.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LICENSE
2+
=======
3+
4+
.. include:: ../../LICENSE.md
5+
:parser: myst_parser.sphinx_

docs/source/readme_link.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
README
2+
======
3+
4+
.. include:: ../../README.md
5+
:parser: myst_parser.sphinx_
6+

0 commit comments

Comments
 (0)