Redesign a sequence on its structure
phi-redesign
Redesign a protein sequence on its structure with ProteinMPNN, PottsMPNN, ESM-IF1 or Proton-PottsMPNN on Dyno Phi, keeping the residues that must stay, and check the designs by refolding them; or score the person's own sequences on a backbone; or read what the model would put at every position.
Use when a person has a structure and wants new sequences for it or for part of it, wants sequences scored on a backbone, or asks about inverse folding, sequence recovery, native fit or certainty. The tools are phi_load_target, set_hotspots, select_patch and phi_submit_job.
phi skills install phi-redesign -gRedesign a sequence on its structure
Use this skill when the person has a structure and wants new sequences for it or for a part of it, or wants sequences scored against a backbone.
What Phi offers
Four inverse folding models, each a job at the same price:
| Job type | Modes | What it returns per sequence |
|---|---|---|
PROTEINMPNN (the default) | design, score, probs | score and global_score (negative log-likelihoods, lower is better) and seq_recovery |
POTTSMPNN | design, score, probs | the same rows plus a Potts energy; weights chosen by checkpoint |
ESM_IF1 | design, score, one chain at a time | score, its negated average log-likelihood over the designed chain, and global_score over the residues with coordinates |
PROTON_POTTSMPNN | design only, the binder chain alone | a chain designed for a pH switch, with Potts and selective energies; takes num_designs and temperature |
Design mode returns per-sequence numbers. Probs mode returns a distribution per residue.
Before you start
- The structure: a PDB id, a UniProt id, a URL or a file, loaded with
phi_load_target. The lab shows author numbering; the model counts positions from 1 along each chain, and the lab converts. - Which chains are designed and which are kept. A chain the model sees but does not design is fixed whole. Keep a partner chain in the file when an interface matters, because the model sees only what it is given.
Steps
- Settle what to redesign. The whole chain is the default. For a part, name the residues in author numbering with
set_hotspots, a patch around a landmark withselect_patch, or a region fromget_features. Everything not named is fixed. In the lab, one click keeps the interface contacts with a partner chain. - Settle the count and the temperature, and say which purpose they serve. Phi's defaults are 4 sequences at 0.0001 on jobs and 0.1 on runs. A few sequences check a backbone; tens explore it. 0.1 stays close to the backbone's preferences, and 0.2 to 0.3 wanders.
- Submit through the lab, or through
phi_submit_jobwithdry_run: truefirst and then on the person's yes. The request carriespdb_gcs_uri,binder_chain_idandtarget_chain_id(ordesigned_chain_ids),pdb_path_chains,fixed_positionsas{chain: [positions]},num_seq_per_target,sampling_temp,model_name(v_48_020_solubleby default) andomit_AAs(Cby default). A structure with insertion codes must be renumbered from 1 per chain before the model sees it; the lab's upload does this. - Read the designs:
sequence_by_chain,score,global_scoreandseq_recovery(the share of residues kept). No source states a threshold on any of them, and recovery does not predict function. - Check by refolding: one
ESMFOLDjob per design for the designed chain alone (Phi's ESMFold folds one chain; the kept chains stay the input's) gives per-residue pLDDT, and the lab overlays the refold on the input for its RMSD. Whether a redesigned binder still binds is a second question for a co-folding model (ESMFOLD2,ALPHAFOLD,BOLTZ2). Say that geometry admits a design and confidence only orders a shortlist.
To score the person's own sequences instead, use mode: "score" with sequences as the full complex, chains in alphabetical order joined with /; the lab's Score mode writes this.
To see what the model would put at every position, use mode: "probs" on PROTEINMPNN or POTTSMPNN with one backbone, and optionally one sequences entry to score a substituted sequence. It writes per_residue.json: for each residue the 21-letter distribution given the backbone and every other residue, fit (the log probability of the residue present, at most 0, higher fits better), certainty (1 minus the entropy over ln 21), and the mean fit as score. The lab runs this by itself when a structure loads, caches it, and shows Native fit and Certainty on the structure and under the sequence, with a 21-letter row per residue where a click substitutes.
Rules
- Never submit without the dry run and the person's yes.
- Never rank by an ESM log-likelihood, and never let one gate a design in either direction.
- Do not invent a threshold on score, global score, recovery, refold RMSD, fit or certainty. Say that none is set.
- Treat a low fit as a residue to look at. ProteinMPNN is a weak zero-shot fitness scorer (ProteinGym Spearman 0.258), so a low fit does not show that the residue is wrong.
- Keep the partner chain in the file when an interface matters.
Version 1.2