Skip to content

Commit ec0942f

Browse files
authored
Merge pull request #53 from RosettaCommons/docs
- Updated README with corrected documentation links and quick start instructions - Removed no longer relevant portions of the installation guide - Updated the contributors guide with more detailed code and documentation contribution instructions.
2 parents 7f9b22c + ea91731 commit ec0942f

3 files changed

Lines changed: 85 additions & 51 deletions

File tree

README.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
22
[![PyPI version](https://img.shields.io/pypi/v/atomworks.svg)](https://pypi.org/project/atomworks/)
33
[![Python versions](https://img.shields.io/pypi/pyversions/atomworks.svg)](https://pypi.org/project/atomworks/)
4-
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://baker-laboratory.github.io/atomworks-dev/latest/index.html)
4+
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://rosettacommons.github.io/atomworks/latest/)
55
[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
66

77
<div align="center">
@@ -57,54 +57,64 @@ We have found that `atomworks.ml` **dramatically** reduces the overhead of start
5757

5858
---
5959

60+
## When to use `atomworks.io` vs `atomworks.ml`?
61+
62+
- Use `atomworks.io` when you:
63+
- Need to parse/clean/convert between biological file formats (mmCIF, PDB, FASTA, etc.)
64+
- Want a unified structural representation to plug into any downstream analysis or modeling
65+
- Need structural operations like adding missing atoms, filtering ligands/solvents, or assembly generation
66+
67+
- Use `atomworks.ml` when you:
68+
- Need to featurize entire datasets for deep learning
69+
- Want ready-made sampling and batching utilities for training pipelines
70+
- Already use `atomworks.io` and want a seamless bridge to ML-ready feature engineering
71+
72+
---
73+
6074
## Installation
75+
> Note: AtomWorks requires Python >= 3.11 and [`dotenv`](https://pypi.org/project/python-dotenv/#file-format)
6176
6277
```shell
6378
pip install atomworks # base installation version without torch (for only atomworks.io)
6479
pip install "atomworks[ml]" # with torch and ML dependencies (for atomworks.io plus atomworks.ml)
6580
pip install "atomworks[dev]" # with development dependencies
66-
pip install "atomworks[ml,dev]" # with all dependencies
81+
pip install "atomworks[openbabel]" # with [Open Babel](https://openbabel.org/) and its dependencies
82+
pip install "atomworks[ml,openbabel,dev]" # with all dependencies
6783
```
84+
*Running multiple of these installations will just add to the installed dependencies and will not install multiple installations of atomworks.*
6885

6986
If you are using [uv](https://docs.astral.sh/uv/reference/policies/versioning/) for package management, you can install atomworks with:
7087

7188
```shell
7289
uv pip install "atomworks[ml,openbabel,dev]"
7390
```
7491

75-
For more advanced setup options (including how to run workflows via apptainers) see the [full documentation](https://baker-laboratory.github.io/atomworks-dev/latest).
92+
For more advanced setup options (including how to run workflows via apptainers) see the [full documentation](https://rosettacommons.github.io/atomworks/latest/index.html).
7693

7794
---
7895

7996
## Getting started
8097

81-
### 1. When to use `atomworks.io` vs `atomworks.ml`?
98+
This section contains information for how to get atomworks set up and a quick guide for using some of the features of atomworks.io to parse PDB files. To learn more about the features in atomworks.io and atomworks.ml, see the [external documentation](https://rosettacommons.github.io/atomworks/latest/).
8299

83-
- Use `atomworks.io` when you:
84-
- Need to parse/clean/convert between biological file formats (mmCIF, PDB, FASTA, etc.)
85-
- Want a unified structural representation to plug into any downstream analysis or modeling
86-
- Need structural operations like adding missing atoms, filtering ligands/solvents, or assembly generation
87-
88-
- Use `atomworks.ml` when you:
89-
- Need to featurize entire datasets for deep learning
90-
- Want ready-made sampling and batching utilities for training pipelines
91-
- Already use `atomworks.io` and want a seamless bridge to ML-ready feature engineering
92-
93-
### 2. Quick Start
100+
### 1. Quick Start
94101

95102
To parse a pdb file (parse = load, clean, annotate relevant metadata such as entities, molecules, etc) you can use the `parse` function:
96103

104+
> Note: To run the code in this section you will need to download the 3nez.cif.gz file yourself. See the [examples](https://rosettacommons.github.io/atomworks/latest/auto_examples/index.html) for how to download files from the PDB within a Python script.
105+
97106
```python
98107

99108
from atomworks.io.parser import parse
109+
from biotite.structure import AtomArrayStack
100110

101111
result = parse(filename="3nez.cif.gz")
102112

103113
asym_unit: AtomArrayStack = result["asym_unit"]
104114
assemblies: dict[str, AtomArrayStack] = result["assemblies"]
105115

106116
for chain_id, info in result["chain_info"].items():
107-
print(chain_id, info["sequence"])
117+
print(chain_id, info["processed_entity_canonical_sequence"])
108118

109119
```
110120

@@ -116,17 +126,19 @@ The output of `parse` includes:
116126
- **assemblies** — Built biological assemblies (each are their own `AtomArrayStack`)
117127
- **metadata** — Experimental and source information
118128

119-
See [usage examples](https://baker-laboratory.github.io/atomworks-dev/latest/auto_examples/) for more details.
129+
See [usage examples](https://rosettacommons.github.io/atomworks/latest/auto_examples/index.html) for more examples of the use of `parse()`. All of the provided examples make use of this method.
130+
See [API reference documentation](https://rosettacommons.github.io/atomworks/latest/io/parser.html) for more information on this method.
120131

121132
If you just want to load a file, you can use the `load_any` function:
122133

123134
```python
124135
from atomworks.io.utils.io_utils import load_any
136+
from biotite.structure import AtomArray
125137

126138
atom_array: AtomArray = load_any("3nez.cif.gz", model=1) # model=1 means that we want to load the model 1 (i.e. the first model) rather than a stack of all models in the file
127139
```
128140

129-
### 3. Training on the PDB
141+
### 2. Training on the PDB
130142

131143
> ⚠️ **Disclaimer:** Documentation for this section is currently under construction. Please check back soon for updates!
132144
@@ -172,7 +184,7 @@ Next we need to use the metadata to configure a dataset that we would like to sa
172184
Here's a simple example that:
173185

174186
- Filters to D-polypeptide and L-polypeptide chains only (`POLYPEPTIDE_D` and `POLYPEPTIDE_L` -- to include additional chain types, replace the lists with the appropriate IDs (see [mapping](./src/atomworks/enums.py#L31-L45) in comments).
175-
- Excludes ligands in the AF3 list of excluded ligands, available at [`atomworks.io.constants.AF3_EXCLUDED_LIGANDS_REGEX`](./src/atomworks/io/constants.py#L350).
187+
- Excludes ligands in the AF3 list of excluded ligands, available at [`atomworks.io.constants.AF3_EXCLUDED_LIGANDS_REGEX`](./src/atomworks/constants.py#L350).
176188

177189
```yaml
178190
# NOTE: The below is a hydra config and the _target_ fields are the hydra syntax for instantiating a class.
@@ -281,8 +293,10 @@ Or alternatively not use MSAs.
281293
**Step 5 — Train a model**
282294
You now have a full fledged dataset that you can use to train models on! If you want to just try this out without having to download the whole PDB and the metdatada, you can instead run our tests which have a mini-mockup of the pipeline with real pdb files, metadata, distillation data, templates and MSAs for the example of AF3. You can download all this relevant metadata via the atomworks CLI:
283295
296+
> Note: Make sure you are in the AtomWorks root directory when you run the following command, otherwise a new tests/data folder will be created in your current working directory.
297+
284298
```bash
285-
atomworks setup tests # This will download the test pack to `tests/data` and unpack it there (~500 MB)
299+
atomworks setup tests # This will download the test pack to `tests/data` and unpack it there (~500 MB).
286300
```
287301

288302
You will now have a mini PDB at `tests/data/pdb` and a mini custom CCD at `tests/data/ccd`. MSA and template data is in `tests/data/shared` and the distillation and metadata are in `data/ml/af2_distillation`, `data/ml/pdb_pn_units` and `data/ml/pdb_interfaces`. A dataset that uses all of these is [for example here](./tests/ml/conftest.py#L300).
@@ -291,15 +305,15 @@ To run the tests for the various datasets, you can run the following command:
291305

292306
```bash
293307
# Make sure you have the correct environment activated, and set your paths correctly in the .env file / shell environment variables (see points above)
294-
pytest tests/ml/test_data_loading_pipelines.py
308+
pytest tests/ml/pipelines/test_data_loading_pipelines.py
295309
```
296310

297311
---
298312

299313
## Contribution
300314

301315
We welcome improvements!
302-
Please see the [full documentation](https://baker-laboratory.github.io/atomworks-dev/latest/index.html) for contribution guidelines.
316+
Please see the [contributors guide in the full documentation](https://rosettacommons.github.io/atomworks/latest/contributor_guide.html) for contribution guidelines.
303317

304318
## Citation
305319

docs/contributor_guide.rst

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,30 @@ As you code
1212

1313
1. **Reduce cognitive overhead:**
1414
a. Pick meaningful, descriptive variable names.
15-
b. Write docstrings (leverage AI!) and comments.
15+
b. Write docstrings (leverage AI!) and comments. To be used in the API documentation the docstring should
16+
follow the Google style guide: `Google Python Style Guide <https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings>`_.
1617
c. Follow the `Python Zen <https://peps.python.org/pep-0020/>`_ – explicit is better than implicit, etc.
1718
2. **Write tests.**
1819

1920
As you commit
2021
---------------
2122

22-
1. Keep commits as "one logical unit". (Easy to do in VSCode)
23-
2. Adhere to `semantic commit conventions <https://www.conventionalcommits.org/en/v1.0.0/>`_.
24-
3. Format & lint your code (``make format``).
25-
4. Submit a draft PR so people know you are working on this & can provide advice/feedback early on.
23+
1. Keep commits as "one logical unit". This means that each commit should be a set of related changes
24+
that accomplish one task, fix one bug, or implement one feature. Using an editor like `VS Code <https://code.visualstudio.com/docs/sourcecontrol/overview>`_
25+
or using `GitHub Desktop <https://docs.github.com/en/desktop>`_ can help you stage related changes together.
26+
27+
2. Adhere to `semantic commit conventions <https://www.conventionalcommits.org/en/v1.0.0/>`_.
28+
29+
3. Format & lint your code (``make format``).
30+
31+
4. Submit a draft PR so people know you are working on this & can provide advice/feedback early on.
2632

2733
As you finalize a PR
2834
---------------------
2935

30-
1. Keep overall PR under <400 LOC (Rule of thumb: 500 LOC takes about 1h to review).
31-
2. Read and fill out the PR checklist.
36+
1. To make a PR merge your branch to **staging**. The maintainers will regularly merge staging into production.
37+
2. Keep overall PR under <400 LOC (lines of code) (Rule of thumb: 500 LOC takes about 1h to review).
38+
3. Read and fill out the `PR checklist <https://github.com/RosettaCommons/atomworks/blob/production/.github/pull_request_template.md>`_.
3239

3340
As you review
3441
---------------
@@ -37,6 +44,25 @@ As you review
3744
2. Practice light-weight code reviews. Submit something small to atomworks.io/atomworks.ml that fixes a bug / improves documentation / adds a tiny feature to practice this within the next 24h. (Can be less than 30min)
3845
3. Keep review time <1h and <500 LOC for focus.
3946

47+
Contributing to the documentation
48+
--------------------------------
49+
The external AtomWorks documentation is built using `Sphinx <https://www.sphinx-doc.org/en/master/#>`_ and hosted on `GitHub Pages <https://docs.github.com/en/pages>`_.
50+
Aside from having AtomWorks and its dependencies installed, to build the documentation locally, you will need to install the documentation requirements:
51+
52+
.. code-block:: bash
53+
54+
uv pip install -r docs/docs_requirements.txt
55+
56+
To build the documentation, navigate to the ``docs`` directory and run:
57+
58+
.. code-block:: bash
59+
60+
make html
61+
62+
If you are new to Sphinx, please refer to the `Sphinx documentation <https://www.sphinx-doc.org/en/master/>`_ for guidance on writing and formatting documentation.
63+
All of the documentation is written in reStructuredText (reST) format. For more information on reST, see the `reStructuredText Primer <https://docutils.sourceforge.io/docs/user/rst/quickstart.html>`_.
64+
65+
4066
Visual Aids
4167
-----------
4268

@@ -64,15 +90,15 @@ PR Hygiene
6490
When contributing to this repository, please follow these steps:
6591

6692
1. Clone the repository
67-
2. Create the development environment (see Installation section)
93+
2. Create the development environment (see the :ref:`Local Conda Environment<local-conda_environment>` section in the Installation Guide).
6894
3. Create a new branch for your changes.
69-
- Use the following convention to name your branch: `<category>/<description>`. Categories: `feat`, `fix`, `hotfix`, `refactor`, `docs`, `perf`.
70-
- Example: `feat/support-rdkit-small-molecule`
95+
- Use the following convention to name your branch: ``<category>/<description>``. Categories: ``feat``, ``fix``, ``hotfix``, ``refactor``, ``docs``, ``perf``.
96+
- Example: ``feat/support-rdkit-small-molecule``
7197
4. Make and commit your changes on your new branch.
72-
- Run autoformatting tools (`make format`) before committing.
73-
- Use commit messages like `<type>: <description>`. Types: `feat`, `fix`, `refactor`, `docs`, `chore`, `wip`.
74-
- Example: `git commit -m "docs: add contributing guidelines"`
75-
5. Open a pull request to `main` and describe your changes.
98+
- Run autoformatting tools (``make format``) before committing.
99+
- Use commit messages like ``<type>: <description>``. Types: ``feat``, ``fix``, ``refactor``, ``docs``, ``chore``, ``wip``.
100+
- Example: ``git commit -m "docs: add contributing guidelines"``
101+
5. Open a pull request to ``staging`` and describe your changes.
76102
6. Wait for review and merge your changes.
77103

78104
For more details, see the README or contact the maintainers.

docs/installation.rst

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ This is the easiest way to get started with atomworks.
1414
pip install "atomworks[dev]" # with development dependencies
1515
pip install "atomworks[ml,dev]" # with all dependencies
1616
17+
You can also install AtomWorks with `Open Babel <https://openbabel.org/>`_, an alternative to RDKit:
1718

18-
2. Using the Standalone Apptainer
19-
-----------------------------------------------
20-
This is ideal for dataset parsing and generation in a controlled environment.
19+
.. code-block:: bash
20+
21+
pip install "atomworks[openbabel]"
22+
23+
or for all possible dependencies:
2124

2225
.. code-block:: bash
2326
24-
# Set up IPD-specific environment variables
25-
source ./.ipd/setup.sh
26-
# Use the provided apptainer image
27-
./.ipd/atomworks.sif
27+
pip install "atomworks[ml,openbabel,dev]"
28+
29+
Open Babel is not automatically installed with AtomWorks due to its larger size and additional dependencies, only install it if you plan to use it.
2830

2931
2. Local Conda Environment
3032
--------------------------
@@ -58,11 +60,3 @@ Add `atomworks.io/src` to your apptainer's PYTHONPATH:
5860
.. code-block:: bash
5961
6062
export PYTHONPATH=$PWD/src:$PYTHONPATH
61-
62-
Or, if at IPD:
63-
64-
.. code-block:: bash
65-
66-
source ./.ipd/setup.sh
67-
68-
For new apptainers, see the apptainer.spec file for integration details.

0 commit comments

Comments
 (0)