NA-MPNN
This repository contains oteam/nampnn, converted from s_19137.pt.
NA-MPNN designs and scores sequences on fixed protein, DNA, RNA, and mixed polymer backbones.
Disclaimer
This is an unofficial OFoldX implementation of NA-MPNN. The upstream authors did not write, review, or endorse this implementation or model card.
Model Details
NA-MPNN extends fixed-backbone inverse folding to protein, DNA, RNA, and mixed polymer assemblies. It represents each polymer residue with a shared geometric message-passing graph while constraining sampled identities to the residue's polymer type. The same architecture supports joint sequence design, sequence scoring, and protein-DNA specificity prediction.
Variants
- oteam/nampnn: Sequence-design model for protein and nucleic-acid assemblies.
- oteam/nampnn-specificity: Protein-DNA specificity model.
Model Specification
| Vocabulary Size | Hidden Size | Encoder Blocks | Decoder Blocks | Neighbors | Atom Slots per Residue | Num Parameters (M) |
|---|---|---|---|---|---|---|
| 72 | 128 | 3 | 3 | 32 | 16 | 2.293 |
Links
- Code: ofoldx.models.nampnn
- Paper: RNA sequence design and protein-DNA specificity prediction with NA-MPNN
- Developed by: Baker Laboratory
- Model type: Autoregressive message-passing neural network for protein and nucleic-acid sequence design
- Original Repository: baker-laboratory/NA-MPNN
Usage
The model depends on the ofoldx
library. Install it with pip:
pip install ofoldx
Sequence Design
Load the concrete design Pipeline:
import ofoldx
from ofoldx.io import read_structure
structure, report = read_structure("complex.cif")
pipeline = ofoldx.pipeline("design", model="oteam/nampnn")
output = pipeline.design(structure)
The model's token axis is the 72 canonical classes; the 33 classes of the
released vocabulary keep their upstream logits and every other class has logit
-inf; a residue whose class is outside that vocabulary is read as its type's
unknown (X, DNA_X, RNA_X), as upstream. With shared nucleic tokens (the
released default) an RNA residue is read and sampled as the DNA class of its
base and designed as the RNA residue. global_omit_tokens takes canonical class
names ("C", "DNA_T"); under shared nucleic tokens an RNA base is omitted by
its DNA class ("DNA_T" omits U from RNA rows and T from DNA rows) and an
RNA_ name is refused.
Each candidate's final target is built by the shared design producer, and
output.records holds its design record.
Staged Execution and Scoring
The callable design Pipeline uses the same preparation, computation and decoding as its explicit stages:
prepared = pipeline.prepare(structure)
raw = pipeline.forward(prepared.input, seed=7)
result = pipeline.postprocess(prepared, raw)
result = pipeline(structure, seed=7)
Scoring has its own task Pipeline and reuses the same converted weights:
scorer = ofoldx.pipeline("score", model="oteam/nampnn")
score = scorer(structure, num_decoding_orders=8, seed=7)
For an in-memory model, construct NaMpnnScorePipeline with the designer's
model and processor. Its prepare, forward and postprocess stages evaluate
the observed or explicitly supplied sequence without sampling new identities.
Training Details
Training Data
NA-MPNN was trained on protein, DNA, RNA, and mixed-polymer structures. The design and specificity variants target sequence recovery and protein-DNA specificity, respectively.
Training Procedure
NaMpnnModel.forward supports protein, DNA, and RNA coordinate
noise and optional protein-first decoding.
ofoldx.models.nampnn.objective.smoothed_loss provides the polymer-specific
objective. It supports both shared and
separate DNA/RNA token layouts and the released aligned target-probability rows;
masking and reduction remain caller-owned. This covers masked polymer
sequence recovery; it does not reproduce the upstream specificity-training
dataset or its complete training orchestration.
Citation
Please cite the upstream preprint, RNA sequence design and protein-DNA specificity prediction with NA-MPNN.
If OFoldX supports your research, also cite the OFoldX software:
@software{chen2026ofoldx,
author = {Chen, Zhiyuan},
title = {OFoldX},
year = {2026},
url = {https://github.com/OTeam-AI4S/OFoldX},
}
Contact
Please use OFoldX GitHub issues for questions about this implementation or model card.
License
The original NA-MPNN distribution contains the MIT license and BSD-3-Clause notices. The complete upstream text is retained in LICENSE.
The OFoldX implementation is separately licensed under AGPL-3.0-or-later; see license.md and license-faq.md.
These converted parameters use native OFoldX tensor names and the canonical vocabulary. Conversion changes the parameter representation and vocabulary axes; it does not change the upstream weight license.
Upstream source revision: aafa32c87b65046a02db152f6e6235a7078e5fef.