# ProteinMPNN
Design sequences for a backbone, or score existing sequences against one.
- Job type: `PROTEINMPNN`
- Task: Sequence design
- Price: 1 credit per 32 backbones
- Automatic routing: ProteinMPNN designs sequences for the backbone. ProteinMPNN scores each supplied sequence against the backbone.
- Behavior and limits: Takes its structure under `pdb`/`pdb_gcs_uri`, not `target_pdb`.
- Source: Baker Lab (https://github.com/dauparas/ProteinMPNN)
- Paper: Dauparas et al., Robust deep learning-based protein sequence design using ProteinMPNN. Science 2022. doi:10.1126/science.add2187

## Example

### CLI

```bash
phi jobs submit PROTEINMPNN \
  --input pdb=@structure.pdb \
  --input binder_chain_id=A \
  --input target_chain_id=A \
  --param mode=design \
  --param num_seq_per_target=4 \
  --param sampling_temp=0.0001 \
  --param preset=rfd_ca_vanilla \
  --wait --out out
```

### Python

```python
from phi import PhiClient

with PhiClient() as phi:
    pdb = phi.files.upload(path="structure.pdb")
    job = phi.jobs.submit(
        "PROTEINMPNN",
        inputs={
        "pdb_gcs_uri": pdb,
        "binder_chain_id": "A",
        "target_chain_id": "A"
        },
        params={
        "mode": "design",
        "num_seq_per_target": 4,
        "sampling_temp": 0.0001,
        "preset": "rfd_ca_vanilla"
        },
    )
    print(phi.jobs.wait(job.job_id).status)
```

### HTTP

```bash
curl -X POST https://api.dynophi.com/v1/jobs \
  -H "x-api-key: $PHI_KEY" -H "content-type: application/json" \
  -d '{
  "job_type": "PROTEINMPNN",
  "inputs": {
    "pdb_gcs_uri": "<gs:// uri from POST /v1/uploads/url>",
    "binder_chain_id": "A",
    "target_chain_id": "A"
  },
  "params": {
    "mode": "design",
    "num_seq_per_target": 4,
    "sampling_temp": 0.0001,
    "preset": "rfd_ca_vanilla"
  }
}'
```

## Parameters

| Name | Type | Default | Description |
|---|---|---|---|
| `gpu` | string one of a100, t4, a100_80gb, h100, a100_or_h100, a100_80gb_or_h100, a100_preferred, h100_preferred | `null` | Per-job GPU class override. |
| `mode` (essential) | string one of design, score, probs | `"design"` | 'design' samples num_seq_per_target sequences per backbone. 'score' returns the ProteinMPNN score (global NLL) for each caller-supplied inputs.sequences entry on the backbone; num_seq_per_target/sampling_temp are ignored. 'probs' returns, per residue, the model's 21-letter distribution given the backbone and every other residue (leave-one-out), with the log-probability of the residue present (fit) and 1 - entropy/ln 21 (certainty), as per_residue.json; num_seq_per_target is the number of decoding orders averaged (1 is enough), pdb_path_chains selects the chains scored (default all), one optional inputs.sequences entry replaces the backbone's own sequence, and sampling_temp, omit_AAs, fixed_positions and tied_positions are ignored. |
| `preset` (essential) | string one of rfd_ca_vanilla, rfd_soluble, rfd_vanilla | `null` | Config preset selecting default ProteinMPNN params; any explicitly set field overrides the preset. |
| `num_seq_per_target` (essential) | integer | `4` | Sequences to generate per input backbone (ProteinMPNN --num_seq_per_target). |
| `batch_size` | integer | `1` | Sequences sampled per ProteinMPNN forward pass (--batch_size). |
| `sampling_temp` (essential) | number | `0.0001` | Sampling temperature; higher (0.1-0.3) is more diverse, lower is near-deterministic. |
| `backbone_noise` | number | `0` | Gaussian noise (Angstrom) added to backbone coordinates. |
| `model_name` | string one of v_48_020, v_48_020_soluble | `"v_48_020_soluble"` | ProteinMPNN weight file stem. v_48_020_soluble is the soluble checkpoint; v_48_020 is the vanilla full-backbone checkpoint. CA-only sequencing is ca_only, which loads the CA checkpoint. |
| `ca_only` | boolean | `false` | Sequence a CA-only backbone with the CA checkpoint. Requires model_name v_48_020; unset model_name selects it. |
| `omit_AAs` (essential) | string | `"C"` | Amino acids to exclude from the design. |
| `fixed_positions` | string | object | `null` | Residues to fix. Accepts comma-separated shorthand (e.g. 'V,W1,W2') or {chain: [1-based_positions]}; an empty list means fully designable. |
| `pdb_path_chains` | string | `null` | Chains selected from the full complex for target-aware design. Include the binder and every fixed target chain. Leave unset with inputs.designed_chain_ids, which derives it. |
| `tied_positions` | object | list of object | `null` | Positions that decode to the same amino acid. Accepts {chain: [1-based_positions]}, which ties each chain's nth position together and therefore requires the same positions on every chain, or an explicit list of tie groups such as [{'A': [1], 'B': [1]}] for per-position chain sets. Multi-chain tying requires pdb_path_chains. |
| `omit_AAs_per_position` | object | `null` | Amino acids to ban at specific positions, distinct from the global omit_AAs. Accepts ProteinMPNN's native shape {chain: [[[1-based_positions], 'AAsToOmit'], ...]}. Multi-chain use requires pdb_path_chains; a single extracted chain works without it. |
| `bias_AA_per_residue` | object | `null` | Per-residue amino-acid bias added to the sampling logits: {chain: [[[1-based_positions], {AA: bias}], ...]}, the same position-list shape as omit_AAs_per_position with an {AA: bias} map in place of the omit string (positive favours, negative disfavours). Multi-chain use requires pdb_path_chains; a single extracted chain works without it. |

## Inputs

| Name | Type | Default | Description |
|---|---|---|---|
| `pdb` | string | `null` | Backbone structure as base64-encoded PDB. Provide this or pdb_gcs_uri. |
| `pdb_gcs_uri` (essential) | string | `null` | gs:// URI to the backbone PDB. Provide this or pdb. |
| `binder_chain_id` (essential) | string | `"A"` | Chain ID of the binder to design. |
| `target_chain_id` (essential) | string | `"A"` | Chain ID of the (fixed) target. |
| `designed_chain_ids` | list of string | `null` | Chains that are all designable (general non-binder design, one or more chains). When set, the binder/target split does not apply and fixed_positions is optional; pdb_path_chains defaults to these chains plus any genuinely-fixed target chains, and must select exactly those when you set it yourself. Mutually exclusive with binder_chain_id / target_chain_id. |
| `sequences` (essential) | list of ProteinMPNNScoreSequence | `null` | Caller sequences scored against the backbone (params.mode='score'; one entry in params.mode='probs', scored residue by residue in place of the backbone's own sequence). Each {name, sequence}; names must be unique. Omit for design mode. |

---
Source: https://dynophi.com/docs/models/PROTEINMPNN. From the live API schema and phi-api's model catalog, 2026-11-23.