Metadata-Version: 2.1
Name: tmol
Version: 0.3.0
Summary: GPU-accelerated PyTorch reimplementation of the Rosetta energy function
Author-Email: Institute for Protein Design <contact@ipd.uw.edu>
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Project-URL: Documentation, https://rosettacommons.github.io/tmol/
Project-URL: Issues, https://github.com/RosettaCommons/tmol/issues
Project-URL: Repository, https://github.com/RosettaCommons/tmol
Project-URL: Releases, https://github.com/RosettaCommons/tmol/releases
Requires-Python: >=3.11
Requires-Dist: torch>=2.11
Requires-Dist: numpy>=1.25
Requires-Dist: scipy>=1.13.1
Requires-Dist: attrs>=21.0
Requires-Dist: cattrs>=22.0
Requires-Dist: frozendict>=2.4
Requires-Dist: pandas>=2.2
Requires-Dist: pyyaml>=6.0
Requires-Dist: networkx>=3.0
Requires-Dist: toolz>=0.12.0
Requires-Dist: decorator>=4.0
Requires-Dist: typing_inspect>=0.9
Requires-Dist: pint>=0.23
Requires-Dist: requests>=2.33
Requires-Dist: numba>=0.56
Requires-Dist: astor>=0.8
Requires-Dist: biotite==1.6.0
Requires-Dist: atomworks>=3.0.0
Requires-Dist: rdkit>=2024.3.5
Provides-Extra: cu12
Requires-Dist: tmol-ops-cu12==0.3.0; extra == "cu12"
Provides-Extra: cu13
Requires-Dist: tmol-ops-cu13==0.3.0; extra == "cu13"
Provides-Extra: ligand
Requires-Dist: openbabel-wheel>=3.1.1.23; extra == "ligand"
Provides-Extra: dev
Requires-Dist: tmol[ligand]; extra == "dev"
Requires-Dist: black==26.10.1; extra == "dev"
Requires-Dist: flake8==7.4.1; extra == "dev"
Requires-Dist: pre-commit>=4.0; extra == "dev"
Requires-Dist: clang-format==23.1.2; extra == "dev"
Requires-Dist: hypothesis>=5.35; extra == "dev"
Requires-Dist: psutil>=5.9; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: pytest-benchmark>=5.3.1; extra == "dev"
Requires-Dist: pytest-forked>=1.6; extra == "dev"
Requires-Dist: pytest-instafail>=0.5; extra == "dev"
Requires-Dist: pytest-repeat>=0.9; extra == "dev"
Requires-Dist: pytest-watch>=4.2; extra == "dev"
Requires-Dist: pytest-xdist>=3.6; extra == "dev"
Requires-Dist: ipython>=8.0; extra == "dev"
Requires-Dist: seaborn>=0.13; extra == "dev"
Provides-Extra: cuda
Requires-Dist: nvidia-cuda-nvcc>=13; extra == "cuda"
Requires-Dist: nvidia-cuda-cccl>=13; extra == "cuda"
Provides-Extra: docs
Requires-Dist: tmol[ligand]; extra == "docs"
Requires-Dist: sphinx<10,>=8.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme<1,>=0.16; extra == "docs"
Requires-Dist: myst-parser<6,>=4.0; extra == "docs"
Requires-Dist: nbsphinx<1,>=0.9; extra == "docs"
Requires-Dist: sphinx-togglebutton<1,>=0.3; extra == "docs"
Requires-Dist: matplotlib<4,>=3.8; extra == "docs"
Requires-Dist: pypandoc-binary<2,>=1.15; extra == "docs"
Requires-Dist: linkify-it-py<3,>=2.0; extra == "docs"
Requires-Dist: ipython>=8.0; extra == "docs"
Requires-Dist: py3Dmol<3,>=2.4; extra == "docs"
Requires-Dist: itables>=2.0; extra == "docs"
Requires-Dist: nbclient<1,>=0.10; extra == "docs"
Requires-Dist: nbformat<6,>=5.10; extra == "docs"
Requires-Dist: ipykernel<8,>=6.29; extra == "docs"
Description-Content-Type: text/markdown

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RosettaCommons/tmol/master/docs/_static/brand/tmol-logo-dark.svg">
    <img src="https://raw.githubusercontent.com/RosettaCommons/tmol/master/docs/_static/brand/tmol-logo-light.svg" alt="TMol" width="440">
  </picture>
</p>

<p align="center">
  <a href="https://pypi.org/project/tmol/"><img src="https://img.shields.io/pypi/v/tmol.svg" alt="PyPI version"></a>
  <a href="https://pypi.org/project/tmol/"><img src="https://img.shields.io/pypi/pyversions/tmol.svg" alt="Python versions"></a>
  <a href="https://pypi.org/project/tmol/"><img src="https://img.shields.io/pypi/dm/tmol.svg" alt="PyPI downloads"></a>
  <a href="https://github.com/RosettaCommons/tmol/actions/workflows/ci.yml"><img src="https://github.com/RosettaCommons/tmol/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
  <a href="https://rosettacommons.github.io/tmol/"><img src="https://github.com/RosettaCommons/tmol/actions/workflows/docs.yml/badge.svg" alt="Documentation"></a>
  <a href="https://codecov.io/gh/RosettaCommons/tmol"><img src="https://codecov.io/gh/RosettaCommons/tmol/graph/badge.svg" alt="Code coverage"></a>
  <a href="https://github.com/RosettaCommons/tmol/blob/master/LICENSE"><img src="https://img.shields.io/github/license/RosettaCommons/tmol.svg" alt="License"></a>
</p>

TMol provides all-atom scoring, packing, minimization, and
FastRelax in PyTorch. It batches proteins, nucleic acids, ligands, and complexes
on CPU or CUDA, with gradients through coordinate scoring. On Apple silicon,
CPU runs move their heaviest work onto the GPU automatically.

[Documentation](https://rosettacommons.github.io/tmol/) ·
[Tutorials](https://rosettacommons.github.io/tmol/latest/examples_index.html) ·
[API reference](https://rosettacommons.github.io/tmol/latest/api_reference.html)

## Install

Install from PyPI. For GPU use, first install [PyTorch](https://pytorch.org/get-started/locally/)
with the matching CUDA major, then choose one command:

```bash
python -m pip install tmol          # CPU, including Apple Silicon
python -m pip install "tmol[cu12]"   # CUDA 12-enabled PyTorch
python -m pip install "tmol[cu13]"   # CUDA 13-enabled PyTorch
```

The base package contains the Python API, data, and CPU kernels. GPU extras add
`tmol-ops-cu12` or `tmol-ops-cu13` at the same version. GPU use also needs a
compatible NVIDIA driver; pip does not detect GPUs or select a PyTorch CUDA build.
The [installation guide](https://rosettacommons.github.io/tmol/latest/installation.html)
covers requirements, verification, upgrades, and source builds. TMol wheels work
across supported PyTorch minor versions; no per-Torch wheel selection is needed.

```python
import torch, tmol
print(tmol.__version__, tmol.has_cuda(), torch.cuda.is_available())
```

## Quick start

Score a structure on CPU. With matching CUDA-enabled PyTorch and TMol operators,
use `torch.device("cuda")`:

```python
import torch
import tmol

device = torch.device("cpu")
pose = tmol.pose_stack_from_file("input.pdb", device)

score_function = tmol.beta2016_score_function(device)
score = score_function.render_whole_pose_scoring_module(pose)
print(score(pose.coords))
```

See the [quickstart](https://rosettacommons.github.io/tmol/latest/quickstart.html) for
scoring, minimization, repacking, FastRelax, batching, and ligand preparation.
The [visual glossary](https://rosettacommons.github.io/tmol/latest/terminology.html) explains
the concepts, and the [score playground](https://rosettacommons.github.io/tmol/latest/playground.html)
lets you rotate a side chain and inspect TMol scores in the browser. The
[tutorials](https://rosettacommons.github.io/tmol/latest/examples_index.html) are
runnable notebooks, each also available in Colab.

## Development

```bash
git clone https://github.com/RosettaCommons/tmol.git
cd tmol
python -m pip install "torch>=2.14" "scikit-build-core>=0.10" "cmake>=3.24,<4" "pybind11>=2.12" ninja packaging
python -m pip install --no-build-isolation -e ".[dev]"
```

The [development guide](https://rosettacommons.github.io/tmol/latest/user_guide/development.html)
covers builds, tests, benchmarks, and releases. See the
[contributor guide](https://rosettacommons.github.io/tmol/latest/contributor_guide.html)
for code and documentation conventions, or [agent skills](https://github.com/RosettaCommons/tmol/blob/master/skills/README.md)
for reusable coding-agent instructions.

## Citation

If you use TMol in your work, please cite:

> Andrew Leaver-Fay\*, Kieran Didi\*, Jeff Flatten\*, Alex Ford, Guangfeng Zhou,
> Nathaniel Corley, Hahnbeom Park, Maxwell W. Kazman, Rafael I. Brent,
> Joseph Kleinhenz, Henry Solberg, Andrew M. Watkins, Brian Kuhlman, David Baker,
> Frank DiMaio, *tmol: a GPU-accelerated implementation of the Rosetta energy
> function for machine learning*
> (manuscript in preparation).

\* Core contributor.

TMol is available under the terms in [LICENSE](https://github.com/RosettaCommons/tmol/blob/master/LICENSE).
