Skip to main content

netam

Neural NETworks for antibody Affinity Maturation.

pip installation

Netam is available on PyPI, and works with Python 3.9 through 3.11.

pip install netam

This will allow you to use the models.

However, if you wish to interact with the models on a more detailed level, you will want to do a developer installation (see below).

Models

Thrifty model of somatic hypermutation

This model is described in:

Sung, Johnson, Dumm, Simon, Haddox, Fukuyama, Matsen IV. Thrifty wide-context models of B cell receptor somatic hypermutation. eLife. 2025 Mar. doi: 10.7554/elife.105471.1

The corresponding reproducible experiments are at matsengrp/thrifty-experiments-1; see that repo's README for additional dependencies.

Deep Natural Selection Model (DNSM)

This model is described in:

Matsen IV, Sung, Johnson, Dumm, Rich, Starr, Song, Bradley, Fukuyama, Haddox. A sitewise model of natural selection on individual antibodies via a transformer-encoder. Mol Biol Evol. 2025 Jul;42(8):msaf186. doi: 10.1093/molbev/msaf186

The corresponding reproducible experiments are at matsengrp/dnsm-experiments-mbe; see that repo's README for additional dependencies.

Pretrained models

Pretrained models will be downloaded on demand, so you will not need to install them separately.

The models are named according to the following convention:

ModeltypeSpeciesVXX-YY

where:

  • Modeltype is the type of model, such as Thrifty for the "thrifty" SHM model or DNSM for Deep Natural Selection Models
  • Species is the species, such as Hum for human
  • XX is the version of the model
  • YY is any model-specific information, such as the number of parameters

Available Models

Thrifty Models:

  • ThriftyHumV0.2-20, ThriftyHumV0.2-45, ThriftyHumV0.2-59: SHM models trained on human data

DNSM Models:

  • DNSMHumV1.0-1M: 1M parameter Deep Natural Selection Model trained on human data
  • DNSMHumV1.0-4M: 4M parameter Deep Natural Selection Model trained on human data

If you need to clear out the cache of pretrained models, you can use the command-line call:

netam clear_model_cache

Usage

See the examples in the notebooks directory.

Developer installation

From a clone of this repository, install using:

python3.11 -m venv .venv
source .venv/bin/activate
make install

Note that you should be fine with an earlier version of Python. We target Python 3.9, but 3.11 is faster.

Troubleshooting

  • On some machines, pip may install a version of numpy that is too new for the available version of pytorch, returning an error such as A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. The solution is to downgrade to numpy<2:
    pip install --force-reinstall "numpy<2"
    

Metadata

Release files for netam 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netam 0.2.5
File Size Uploaded
netam-0.2.5.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for netam 0.2.5
File Interpreter ABI Platform
netam-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / netam-0.2.5.tar.gz

Download URL netam-0.2.5.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
7949bdaab2f9296126fc4844d91d221f6ade26f2d5e1f53732b235d489dbdb94
BLAKE2b-256 checksum
How to use checksums
bc0ae4789ef944378bed2f8d343c7c011c3d808c09a4ed8f3a20e6447027047d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / netam-0.2.5-py3-none-any.whl

Download URL netam-0.2.5-py3-none-any.whl
Size 104.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c11ac29fd92b1a07898c8ddc442d98e048ab2881630b247e90d2f90cdf123ee8
BLAKE2b-256 checksum
How to use checksums
1f820611589e613965fb682c2e23a9332fa7766faa9463e09205d29c144d3c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page