# PottsMPNN
Design sequences for a backbone with PottsMPNN, or score existing sequences against one; ProteinMPNN's contract on KeatingLab's Potts-head sampler.
- Job type: `POTTSMPNN`
- Task: Sequence design
- Price: 1 credit per 32 backbones
- Behavior and limits: Same inputs and row keys as PROTEINMPNN, plus `potts_energy` on every row. `checkpoint` picks the weights (`soluble_020_msa` by default). `mode=probs` writes per_residue.json in ProteinMPNN's shape.
- Source: pending
- Paper: citation pending

## Example

### CLI

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

### Python

```python
from phi import PhiClient

with PhiClient() as phi:
    pdb = phi.files.upload(path="structure.pdb")
    job = phi.jobs.submit(
        "POTTSMPNN",
        inputs={
        "pdb_gcs_uri": pdb,
        "binder_chain_id": "A",
        "target_chain_id": "A"
        },
        params={
        "mode": "design",
        "checkpoint": "soluble_020_msa",
        "num_seq_per_target": 4,
        "sampling_temp": 0.0001
        },
    )
    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": "POTTSMPNN",
  "inputs": {
    "pdb_gcs_uri": "<gs:// uri from POST /v1/uploads/url>",
    "binder_chain_id": "A",
    "target_chain_id": "A"
  },
  "params": {
    "mode": "design",
    "checkpoint": "soluble_020_msa",
    "num_seq_per_target": 4,
    "sampling_temp": 0.0001
  }
}'
```

## 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 PottsMPNN 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; pdb_path_chains selects the chains scored (default all), one optional inputs.sequences entry replaces the backbone's own sequence, and num_seq_per_target, sampling_temp, omit_AAs, fixed_positions and tied_positions are ignored; the seed is pinned. |
| `checkpoint` (essential) | string one of vanilla_020_msa, vanilla_030, vanilla_020, soluble_020_msa, soluble_030, soluble_020 | `"soluble_020_msa"` | PottsMPNN weight set. soluble_020_msa is soluble, 0.2 Å training noise, MSA-trained. The number in the name is training noise, not inference backbone_noise. |
| `num_seq_per_target` (essential) | integer | `4` | Sequences to generate per input backbone (sample_seqs inference.num_samples). |
| `score_decoding_orders` | integer | `1` | Score mode only: random decoding orders the candidate NLL is averaged over, mirroring ProteinMPNN's --score_only. The default 1 is ProteinMPNN's num_seq_per_target default; the same orders are shared across every candidate in a run so their scores are comparable. Ignored in design mode. |
| `sampling_temp` (essential) | number | `0.0001` | Sampling temperature (inference.temperature). Matches the ProteinMPNN phi default; 0 is clamped to 1e-6 by sample_seqs.py. |
| `backbone_noise` | number | `0` | Gaussian noise (Angstrom) added to backbone coordinates (inference.noise). |
| `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. |
| `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, or a list of tie groups such as [{'A': [1], 'B': [1]}]. Multi-chain tying requires pdb_path_chains. |
| `omit_AAs_per_position` | object | `null` | Amino acids to ban at specific positions. Accepts ProteinMPNN's native shape {chain: [[[1-based_positions], 'AAsToOmit'], ...]}. Multi-chain use requires pdb_path_chains. |

## 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 for params.mode='score' (one or more) or 'probs' (at most one). Each {name, sequence}; names must be unique. Omit for design mode. |

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