Skip to main content

teddyMPNN

A fine-tuned ProteinMPNN for improved protein-protein interface sequence design.

teddyMPNN fine-tunes ProteinMPNN on the teddymer dataset of predicted protein dimers with an interface-weighted cross-entropy loss. The result is a drop-in ProteinMPNN replacement that picks better residues at interfaces for tasks like affinity maturation and interface redesign.

Installation

Install the latest release from PyPI:

pip install teddympnn

The ProteinMPNN base weights ship inside the package, so inference and fine-tuning work immediately — no separate download step is required.

For data-download extras (aiohttp, zstandard) add data; for training monitoring (wandb) add train:

pip install "teddympnn[data,train]"

From source (development)

git clone https://github.com/briney/teddympnn.git
cd teddympnn
pip install -e ".[dev]"

The editable install is required before running pytest, ty, or the teddympnn CLI from a checkout — the test suite imports the installed teddympnn package, not the src/ directory.

Quick Start

Score a structure

python -m teddympnn score \
    --checkpoint weights/step_0300000.pt \
    --pdb structure.pdb \
    --chains A \
    --num-samples 10

Evaluate interface sequence recovery

python -m teddympnn evaluate recovery \
    --checkpoint weights/step_0300000.pt \
    --data data/manifests/val_manifest.tsv

Evaluate binding affinity on SKEMPI v2.0

python -m teddympnn evaluate ddg \
    --checkpoint weights/step_0300000.pt \
    --skempi data/skempi \
    --num-samples 20

Pretrained base weights

The ProteinMPNN base checkpoint (proteinmpnn_v_48_020.pt, 48-neighbor, 0.20 Å noise) is bundled with the package and used as the default fine-tuning starting point. After pip install it is available immediately — no separate download step is required.

The bundled file is redistributed under MIT from dauparas/ProteinMPNN; see src/teddympnn/weights/pretrained/NOTICES.md for full attribution and citations.

Training

1. Download teddymer

python -m teddympnn download teddymer --output data/teddymer

2. Prepare train/val manifests

python -m teddympnn download prepare-manifests \
    --output data/manifests \
    --teddymer data/teddymer/filtered_manifest.tsv \
    --val-fraction 0.05

3. Train

# Default run (uses configs/train.yaml)
python -m teddympnn train

# Override individual knobs Hydra-style
python -m teddympnn train train.interface_weight=3.0 max_steps=100000

# Resume from checkpoint
python -m teddympnn train --resume outputs/train/checkpoints/step_0050000.pt

The interface_weight config knob scales the loss at interface residues. 1.0 (default) reproduces standard ProteinMPNN training; values > 1.0 increase interface emphasis.

Project Structure

src/teddympnn/
    models/          # ProteinMPNN and layers
    data/            # Teddymer pipeline, datasets, manifests
    training/        # Trainer, interface-weighted loss, scheduler
    evaluation/      # Sequence recovery, ΔΔG, SKEMPI
    weights/         # Checkpoint I/O, Foundry base-weight loading
    cli.py           # CLI entry points
    config.py        # Pydantic configuration models
configs/             # Training YAML configs
scripts/             # Utility scripts
tests/               # Test suite
docs/                # Architecture and vision docs

Development

# Lint and format
ruff check src/ tests/
ruff format src/ tests/

# Type check
ty check src/

# Run tests
pytest

# Run tests (skip slow)
pytest -m "not slow"

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teddympnn-0.1.0.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teddympnn-0.1.0-py3-none-any.whl (6.3 MB view details)

Uploaded Python 3

File details

Details for the file teddympnn-0.1.0.tar.gz.

File metadata

  • Download URL: teddympnn-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for teddympnn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d838ff6b4b0ad34078036fc80a6d2f1c6551e2d286d865f4b4df721b6b5e429b
MD5 742a3692b6bc54aa456648e1b9eb803d
BLAKE2b-256 3c6a19b51f4150017538831e0b7daaee064af983c7719b8bc130101d0c94a8c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for teddympnn-0.1.0.tar.gz:

Publisher: python-publish.yaml on briney/teddyMPNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teddympnn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: teddympnn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for teddympnn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3a15d3772342a473faf1ffc5f40d653f9b355c51d5b5689ac1288b6d811c2de
MD5 5dcb0710d4ab6a4cb54be74bb19578f2
BLAKE2b-256 f6a9baf24e0da907231e571cae376e26a1d825ff3c10000250bd8b31b28bdc51

See more details on using hashes here.

Provenance

The following attestation bundles were made for teddympnn-0.1.0-py3-none-any.whl:

Publisher: python-publish.yaml on briney/teddyMPNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page