Skip to content

Repository files navigation

TMol

Rosetta molecular modeling at PyTorch speed.

PyPI version Python versions PyPI downloads CI status Documentation Code coverage License

TMol scores, packs, minimizes, and relaxes all-atom molecular structures as batched PyTorch tensors—on CPU or GPU, with gradients. It provides fast C++/CUDA kernels and modeling primitives for proteins, nucleic acids, ligands, and their complexes.

Explore the TMol documentation for complete installation guidance, executable tutorials, workflows, and the API reference.

Three ways in:

Install

The shortest path is:

pip install tmol

TMol first looks for a matching prebuilt wheel and otherwise builds locally. For a deterministic CPU/GPU binary install, supported Python/PyTorch/CUDA combinations, Colab, macOS, and HPC troubleshooting, see the installation guide and GitHub Releases.

Verify the installation:

python -c "import tmol; print(tmol.__version__)"

Quick start

Score a structure on GPU when CUDA is available, otherwise on CPU:

import torch
import tmol

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
pose = tmol.pose_stack_from_pdb("input.pdb", device)

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

From here, use the interactive examples to pack side chains, analyze score terms, minimize coordinates, run FastRelax, prepare ligands, or model nucleic acids.


What TMol provides

  • Batched, differentiable all-atom structures backed by PyTorch tensors.
  • Rosetta-inspired score terms with CPU and CUDA implementations.
  • Side-chain packing and design, Cartesian and kinematic minimization, and FastRelax.
  • Protein, ligand, RNA, and DNA structure preparation and analysis.
  • RoseTTAFold2, OpenFold, Biotite, PDB, and canonical tensor integrations.
  • Ahead-of-time compiled wheels plus source and just-in-time build paths.

See the task index to jump from a modeling task to its maintained tutorial, workflow, and API.


Development

git clone https://github.com/uw-ipd/tmol.git
cd tmol
TMOL_DISABLE_WHEEL_FETCH=1 pip install -e ".[dev]"

The development guide covers CMake/CUDA builds, tests, benchmarks, containers, CI, and releases.

Citation

If you use TMol in your work, please cite:

Andrew Leaver-Fay, Jeff Flatten, Alex Ford, Joseph Kleinhenz, Henry Solberg, David Baker, Andrew M. Watkins, Brian Kuhlman, Frank DiMaio, tmol: a GPU-accelerated, PyTorch implementation of Rosetta's relax protocol (manuscript in preparation).

TMol is available under the terms in LICENSE.

About

TMol - Rosetta on the GPU

Resources

Stars

91 stars

Watchers

15 watching

Forks

Releases

Packages

Used by

Contributors

Languages