Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a08f3c6
add api docs
hannahbaumann Jan 29, 2026
5c60e83
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
ffe13da
Small fixes
hannahbaumann Jan 29, 2026
c473cfd
Small fixes
hannahbaumann Jan 29, 2026
2f4146e
Merge branch 'api_docs' of https://github.com/OpenFreeEnergy/openfe_a…
hannahbaumann Jan 29, 2026
3b36a89
Update readthedocs
hannahbaumann Jan 29, 2026
af0cbaf
add docs badge to readme
hannahbaumann Jan 29, 2026
05a98b6
Merge branch 'main' into api_docs
hannahbaumann Feb 10, 2026
ece3d15
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 10, 2026
fe75bdd
Remove unnecessary files
hannahbaumann Feb 16, 2026
8850b1c
Update docs/conf.py
hannahbaumann Feb 16, 2026
7b26597
Update docs/conf.py
hannahbaumann Feb 16, 2026
2aee512
Address review comments
hannahbaumann Feb 16, 2026
af740ed
Merge branch 'api_docs' of https://github.com/OpenFreeEnergy/openfe_a…
hannahbaumann Feb 16, 2026
dea7d03
Fix capitalization
hannahbaumann Feb 16, 2026
20f76c0
Merge branch 'main' into api_docs
hannahbaumann Feb 16, 2026
687b401
Merge branch 'main' into api_docs
hannahbaumann Feb 17, 2026
1c5b940
Remove file
hannahbaumann Feb 19, 2026
17bdfe6
Merge branch 'main' into api_docs
hannahbaumann Feb 19, 2026
da804e5
Merge branch 'main' into api_docs
hannahbaumann Feb 25, 2026
070cd36
api docs changes
hannahbaumann Feb 26, 2026
74ea37b
Update docs/environment.yaml
hannahbaumann Feb 27, 2026
f927202
Update docs/conf.py
hannahbaumann Feb 27, 2026
c6ebd59
Update docs/conf.py
hannahbaumann Feb 27, 2026
8cf0e52
Update docs/environment.yaml
hannahbaumann Feb 27, 2026
07db1eb
Update docs/conf.py
hannahbaumann Feb 27, 2026
a58886b
Update docs/environment.yaml
hannahbaumann Feb 27, 2026
6047ac4
Update docs/index.rst
hannahbaumann Feb 27, 2026
d098ec5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2026
27013e1
Fix doc strings
hannahbaumann Mar 2, 2026
c4bcc84
Merge branch 'api_docs' of https://github.com/OpenFreeEnergy/openfe_a…
hannahbaumann Mar 2, 2026
d5eb267
More docs fixes
hannahbaumann Mar 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sphinx:
fail_on_warning: true

conda:
environment: environment.yml
environment: docs/environment.yaml

python:
# Install our python package before building the docs so setuptools-scm generates the version for RTD to find.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Logo](https://img.shields.io/badge/OSMF-OpenFreeEnergy-%23002f4a)](https://openfree.energy/)
[![CI](https://github.com/OpenFreeEnergy/openfe_analysis/actions/workflows/ci.yaml/badge.svg)](https://github.com/OpenFreeEnergy/openfe_analysis/actions/workflows/ci.yaml)
[![Coverage](https://codecov.io/gh/OpenFreeEnergy/openfe_analysis/graph/badge.svg?token=krb231ftki)](https://codecov.io/gh/OpenFreeEnergy/openfe_analysis)
[![documentation](https://readthedocs.org/projects/openfe_analysis/badge/?version=stable)](https://openfe_analysis.openfree.energy/en/stable/?badge=stable)
[![Powered by MDAnalysis](https://img.shields.io/badge/powered%20by-MDAnalysis-orange.svg?logoWidth=16&logo=data:image/x-icon;base64,AAABAAEAEBAAAAEAIAAoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJD+XwCY/fEAkf3uAJf97wGT/a+HfHaoiIWE7n9/f+6Hh4fvgICAjwAAAAAAAAAAAAA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AAAAAB0AAADoAAAA/wAAAP8AAAD/AAAAWgC3/2AAnv3eAJ/+dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9AAAA/wAAAP8AAAD/AAAA/wAKDzEAnP3WAKn//wCS/OgAf/8MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAANwAAADtAAAA7QAAAMAAABUMAJn9gwCe/e0Aj/2LAP//AQAAAAAAAAAA)](https://www.mdanalysis.org)

## Quickstart
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -v -W --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11 changes: 11 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API Documentation
=================

.. autosummary::
:toctree: generated
:recursive:

openfe_analysis.reader
openfe_analysis.transformations
openfe_analysis.rmsd
openfe_analysis.utils
66 changes: 66 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath("../"))


# -- Project information -----------------------------------------------------

project = "openfe analysis"
copyright = "2026, The OpenFE Development Team"
author = "The OpenFE Development Team"

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
]

autoclass_content = "both"

autodoc_default_options = {
"members": True,
"member-order": "bysource",
"undoc-members": True,
}
autosummary_generate = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

autodoc_mock_imports = [
Comment thread
hannahbaumann marked this conversation as resolved.
"MDAnalysis",
]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
9 changes: 9 additions & 0 deletions docs/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: openfe_analysis-docs
channels:
- https://conda.anaconda.org/jaimergp/label/unsupported-cudatoolkit-shim
- https://conda.anaconda.org/conda-forge
dependencies:
- openff-units
- python=3.12
- sphinx
- furo
15 changes: 15 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. template taken from SciPy who took it from Pandas (keep the chain going)

.. module:: openfe_analysis

==========================================
Welcome to OpenFE Analysis' documentation!
==========================================

The **OpenFE Analysis** toolkit provides a free and open-source framework for analyzing alchemical free energy calculations.


.. toctree::
:maxdepth: 2

api
26 changes: 14 additions & 12 deletions src/openfe_analysis/rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import numpy as np
import tqdm
from MDAnalysis.analysis import rms
from MDAnalysis.lib.mdamath import make_whole
from MDAnalysis.transformations import unwrap
from numpy import typing as npt

Expand Down Expand Up @@ -42,20 +41,22 @@ def make_Universe(top: pathlib.Path, trj: nc.Dataset, state: int) -> mda.Univers
Notes
-----
Identifies two AtomGroups:
- protein, defined as having standard amino acid names, then filtered
down to CA
- ligand, defined as resname UNK

- Protein, defined as having standard amino acid names, then filtered down to CA
- Ligand, defined as "resname UNK"

Depending on whether a protein is present, a sequence of trajectory
transformations is applied:

If a protein is present:

- Unwraps protein and ligand atom to be made whole
- Shifts protein chains and the ligand to the image closest to the first
protein chain (:class:`ClosestImageShift`)
- Aligns the entire system to minimise the protein RMSD (:class:`Aligner`)

If only a ligand is present:

- Prevents the ligand from jumping between periodic images
- Aligns the ligand to minimize its RMSD
"""
Expand Down Expand Up @@ -125,16 +126,17 @@ def gather_rms_data(
Notes
-----
For each thermodynamic state (lambda), this function:
- Loads the trajectory using ``FEReader``
- Applies standard PBC-handling and alignment transformations
- Computes protein and ligand structural metrics over time

- Loads the trajectory using ``FEReader``
- Applies standard PBC-handling and alignment transformations
- Computes protein and ligand structural metrics over time

The following analyses are produced per state:
- 1D protein CA RMSD time series
- 1D ligand RMSD time series
- Ligand center-of-mass displacement from its initial position
(``ligand_wander``)
- Flattened 2D protein RMSD matrix (pairwise RMSD between frames)

- 1D protein CA RMSD time series
- 1D ligand RMSD time series
- Ligand center-of-mass displacement from its initial position (``ligand_wander``)
- Flattened 2D protein RMSD matrix (pairwise RMSD between frames)
"""
output = {
"protein_RMSD": [],
Expand Down
3 changes: 1 addition & 2 deletions src/openfe_analysis/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class ClosestImageShift(TransformationBase):
Notes
-----
- Works for any box type (triclinic or orthorhombic).
- Inspired from:
https://github.com/wolberlab/OpenMMDL/blob/main/openmmdl/openmmdl_simulation/scripts/post_md_conversions.py
- Inspired from: https://github.com/wolberlab/OpenMMDL/blob/main/openmmdl/openmmdl_simulation/scripts/post_md_conversions.py
"""

def __init__(self, reference: mda.AtomGroup, targets: list[mda.AtomGroup]):
Expand Down