inverse-folding
Use ESM-IF1 for fixed-backbone protein inverse design, sequence log-likelihood scoring, multichain conditioning, coordinate extraction, and structure encoder representations.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inverse-folding
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use ESM-IF1 for fixed-backbone protein inverse design, sequence log-likelihood scoring, multichain conditioning, coordinate extraction, and structure encoder representations.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md6.0 KB
- 参考文档references/data-formats.md5.6 KB
- 参考文档references/troubleshooting.md8.0 KB
- 参考文档references/workflows.md7.2 KB
- 脚本scripts/inverse_folding_cli_helper.py14.2 KB
03 SKILL.md 正文
Inverse Folding
Use this sub-skill when a task needs ESM-IF1 to design or score protein sequences from known backbone coordinates. It covers fixed-backbone sequence sampling, single-chain and multichain complex conditioning, PDB/mmCIF coordinate extraction, missing-coordinate handling, conditional log-likelihood scoring, and encoder representations.
When To Use
- Sample candidate amino-acid sequences for a PDB or mmCIF backbone with
esm.pretrained.esm_if1_gvp4_t16_142M_UR50()andmodel.sample(...). - Score one or more sequences against a structure with
score_sequence(...)orscore_sequence_in_complex(...). - Condition target-chain design on all chains in a complex with
--multichain-backboneormultichain_utilAPIs. - Extract N/CA/C backbone coordinates and native sequences from PDB/mmCIF files.
- Obtain structure-conditioned encoder representations from ESM-IF1.
Route Elsewhere
- Use the sibling
structure-predictionsub-skill for ESMFold forward folding from sequence to structure. - Use the sibling
model-embeddingssub-skill for generic protein language-model embeddings that do not use backbone coordinates. - Use the sibling
variant-effect-predictionsub-skill for mutation scoring without a structure-conditioned inverse-folding model.
Start Here
- Confirm the environment has PyTorch plus inverse-folding optional dependencies, especially
torch-geometricand a compatiblebiotiteAPI. - Validate the structure suffix is
.pdbor.cif, choose the target chain ID, and decide whether to condition on only the target chain or the whole complex. - For CLI-style work, use the bundled dry-run helper in
scripts/inverse_folding_cli_helper.pyto construct safe commands before running downloads or GPU jobs. - For API work, load
model, alphabet = esm.pretrained.esm_if1_gvp4_t16_142M_UR50()and callmodel.eval()before sampling or scoring. - Inspect sampled FASTA output for long amino-acid repeats and inspect scoring CSV output for sequence length mismatches or missing-coordinate effects.
References
references/workflows.mdgives task recipes for sampling, scoring, multichain conditioning, encoder outputs, and diagnostic workflows.references/api-reference.mdlists the supported ESM-IF1 loader and inverse-folding APIs.references/data-formats.mddescribes coordinate tensors, PDB/mmCIF requirements, FASTA input/output, CSV scoring output, and missing-coordinate conventions.references/troubleshooting.mdmaps common dependency, data, runtime, and biological-quality failures to fixes.
Bundled Helper
Use scripts/inverse_folding_cli_helper.py for self-contained command construction and input validation:
python scripts/inverse_folding_cli_helper.py sample structure.pdb --chain C --outpath designs.fasta
python scripts/inverse_folding_cli_helper.py score structure.pdb variants.fasta --chain C --outpath scores.csv --multichain-backbone
The helper prints a dry-run command by default. Add --execute only when the environment is ready for model loading, potential torch hub downloads, and a long CPU/GPU run.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).