Generated banner for Complexa Sweep
Generated logo for Complexa Sweep

Complexa Sweep

NVIDIAOfficialCreated by Ohad MosafiDistributed by NVIDIA

  • Skill
  • Workflow
  • Science and research
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Agent runbook for Proteina-Complexa parameter sweeps through the separately installed first-party CLI and config generator. Use for cartesian-product hyperparameter scans, sweeper YAML authoring, configuration comparisons, ablations, tuning, success-rate ranking, or Pareto searches over quality and wall-clock cost. Do not use for a single existing-job launch or SLURM submission template. SKILL.md performs the orchestration; bundled executables only inspect local readiness and write a run manifest.
— the description by Ohad Mosafi

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The complexa-sweep skill provides a structured runbook for executing systematic parameter sweeps over Proteina-Complexa design pipelines. It automates the generation of multiple inference configurations based on a sweeper YAML, manages the execution loop across these configurations, and aggregates results into a ranked summary. This process enables users to perform ablations, tuning, and Pareto searches over quality and computational cost metrics, ensuring consistent evaluation across diverse parameter sets.

What it does

  • Generates multiple inference configurations from a cartesian-product sweeper YAML.
  • Executes the design pipeline across a generated grid of parameter combinations.
  • Aggregates per-config success metrics into a ranked summary CSV.
  • Identifies the best-performing configuration and Pareto frontiers.
  • Provides a manifest for result tracking and experiment reproducibility.
  • Includes pre-flight checks to estimate GPU budget and hardware readiness.

When to use it

  • When performing hyperparameter tuning or ablations on design pipelines.
  • When comparing multiple search algorithms or model configurations.
  • When conducting Pareto searches to balance design quality against wall-clock time.
  • When you need to rank configurations based on success rates and diversity metrics.

Advantages

  • Systematic exploration of parameter space via cartesian-product enumeration.
  • Automated aggregation of results simplifies complex multi-run analysis.
  • Supports multi-GPU sharding for efficient execution of large sweeps.
  • Provides clear visibility into cost and resource requirements before execution.

Usage examples

“Run a sweep over beam_width and nsteps for the 22_DerF21 task.”
The agent will generate the necessary inference configs using the specified sweeper YAML, execute the design pipeline for each combination, and produce a ranked sweep_summary.csv.
“Estimate the GPU cost for a 4-axis sweep with 4 values each.”
The agent will calculate the total number of configurations and estimate the total GPU-hours based on the per-run baseline, prompting for confirmation before proceeding.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/complexa-sweep/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip complexa-sweep.zip -d .agents/skills

Documentation by Ohad Mosafi

complexa-sweep

Run cartesian-product parameter sweeps over Proteina-Complexa design pipelines. Pick or author a sweeper YAML in configs/sweeps/, expand it to N inference configs with script_utils/generate_inference_configs.py, loop complexa design over those configs, then aggregate per-config success metrics into a ranked summary CSV plus a manifest.

Important: The complexa design CLI does NOT accept --sweeper directly. Sweeps are driven by script_utils/generate_inference_configs.py, which writes one configs/inference_configs/inf_{idx}_{run_name}.yaml per sweep combination. You then loop complexa design over those generated configs.

Instructions

Sweeper authoring, Cartesian enumeration, cost estimates, and analysis of supplied CSVs need only the relevant configs and data. Complete those artifacts without setting up inference. Read the relevant axis section in sweep_axes.md, then check the matching keys in the selected source config for current defaults. Summary CSVs with supplied counts and objective columns do not require the full inference or metric guides. For a partial snapshot, enumerate combinations locally and provide the future generator command; running that command requires the full project and its dependencies.

For a requested launch, check readiness and the budget below. A single existing job or a SLURM template does not require a parameter sweep.

Step 1: Pre-flight

Before GPU execution, or when the request conditions its workflow on hardware, set SKILL_DIR to the directory containing this manifest and run preflight once. Use a separate shell assignment; an inline environment assignment cannot set $SKILL_DIR's expansion in the same command. Reuse an existing probe from the same request if the environment is unchanged:

bash "$SKILL_DIR"/scripts/preflight.sh

Read ./complexa_setup/preflight.json. A sweep multiplies GPU time by the number of configs and targets. Compute the budget before launch and obtain confirmation if the user has not already authorized that scope and cost:

"This sweep produces N configs × ~M minutes per config ≈ TOTAL GPU-hours. OK to proceed? (y / reduce / cancel)"

If gpu.available=false, stop before GPU execution. Sweeper authoring, Cartesian-product enumeration, cost estimates, and analysis of supplied CSVs can run on CPU. For those requests, finish the requested artifacts and record the launch prerequisites. Label synthetic input data as synthetic and keep estimated GPU time separate from measured runtime.

For a hardware-conditional request, verify the allocated hardware before selecting the CPU fallback. Missing weights, dependencies, or sufficient VRAM for an allocated GPU are launch blockers, not evidence of a CPU-only environment. Report probe or execution failures without reclassifying the selected branch. The shared preflight's gpu.available=false also covers failed or missing nvidia-smi; check device/allocation evidence before treating it as GPU absence. In containers, /proc/driver/nvidia/gpus and loaded kernel modules may describe the host, not this task's allocation. Check container device exposure and any available scheduler allocation information together. A CPU allocation can share a GPU host; an allocated GPU with inaccessible devices is blocked. If allocation remains unclear, report it as undetermined.

Step 2: Pick the pipeline + target

Use the user's supplied pipeline, targets, and run name. Protein, ligand, and AME runs use search_binder_local_pipeline, search_ligand_binder_local_pipeline, and search_ame_local_pipeline, respectively. Ask only for missing values:

  • pipeline_config_name — e.g. search_binder_local_pipeline (default), search_ligand_binder_local_pipeline, search_ame_local_pipeline.

  • task_name — e.g. 02_PDL1, 22_DerF21, 39_7V11_LIGAND. Passed as --override generation.task_name=<task>.

  • run_name — short tag for output dir naming.

Examples

Step 3: Pick or author the sweeper YAML

Sweeper YAMLs live in configs/sweeps/. Each key is a dot-notation Hydra path; each value is a list. The cartesian product becomes N configs.

Canned sweepers
FileAxisValuesConfigs
configs/sweeps/beam_width.yamlgeneration.search.beam_search.beam_width1, 2, 4, 84
configs/sweeps/bb_ca_temperature.yamlgeneration.model.bb_ca.simulation_step_params.sc_scale_noise0.1, 0.42
configs/sweeps/search_replicas.yamlgeneration.search.best_of_n.replicas1, 4, 16, 644
configs/sweeps/example.yamlbeam_width × nsteps(2,4) × (200,400)4

Use a matching sweeper, then check that its axes affect the selected algorithm. The binder config defaults to best-of-n: a beam-width sweep must also pin generation.search.algorithm: [beam-search]. A replicas sweep pins generation.search.algorithm: [best-of-n]. For AME, reward-guided search also requires a configured reward model; its default is null.

Authoring a new sweeper

Minimal multi-axis example (saved to configs/sweeps/my_sweep.yaml):

# 3 beam widths × 2 nsteps = 6 configs
generation.search.algorithm: [beam-search]

generation.search.beam_search.beam_width:
  - 2
  - 4
  - 8

generation.args.nsteps:
  - 200
  - 400

Rules (from script_utils/generate_inference_configs.py:load_sweeper_file):

  • Top-level mapping only. Keys are dot-notation Hydra paths.

  • Keep budgets, launch status, and other planning metadata in the launch plan, outside the sweeper. Every top-level entry becomes an override axis; a separate targets list would multiply the grid again.

  • Values must be lists. A scalar is auto-wrapped into a single-element list (which pins a value without adding a dimension).

  • For a list-valued parameter, nest each candidate list: metric.sequence_types: [[self, mpnn]] pins one list. The flat form sweeps two strings; --override parses scalars only.

  • Cartesian product: total configs = product of list lengths. Multiply by the number of targets unless target names are already one of the axes; do not count them twice.

  • If a key appears in both the sweeper file and an --override, the override wins and that axis collapses.

  • Reject empty axes before launch: an axis of [] produces zero configurations.

See references/sweep_axes.md for the full catalogue of swept keys (typical ranges, cost multipliers, what improves/regresses).

Dry-run preview before generating

With the full project available, confirm the config count first:

python script_utils/generate_inference_configs.py \
    --config_name search_binder_local_pipeline \
    --sweeper configs/sweeps/my_sweep.yaml \
    --override generation.task_name=22_DerF21 \
    --run_name my_sweep \
    --dryrun

The output lists every axis + value list and prints DRY RUN — would generate N config pair(s). This previews enumeration only; it returns before Hydra composition and does not validate the pipeline, parameter types, or launch prerequisites.

When the full project is available, inspect the materialized inference configs before launching. Check the resolved target, selected search algorithm, and requested parameter values across the generated grid. The generator permits unknown keys during merging, so a successful write alone does not establish that a misspelled or misplaced axis changes the intended parameter. With only a partial snapshot, check each dot-path against its source config and report that materialization remains unverified.

Step 4: Generate configs + loop complexa design

Once the dry-run looks right, drop --dryrun to materialize inf_{idx}_{run_name}.yaml + eval_{idx}_{run_name}.yaml pairs under configs/inference_configs/ and configs/eval_configs/. Then loop complexa design over the inference configs.

For multiple targets, put generation.task_name in the sweeper as an axis, or give each target's generator invocation a distinct --run_name. Indices restart at zero on each invocation and filenames omit the target; reusing the same run name and output directories overwrites earlier configs and reuses result paths.

# 1. Generate one inf_*.yaml + one eval_*.yaml per combination.
python script_utils/generate_inference_configs.py \
    --config_name search_binder_local_pipeline \
    --sweeper configs/sweeps/my_sweep.yaml \
    --override generation.task_name=22_DerF21 \
    --run_name my_sweep

# 2. Loop complexa design over each generated inference config.
for cfg in configs/inference_configs/inf_*_my_sweep.yaml; do
    complexa design "$cfg" || echo "FAILED: $cfg"
done

This serialises the sweep on a single GPU — be honest with the user that wall-clock = N × per-run.

Multi-GPU host (optional speed-up)

On a host with K GPUs, shard the config list K ways and launch one loop per GPU in parallel. Each complexa design call uses exactly one GPU at default gen_njobs=1 / eval_njobs=1, so pinning via CUDA_VISIBLE_DEVICES keeps them from colliding:

CONFIGS=(configs/inference_configs/inf_*_my_sweep.yaml)
N=${#CONFIGS[@]}; K=4   # 4 GPUs
for gpu in $(seq 0 $((K-1))); do
    (
        for i in $(seq $gpu $K $((N-1))); do
            CUDA_VISIBLE_DEVICES=$gpu complexa design "${CONFIGS[$i]}" \
                || echo "FAILED on GPU $gpu: ${CONFIGS[$i]}"
        done
    ) &
done
wait

Drop gen_njobs / eval_njobs overrides into the loop only if you intentionally want each complexa design invocation to consume multiple GPUs (and you have a way to keep them out of each other's way).

Step 5: Collect results

Each swept config writes to its own ./inference/inf_{idx}_{run_name}/ directory; the analyze step writes ./evaluation_results/eval_{idx}_{run_name}/results_*.csv. After the sweep finishes:

ls -d ./inference/inf_*_my_sweep/
ls ./evaluation_results/eval_*_my_sweep/results_*.csv

Inspect the supplied CSV schema before aggregating. If it already contains one row per configuration with n_passed and n_designs, compute success_rate = n_passed / n_designs; flag zero denominators and invalid counts. Do not treat those summary rows as individual designs. For per-design rows, use existing pass flags, parsing string booleans explicitly. If flags are absent, use the run's analysis thresholds, result_type, column names, and units from EVALUATION_METRICS.md. PAE may be normalized by 31 and pLDDT may use different scales; do not substitute generic thresholds.

Step 6: Rank configs

Emit sweep_summary.csv to the run directory. One row per config:

ColumnHow to compute
config_idThe {idx} from inf_{idx}_{run_name}
<axis_1>, <axis_2>, ...The swept value at this combination (read from the per-config inf_*.yaml)
n_samplesn_designs for a supplied config summary, otherwise per-design row count
success_raten_passed / n_designs for a config summary, otherwise mean of parsed per-design pass flags
mean_i_paePreserve the supplied config mean, or average per-design values in consistent units (lower = better)
mean_i_plddti_plddt.mean() (higher = better)
diversity_scoreUnique sequence count / n_samples (or use TM-score clustering if available)
wall_clock_minFrom the per-config log timestamps

Populate only metrics present in the inputs or computable from them. Missing diversity or timing data stays unavailable.

Then report:

  • Best config = argmax of success_rate. Tie-break on mean_i_pae (lower).

  • Pareto frontier: choose the requested objectives and directions. For time versus success, minimize time and maximize success; for time versus iPAE, minimize both. A point is dominated when another is no worse on every objective and strictly better on at least one. Keep distinct config IDs at equal nondominated coordinates; report invalid/missing measurements separately.

Save the full table to sweep_summary.csv, then reopen the saved results and print a compact summary: row count, best config and metric values, and frontier IDs with their objective values. Report the CSV paths and keep the hardware probe and configuration dumps separate from this result summary.

Step 7: Emit manifest

Capture the resolved invocation + outputs for replay. The shared helper takes a single --output-dir (it walks for CSVs and pulls the Hydra config from the run's .hydra/), so call it against the best-config's evaluation directory and pass the parent complexa design command for that run:

BEST_ID=4   # from Step 6 ranking
python3 "$SKILL_DIR"/scripts/write_manifest.py \
    --output-dir ./evaluation_results/eval_${BEST_ID}_my_sweep \
    --command "python script_utils/generate_inference_configs.py --config_name search_binder_local_pipeline --sweeper configs/sweeps/my_sweep.yaml --override generation.task_name=22_DerF21 --run_name my_sweep && for cfg in configs/inference_configs/inf_*_my_sweep.yaml; do complexa design \"\$cfg\"; done" \
    --skill complexa-sweep \
    --out ./sweep_runs/my_sweep/sweep_manifest.json

Alongside the manifest, save the ranked sweep_summary.csv from Step 6 to ./sweep_runs/my_sweep/sweep_summary.csv and surface both paths to the user.

SymptomSweep thisWhy
Quality not good enoughbeam_width × nsteps (use example.yaml as a starting point)Both raise compute → quality; find the cheapest combination that lands.
Too slow / want speed-upnsteps downward (e.g. [100, 200, 400]) with fixed beam_width=4Find the smallest nsteps that retains success rate.
Mode collapse / low diversitygeneration.model.bb_ca.simulation_step_params.sc_scale_noise (use bb_ca_temperature.yaml)Higher noise → more diverse backbones.
Reward over-fitting (high reward, bad metrics)generation.reward_model.reward_models.af2folding.reward_weights.{i_pae, plddt} ratioRe-balance composite reward.
Broaden the best-of-N candidate poolsearch_replicas.yaml (best_of_n.replicas)More candidates per search; use separate seeds/runs to measure repeatability.
Algorithm shoot-outgeneration.search.algorithm over [single-pass, best-of-n, beam-search, fk-steering]Compare search regimes; pin everything else.

Hardware

Total GPU-time for a sweep = N_configs × per_run_GPU_time. A single search_binder_local_pipeline run on one A100 is roughly 30–90 min (binder length + nsteps dependent). A 4-axis × 4-value sweep = 256 configs × ~60 min = ~256 GPU-hours — at that scale, plan on a multi-GPU host with the Step-4 sharding pattern.

Refer to references/hardware.md for the per-run baseline + VRAM minima.

Troubleshooting

SymptomCauseFix
Sweeper file not found from generate_inference_configs.pyPath resolved from wrong CWDUse a path relative to the repo root; or pass an absolute path.
Sweeper YAML must be a mappingTop-level YAML is a list or scalarRewrite as key: [v1, v2] mapping.
Dry-run reports zero config pairsOne of the value lists is empty []Supply at least one value before generating or launching; the generator does not reject an empty product.
complexa design rejects --sweeperConfusion between entrypointsThe CLI does not accept --sweeper. Use generate_inference_configs.py first, then loop complexa design over the generated configs.
Override silently collapses a sweep axis--override key=v shadowed a sweep keyDrop either the override OR the matching key from the sweeper file.
One config in the loop fails, sweep keeps goingThe || echo "FAILED…" in Step 4 swallows the errorRe-run the failed inf_*.yaml standalone; check the per-config log under ./logs/. Skip failed config_id when ranking.

For per-axis reference (typical ranges, cost, what gets better/worse), see references/sweep_axes.md.

For the user-facing sweep system overview (config generation, output layout), see references/SWEEP.md.

Files

references/EVALUATION_METRICS.md

Evaluation & Analysis Guide

Metric definitions, result CSV structure, motif scaffolding, and Python analysis for the Proteina-Complexa pipeline.

Documentation Map

Table of Contents

  1. Pipeline Overview

  2. Protein Types & Result Types

  3. Evaluation Step (evaluate)

    • Protein Binder Evaluation

    • Ligand Binder Evaluation

    • Monomer Evaluation

    • Motif Evaluation (Monomer Motif)

    • Motif Binder Evaluation

  4. Motif Scaffolding Deep Dive

    • Tip Atoms vs All-Atom

    • Motif Alignment Modes: Indexed vs Unindexed

    • Contig Strings

  5. Analysis Step (analyze)

  6. Result CSV Reference

    • Protein Binder Result Columns

    • Ligand Binder Result Columns

    • Monomer Result Columns

    • Motif Result Columns

    • Motif Binder Result Columns

  7. Reading Results in Python

  8. Success Criteria

  9. Metric Interpretation Cheat Sheet

  10. Environment Variables


Pipeline Overview

The evaluation workflow has two stages:

evaluate  →  analyze
  │              │
  │  Per-sample  │  Aggregate, filter,
  │  metrics     │  success rates, diversity
  │              │
  ▼              ▼
  CSV per job    Summary CSVs + organized output

Evaluate computes per-sample metrics (RMSD, designability, folding confidence, etc.) and writes one CSV per parallel job.

Analyze loads all per-job CSVs, merges them, computes pass rates, diversity, and saves organized output.

# Run both stages (standalone)
complexa evaluate configs/evaluate.yaml
complexa analyze  configs/evaluate.yaml

# Or as part of a full design pipeline (evaluate + analyze run automatically)
complexa design configs/search_binder_local_pipeline.yaml          # Protein binder
complexa design configs/search_ligand_binder_local_pipeline.yaml   # Ligand binder
complexa design configs/search_ame_local_pipeline.yaml             # AME motif scaffolding

Protein Types & Result Types

Every evaluation is configured by two keys: protein_type (set in evaluation config, controls which metrics are computed) and result_type (set in analysis config, controls default success thresholds).

protein_typeresult_typeWhat is evaluatedPipeline configDefault thresholds
binderprotein_binderBinder + protein targetsearch_binder_local_pipeline.yamli_pAE*31 <= 7.0, pLDDT >= 0.9, scRMSD_ca < 1.5
binderligand_binderBinder + ligand targetsearch_ligand_binder_local_pipeline.yamlmin_ipAE*31 < 2.0, scRMSD_ca < 2.0, ligand scRMSD < 5.0
monomermonomerSingle-chain protein—designability scRMSD < 2.0
monomer_motifmonomer_motifSingle-chain + motif region—motif RMSD + codesignability
motif_bindermotif_protein_binderBinder + protein target + motifstandalone evaluate_motif_binder.yamlJoint binder + motif
motif_bindermotif_ligand_binderBinder + ligand target + motifsearch_ame_local_pipeline.yamlJoint binder + motif + clash

Each base binder type has a motif counterpart that adds motif RMSD, motif sequence recovery, and (for ligand targets) ligand clash detection on top of the standard binder metrics.

Pipeline configs live under configs/pipeline/. The top-level pipeline YAML (e.g. search_binder_local_pipeline.yaml) composes stage configs via Hydra defaults. The motif protein binder evaluation can also be run standalone against outputs from any protein binder pipeline.


Evaluation Step

All evaluation uses protein_type: binder for binder designs. The difference between protein and ligand binders is in the folding method, inverse folding model, and which columns appear in the output.

Protein Binder Evaluation

Evaluates protein-protein binder designs. Uses AlphaFold2 (ColabDesign) for refolding and SolubleMPNN for sequence redesign.

protein_type: binder

metric:
  compute_binder_metrics: true
  binder_folding_method: colabdesign   # AF2 multimer
  sequence_types: [self, mpnn, mpnn_fixed]  # pipeline default: [self]
  num_redesign_seqs: 8
  inverse_folding_model: soluble_mpnn

Note: The pipeline default (binder_evaluate.yaml) uses sequence_types: [self] for speed. Add mpnn and/or mpnn_fixed for ProteinMPNN redesign evaluation.

Workflow per sample:

  1. Inverse folding -- ProteinMPNN redesigns the binder sequence (mpnn, mpnn_fixed) or keeps the original (self)

  2. Structure prediction -- Refold the complex with AF2 (ColabDesign)

  3. Metrics -- Compute binding confidence (i_pAE, i_pTM, pLDDT) and structural consistency (scRMSD)

Key metrics:

MetricColumn patternWhat it measuresGood value
Interface PAE{seq}_complex_i_pAEBinding confidence< 10 (< 5 excellent)
Interface pTM{seq}_complex_i_pTMInterface quality> 0.5
pLDDT{seq}_complex_pLDDTStructure confidence> 70
Binder scRMSD{seq}_binder_scRMSDDesign preserved after refold< 2.0 A
Ligand Binder Evaluation

Evaluates small-molecule binder designs. Uses RF3 for refolding and LigandMPNN for sequence redesign. Produces additional ligand-specific RMSD columns.

protein_type: binder

metric:
  compute_binder_metrics: true
  binder_folding_method: rf3_latest    # RoseTTAFold3
  sequence_types: [self, mpnn]
  num_redesign_seqs: 2
  inverse_folding_model: ligand_mpnn

Workflow per sample:

  1. Inverse folding -- LigandMPNN redesigns the binder sequence (ligand-aware)

  2. Structure prediction -- Refold the complex with RF3

  3. Metrics -- Compute RF3 confidence metrics (min_ipAE, pLDDT, ipSAE) and both binder and ligand scRMSD

Key metrics (in addition to protein binder metrics above):

MetricColumn patternWhat it measuresGood value
min_ipAE{seq}_complex_min_ipAEMinimum interface PAE (primary for ligand)< 2.0 (after * 31)
Binder scRMSD (CA){seq}_binder_scRMSD_caBinder backbone preserved (CA only)< 2.0 A
Ligand scRMSD{seq}_ligand_scRMSDLigand position preserved after refold< 5.0 A
Ligand scRMSD (aligned){seq}_ligand_scRMSD_aligned_allatomLigand position after aligning binder< 5.0 A
ipSAE{seq}_complex_min_ipSAEInterface pSAE (higher is better)> 0.5

Key differences from protein binder evaluation:

  • binder_folding_method: rf3_latest instead of colabdesign

  • inverse_folding_model: ligand_mpnn instead of soluble_mpnn

  • Produces ligand RMSD columns (ligand_scRMSD, ligand_scRMSD_aligned_allatom, ligand_scRMSD_aligned_bb)

  • RF3 provides additional metrics: min_ipAE, min_ipSAE, avg_ipSAE, max_ipSAE, ranking_score, has_clash

  • Default ranking uses min_ipAE (minimize) instead of i_pAE

Monomer Evaluation

Evaluates single-chain structural quality via fold-and-compare.

metric:
  compute_monomer_metrics: true
  monomer_folding_models: [esmfold]
  designability_modes: [ca]
  codesignability_modes: [ca, all_atom]
  compute_ss: true

Workflow per sample:

  1. Designability — ProteinMPNN redesigns the sequence → fold with ESMFold → compute scRMSD vs generated structure

  2. Codesignability — Fold the original PDB sequence → compute scRMSD vs generated structure

  3. Secondary structure — Compute alpha/beta/coil fractions via biotite

  4. Sequence recovery — Compare ProteinMPNN output to original sequence

Key metrics:

MetricColumn patternWhat it measuresGood value
Designability_res_scRMSD_{mode}_{model}Best scRMSD over MPNN sequences< 2.0 A
Single-seq designability_res_scRMSD_single_{mode}_{model}scRMSD of first MPNN sequence< 2.0 A
Codesignability_res_co_scRMSD_{mode}_{model}scRMSD using original sequence< 2.0 A
Best MPNN sequence_res_mpnn_best_sequenceSequence with lowest scRMSD—
Secondary structure_res_ss_alpha, _res_ss_beta, _res_ss_coilStructure composition—
pLDDT_res_pLDDTRefolded confidence> 0.7

Note: {mode} is ca, bb3o, or all_atom. {model} is esmfold or colabfold. The number of MPNN redesign sequences is controlled by designability_num_seq (default 8).

Motif Evaluation (Monomer Motif)

Evaluates motif scaffolding by measuring how well the generated scaffold preserves the target motif. This is for monomer motif scaffolding (no binder/target complex).

protein_type: monomer_motif

dataset:
  motif_task_name: 1QJG_AA_TIP
  unindexed: true

metric:
  compute_motif_metrics: true
  compute_monomer_metrics: true   # also run monomer metrics on the full structure
  motif_rmsd_modes: [ca, all_atom]
  designability_modes: [ca]
  codesignability_modes: [ca, all_atom]

Workflow per sample:

  1. Motif alignment — Align the ground-truth motif into the generated structure (indexed or unindexed)

  2. Direct motif RMSD — Compare generated structure at motif positions vs ground truth

  3. Motif sequence recovery — Compare generated sequence at motif positions vs ground truth

  4. Designability — ProteinMPNN redesign → fold → compute full-structure + motif-region scRMSD

  5. Codesignability — Fold original sequence → compute full-structure + motif-region scRMSD

  6. Secondary structure — Compute alpha/beta/coil fractions

Key metrics (motif-specific):

MetricColumn patternWhat it measuresGood value
Motif RMSD_res_motif_rmsd_{mode}Generated vs ground-truth motif< 1.0 A (CA), < 2.0 A (all-atom)
Motif sequence recovery_res_motif_seq_recFraction of motif residues matching1.0 (perfect)
Motif-region designability_res_des_motif_scRMSD_{mode}_{model}Motif region preserved after MPNN+refold< 1.0 A
Motif-region codesignability_res_co_motif_scRMSD_{mode}_{model}Motif region preserved after refold< 1.0 A
Motif Binder Evaluation

Evaluates designs that combine binder refolding with motif preservation. The generated protein must both bind a target and preserve a functional motif. There are two variants depending on whether the target is a protein or a ligand:

Variantresult_typeFoldingInverse FoldingExtra motif criteria
Motif Protein Bindermotif_protein_binderColabDesign / RF3ProteinMPNN / SolubleMPNNmotif RMSD, seq recovery
Motif Ligand Binder (AME)motif_ligand_binderRF3LigandMPNNmotif RMSD, seq recovery, ligand clashes
Motif Protein Binder

Adds motif constraints on top of standard protein binder evaluation. Use when the designed protein must preserve specific structural motifs while binding a protein target.

protein_type: motif_binder

metric:
  compute_motif_binder_metrics: true
  binder_folding_method: colabdesign   # or rf3_latest
  sequence_types: [self, mpnn_fixed]
  inverse_folding_model: soluble_mpnn  # protein-only

Standalone evaluation:

python -m proteinfoundation.evaluate --config-name evaluate_motif_binder \
    dataset.task_name=MY_TASK \
    metric.binder_folding_method=colabdesign \
    metric.inverse_folding_model=soluble_mpnn
Motif Ligand Binder (AME)

Adds motif constraints on top of ligand binder evaluation, with ligand clash detection. This is the evaluation mode used by the AME pipeline.

protein_type: motif_binder

metric:
  compute_motif_binder_metrics: true
  binder_folding_method: rf3_latest
  sequence_types: [self, mpnn_fixed]
  inverse_folding_model: ligand_mpnn

  # Pre/post-refolding interface metrics
  compute_pre_refolding_metrics: true
  pre_refolding:
    bioinformatics: true
    tmol: true

  compute_refolded_structure_metrics: true
  refolded:
    bioinformatics: true
    tmol: true

  # Optional monomer metrics on the binder chain
  compute_monomer_metrics: false
  monomer_folding_models: [esmfold]

Workflow per sample (both variants):

  1. Binder refolding — Same as standard binder evaluation: inverse folding redesigns the binder sequence, then refold and compute binding confidence metrics (i_pAE, i_pTM, pLDDT, scRMSD)

  2. Motif overlay — Compute motif RMSD and motif sequence recovery on the predicted structure, measuring how well the functional motif is preserved after refolding

  3. Ligand clash detection (ligand variant only) — Check for steric clashes between the refolded structure and the ligand

  4. Interface metrics — Pre- and post-refolding bioinformatics, force field, and hydrogen bond analysis

  5. Optional monomer metrics — If enabled, run designability/codesignability on the binder chain alone

Key metrics (combines binder + motif):

MetricWhat it measuresGood value
{seq}_complex_i_pAEBinding confidence< 10 (protein), varies (ligand)
{seq}_complex_pLDDTStructure confidence> 0.8
{seq}_binder_scRMSDDesign preserved after refold< 2.0 A
{seq}_motif_rmsd_predMotif RMSD in predicted structure< 2.0 A (protein), < 1.5 A (ligand)
{seq}_correct_motif_sequenceMotif residues match ground truth>= 1.0 (perfect)
{seq}_has_ligand_clashesSteric clashes with ligand (ligand only)< 0.5 (no clashes)

Joint per-redesign success: A sample is "successful" when at least one redesign passes ALL binder criteria AND ALL motif criteria simultaneously. This is evaluated per redesign index, ensuring the same predicted structure satisfies both sets of requirements.

Comparison across all evaluation types:

AspectBinder EvalMonomer Motif EvalMotif Protein BinderMotif Ligand Binder
protein_typebindermonomer_motifmotif_bindermotif_binder
result_typeprotein_binder / ligand_bindermonomer_motifmotif_protein_bindermotif_ligand_binder
Folding modelAF2 / RF3ESMFoldAF2 / RF3RF3 (ligand-aware)
Inverse foldingProteinMPNN / SolubleMPNNProteinMPNNProteinMPNN / SolubleMPNNLigandMPNN
Binder metricsYesNoYesYes
Motif RMSDNoYes (direct + refolded)Yes (on predicted)Yes (on predicted)
Ligand contextNo / YesNoNoYes
Ligand clashesNoNoNoYes
Ranking Criteria (Best Redesign Selection)

For binder and motif binder evaluation, multiple redesigned sequences are evaluated per sample. The "best" redesign is selected using a composite score from ranking criteria.

Default ranking:

  • Protein binder: minimize i_pAE (scale 1.0)

  • Ligand binder: minimize min_ipAE (scale 1.0)

Custom ranking via metric.ranking_criteria:

metric:
  ranking_criteria:
    i_pAE:
      scale: 1.0
      direction: minimize
    pLDDT:
      scale: 0.5
      direction: maximize

The composite score is sum(metric_value * scale * direction_sign) where direction_sign is +1 for minimize, -1 for maximize. The redesign with the lowest composite score is selected as best.

For motif binder evaluation, use metric.motif_ranking_criteria with the same format.

Optional ESM Metrics

ESM pseudo-perplexity can be computed alongside binder evaluation to assess sequence plausibility:

metric:
  compute_esm_metrics: true
  esm_model: facebook/esm2_t33_650M_UR50D   # default

Columns produced (per sequence type):

ColumnDescription
{seq}_esm_pseudo_perplexityESM pseudo-perplexity (lower = more natural)
{seq}_esm_log_likelihoodESM log-likelihood

Uses ESM_DIR or CACHE_DIR environment variable for model cache.

Job Parallelization

Evaluation can be split across parallel jobs for large datasets:

job_id: 0          # This job's index (0-based)
eval_njobs: 8      # Total number of parallel jobs

Each job evaluates a shard of the input PDBs. Output CSVs are named {eval_type}_results_{config_name}_{job_id}.csv (e.g. binder_results_evaluate_0.csv). The analyze step automatically discovers and merges all per-job CSVs.

Evaluating External PDB Files

To evaluate PDB files not generated by the pipeline (e.g. from external models), use the evaluate_from_pdb_dir configs:

# Protein/ligand binder evaluation on external PDBs
complexa evaluate configs/evaluate_from_pdb_dir.yaml \
    dataset.sample_storage_path=/path/to/pdbs \
    dataset.task_name=MY_TARGET

# AME motif binder evaluation on external PDBs
complexa evaluate configs/evaluate_ame_from_pdb_dir.yaml \
    dataset.sample_storage_path=/path/to/pdbs \
    dataset.task_name=MY_TASK

Key config differences from pipeline evaluation:

SettingPipeline (binder_evaluate.yaml)External PDB (evaluate_from_pdb_dir.yaml)
input_modegeneratedpdb_dir
sample_storage_pathSet by pipelineUser provides path to PDB directory
ignore_generated_pdb_suffix—_binder.pdb (strips suffix to find target)

Motif Scaffolding Deep Dive

Tip Atoms vs All-Atom

The atom_selection_mode in the motif task definition controls which atoms are used when defining the motif region and computing motif RMSD:

ModeAtoms includedWhen to use
all_atomAll heavy atoms in each motif residue (N, CA, C, O, CB, side chain)When the full atomic detail of the motif matters (e.g. active sites with precise side-chain geometry)
tip_atomsOnly the terminal/tip atoms of each side chainWhen the backbone is flexible but side-chain endpoint placement matters (e.g. functional groups that must reach specific coordinates)
caOnly C-alpha atomsBackbone-only motif matching
bb3oN, CA, C, O backbone atomsBackbone with oxygen orientation
Where tip atoms are defined

The per-residue tip atom definitions live in src/proteinfoundation/utils/constants.py as SIDECHAIN_TIP_ATOMS. This dictionary maps each amino acid to its functional/terminal atoms:

SIDECHAIN_TIP_ATOMS = {
    "ALA": ["CA", "CB"],
    "ARG": ["CD", "CZ", "NE", "NH1", "NH2"],
    "ASP": ["CB", "CG", "OD1", "OD2"],
    "ASN": ["CB", "CG", "ND2", "OD1"],
    "CYS": ["CA", "CB", "SG"],
    "GLU": ["CG", "CD", "OE1", "OE2"],
    "GLN": ["CG", "CD", "NE2", "OE1"],
    "GLY": [],                              # no side chain
    "HIS": ["CB", "CG", "CD2", "CE1", "ND1", "NE2"],
    "LYS": ["CE", "NZ"],
    "PHE": ["CB", "CG", "CD1", "CD2", "CE1", "CE2", "CZ"],
    "TRP": ["CB", "CG", "CD1", "CD2", "CE2", "CE3", "CZ2", "CZ3", "CH2", "NE1"],
    "TYR": ["CB", "CG", "CD1", "CD2", "CE1", "CE2", "CZ", "OH"],
    # ... etc for all 20 amino acids
}

At evaluation time, src/proteinfoundation/utils/motif_utils.py::_select_motif_atoms() reads this dictionary to build the atom mask for each motif residue:

# For each residue in the motif, only these atoms are included in the mask
tip_atom_names = SIDECHAIN_TIP_ATOMS.get(residue_name, [])
selected = [atom_order[name] for name in tip_atom_names
            if name in atom_order and atom_order[name] in available_atoms]

This means:

  • Tip atoms mode focuses on where the side chains end up (functional groups, charged tips, ring systems) rather than backbone placement.

  • GLY has no tip atoms (empty list), so glycine motif residues contribute nothing to tip-atom RMSD.

  • The atom indices map into the 37-slot UNIFIED_ATOM37_ENCODING also defined in constants.py, which provides the canonical atom ordering for all residue types.

How atom_selection_mode affects metrics

When atom_selection_mode is not all_atom (e.g. tip_atoms), the motif mask contains only the selected atoms. This means CA-based RMSD modes would have an empty atom intersection. To keep columns consistent, the evaluation auto-fills CA-based motif metrics with 0.0:

atom_selection_mode = "all_atom":
  _res_motif_rmsd_ca        → computed normally
  _res_motif_rmsd_all_atom  → computed normally

atom_selection_mode = "tip_atoms":
  _res_motif_rmsd_ca        → auto-filled with 0.0 (no CA atoms in mask)
  _res_motif_rmsd_all_atom  → computed on tip atoms only

This auto-fill ensures that success criteria columns always exist and CA-based threshold checks pass automatically for non-CA motifs.

Configuration

The atom_selection_mode is set per task in the motif task dictionary (e.g. design_tasks/motif_dict.yaml):

1QJG_AA_TIP:
  contig: "15/A45-65/20"
  pdb_path: /path/to/1QJG.pdb
  atom_selection_mode: tip_atoms
  motif_only: true

1QJG_AA_NATIVE:
  contig: "15/A45-65/20"
  pdb_path: /path/to/1QJG.pdb
  atom_selection_mode: all_atom
  motif_only: true

The evaluation config references the task by name:

dataset:
  motif_task_name: 1QJG_AA_TIP   # Uses tip_atoms mode
Motif Alignment Modes: Indexed vs Unindexed

Controls how the ground-truth motif is aligned into the generated structure.

dataset:
  motif_task_name: 1QJG_AA_TIP
  unindexed: true    # or false (default)
Indexed Mode (unindexed: false)

The motif occupies known positions in the generated structure, determined by the contig string.

Contig: "15/A45-65/20"
         ^^            ^^
         scaffold       scaffold
              ^^^^^^^^^
              motif (residues 45-65 of chain A)

Generated structure:  [---scaffold---][===MOTIF===][---scaffold---]
                      positions 1-15   16-36        37-56

Motif residues are placed at positions 16-36 → direct comparison.

When to use: When the generative model explicitly places motif residues at contig-specified positions (the standard case for most generation pipelines).

Variable scaffolds: If different samples have different scaffold lengths, provide a per-sample contig CSV. You can set it explicitly or rely on auto-discovery.

Option 1 — Explicit path:

metric:
  motif_info_csv: /path/to/motif_info.csv

Option 2 — Auto-discovery: If motif_info_csv is not set, the evaluator looks for a file named {motif_task_name}_{job_id}_motif_info.csv in:

  1. The evaluation output directory (where copy_motif_csvs copies CSVs)

  2. sample_storage_path

  3. The parent directory of sample_storage_path

Indexed mode requires this CSV to be present; if none is found, evaluation raises FileNotFoundError with instructions.

CSV format: The CSV must have a contig column. For reliable per-sample matching, include a filename column (extensionless PDB stem). If the column is present, matching falls back to sample_num (parsed from filenames like job_0_id_10_motif_TASK) or to row order (same order as PDBs).

Unindexed Mode (unindexed: true)

The motif residues are not at known positions. The evaluation uses greedy coordinate matching to find them.

Generated structure:  [------full structure------]
Ground-truth motif:   [==MOTIF==]

Algorithm:
  For each motif residue:
    1. Compute RMSD to every generated residue (using overlapping atoms)
    2. Optionally filter by amino acid type match
    3. Select the closest unmatched residue

When to use:

  • When samples are refolded structures (not direct model outputs) — refolding may reorder or renumber residues

  • When the generation method does not preserve contig indexing

  • When evaluating external model outputs where motif positions are unknown

Important: The motif coordinates must be centered (near the origin) for unindexed matching to work correctly, as the algorithm searches for the best coordinate overlap.

Contig Strings

A contig string encodes the structure layout as alternating scaffold and motif segments, separated by /:

"15/A45-65/20/A20-30/10"
 ↑   ↑       ↑   ↑      ↑
 scaffold  scaffold  scaffold
     motif       motif
     (chain A,   (chain A,
      res 45-65)  res 20-30)

Parsing rules:

PartFormatMeaning
Integer15Scaffold segment of length 15
Chain + rangeA45-65Motif from chain A, residues 45 to 65 (inclusive)
Chain + singleA33Single motif residue from chain A, position 33

Example dissection:

Contig: "8/A9-16/17/A34-41/8"

Segment 1: scaffold, length 8    → positions 1-8
Segment 2: motif A9-16, length 8 → positions 9-16
Segment 3: scaffold, length 17   → positions 17-33
Segment 4: motif A34-41, length 8 → positions 34-41
Segment 5: scaffold, length 8    → positions 42-49

Total length: 49 residues, 16 motif residues in 2 segments

Analysis Step

The analysis step loads evaluation CSVs, computes aggregate metrics, and organizes output.

complexa analyze configs/evaluate.yaml
# or
python -m proteinfoundation.analyze --config-name evaluate
What it does
  1. Load results — Reads all {result_type}_results_*.csv files from the output directory

  2. Merge monomer results — For monomer_motif and binder result types, merges monomer metrics into the primary results (handles column conflicts with _monomer suffix)

  3. Compute pass rates — Filters by thresholds and computes success rates, grouped by experimental parameters

  4. Compute diversity — FoldSeek (structural) and MMseqs2 (sequence) diversity on full and filtered subsets

  5. Secondary structure — Aggregate SS fractions across groups

  6. Organize output — Moves result files into categorized subdirectories

Analysis Modes

Controlled by aggregation.analysis_modes:

ModeWhat it computesValid for
binderSuccess rates, interface metrics, binder diversityprotein_binder, ligand_binder
monomerDesignability/codesignability pass rates, monomer diversityall result types
motifMotif RMSD pass rates, motif success criteria, motif diversitymonomer_motif
motif_binderJoint binder + motif success filtering, per-task pass rates, diversitymotif_protein_binder, motif_ligand_binder

Defaults (from code, configs may override):

  • protein_binder / ligand_binder: [binder, monomer]

  • monomer: [monomer]

  • monomer_motif: [motif, monomer]

  • motif_protein_binder / motif_ligand_binder: [motif_binder]

The pipeline configs may add additional modes. For example, ame_analyze.yaml uses [motif_binder, monomer] to also compute monomer designability metrics.

Monomer Merging for Combined Result Types

When result_type is monomer_motif or a binder type, both motif/binder results and monomer results are evaluated separately by evaluate. The analyze step automatically merges them:

motif_results_*.csv  +  monomer_results_*.csv  →  merged DataFrame

Column conflict resolution: If a column exists in both CSVs (e.g. _res_scRMSD_ca_esmfold), the monomer version is renamed with a _monomer suffix:

motif CSV column:   _res_scRMSD_ca_esmfold           (kept as-is)
monomer CSV column: _res_scRMSD_ca_esmfold           → _res_scRMSD_ca_esmfold_monomer

Columns unique to the monomer CSV (e.g. _res_scRMSD_single_ca_esmfold) are added directly.

The analysis functions transparently handle this via resolve_monomer_column(), which looks for the canonical column name first, then falls back to the _monomer variant.

Output Directory Structure

After analyze, results are organized into subdirectories:

evaluation_results/{run_name}/
├── motif_metrics/                    # Motif pass rates, success rates
│   └── motif_results_*_combined.csv
├── monomer_metrics/                  # Designability, codesignability
├── filter_results/                   # Filtered subsets (success, RMSD thresholds)
├── diversity/                        # FoldSeek + MMseqs cluster results
│   ├── foldseek_clusters_*/
│   └── mmseqs_clusters_*/
├── amino_acid_distribution/          # Residue type distributions
├── secondary_structure/              # SS fractions
└── RAW_*.csv                         # Combined raw results (all columns)
Diversity Computation

FoldSeek (structural diversity) — Clusters samples by TM-score similarity:

ModeScopeAvailable for
complexFull complex structurebinder
binderBinder chain onlybinder, motif_binder
interfaceInterface residues onlybinder
monomerMonomer structuremonomer, motif

Alignment type 1 (structure only) and 2 (structure + sequence) are both computed.

MMseqs2 (sequence diversity) — Clusters samples by sequence identity:

ParameterDefaultDescription
min_seq_id0.1Minimum sequence identity for clustering
coverage0.7Minimum alignment coverage

Both diversity methods are run on all samples and on successful samples (filtered subset per sequence type).

Analysis Output Files
FileDescription
res_nsamples.csvSample counts per run
res_designability.csvDesignability pass rates (2 Å threshold)
res_codesignability_{mode}.csvCodesignability pass rates per mode
res_filter_binder_pass_{suffix}.csvProtein binder success rates
res_filter_ligand_pass_{suffix}.csvLigand binder success rates
res_filter_motif_binder_pass_{suffix}.csvMotif binder joint success rates
res_motif_binder_per_task_pass_rates.csvPer-task motif binder pass rates
res_ss_biot_{suffix}.csvSecondary structure fractions
res_type_prop_{suffix}.csvResidue type proportions
res_aa_distribution_{suffix}.csvAA distribution
res_div_foldseek_{mode}_{suffix}.csvFoldSeek diversity
res_div_mmseqs_{suffix}.csvMMseqs diversity
success_criteria_*.jsonSaved thresholds used for filtering

Result CSV Reference

Identifier Columns (all result types)
ColumnDescription
id_genSample identifier (unique per generated structure)
pdb_pathPath to the generated PDB file
LProtein length (residue count)
run_nameExperiment name from config
ckpt_pathCheckpoint path used for generation
Protein Binder Result Columns

Written to binder_results_*.csv by binder evaluation with binder_folding_method: colabdesign.

Per sequence type (self, mpnn, mpnn_fixed):

ColumnDescription
{seq}_complex_i_pAEBest interface PAE (lower = better binding)
{seq}_complex_i_pTMBest interface pTM (higher = better)
{seq}_complex_pLDDTBest overall pLDDT (higher = more confident)
{seq}_complex_pTMBest overall pTM score
{seq}_binder_scRMSDBest binder backbone RMSD after refolding
{seq}_binder_scRMSD_caBinder CA-only RMSD after refolding
{seq}_binder_scRMSD_bb3Binder BB3 (N, CA, C) RMSD after refolding
{seq}_binder_scRMSD_bb3oBinder BB3O (N, CA, C, O) RMSD after refolding
{seq}_binder_scRMSD_allatomBinder all-atom RMSD after refolding
{seq}_complex_scRMSDBest full-complex RMSD after refolding
{seq}_complex_scRMSD_caComplex CA-only RMSD after refolding
{seq}_binder_pLDDTBinder-only pLDDT
{seq}_complex_pdb_pathPath to best refolded structure
{seq}_sequenceBest sequence selected by ranking
{seq}_complex_i_pAE_allAll i_pAE values (list, one per MPNN sequence)
{seq}_binder_scRMSD_allAll scRMSD values (list)
{seq}_aa_countsAmino acid composition (dict)
{seq}_aa_interface_countsInterface residue AA composition (dict)

Optional force field metrics (if compute_pre_refolding_metrics or compute_refolded_structure_metrics enabled):

ColumnDescription
generated_n_interface_hbonds_tmolH-bond count (generated structure)
generated_total_interface_hbond_energy_tmolH-bond energy (kcal/mol)
refolded_{seq}_n_interface_hbonds_tmolH-bond count (refolded structure)
generated_binder_interface_scShape complementarity
generated_binder_interface_dSASABuried surface area (A^2)
Ligand Binder Result Columns

Written to binder_results_*.csv by binder evaluation with binder_folding_method: rf3_latest. Includes all protein binder columns above, plus:

Additional RF3 confidence metrics (per sequence type):

ColumnDescription
{seq}_complex_min_ipAEMinimum interface PAE (primary ranking metric for ligand binders)
{seq}_complex_min_ipSAEMinimum interface pSAE (higher = better)
{seq}_complex_avg_ipSAEAverage interface pSAE
{seq}_complex_max_ipSAEMaximum interface pSAE
{seq}_complex_ranking_scoreRF3 composite ranking score
{seq}_complex_has_clash1.0 if clash detected, 0.0 otherwise

Ligand-specific RMSD metrics (per sequence type):

ColumnDescription
{seq}_binder_scRMSD_caBinder CA-only RMSD after refolding
{seq}_binder_scRMSD_allatomBinder all-atom RMSD after refolding
{seq}_ligand_scRMSDDirect ligand RMSD (generated vs refolded)
{seq}_ligand_scRMSD_aligned_bbLigand RMSD after aligning binder backbone
{seq}_ligand_scRMSD_aligned_allatomLigand RMSD after aligning binder all-atoms
Monomer Result Columns

Written to monomer_results_*.csv by monomer evaluation.

ColumnDescription
_res_scRMSD_{mode}_{model}Best designability scRMSD (min over N MPNN sequences)
_res_scRMSD_{mode}_{model}_allAll designability scRMSD values (list)
_res_scRMSD_single_{mode}_{model}scRMSD of first MPNN sequence only
_res_co_scRMSD_{mode}_{model}Best codesignability scRMSD
_res_co_scRMSD_{mode}_{model}_allAll codesignability scRMSD values (list)
_res_mpnn_sequencesAll MPNN-generated sequences (list)
_res_mpnn_best_sequenceBest MPNN sequence (by RMSD)
_res_co_sequence_recoverySequence recovery (MPNN vs original)
_res_ss_alphaAlpha helix fraction
_res_ss_betaBeta sheet fraction
_res_ss_coilCoil fraction

Mode/model substitutions:

  • {mode}: ca (C-alpha only), all_atom (all heavy atoms), bb3o (N, CA, C, O)

  • {model}: esmfold, colabfold

Example column names:

  • _res_scRMSD_ca_esmfold — Best CA designability with ESMFold

  • _res_co_scRMSD_all_atom_esmfold — Best all-atom codesignability with ESMFold

  • _res_scRMSD_single_ca_esmfold — Single-sequence CA designability

Motif Result Columns

Written to motif_results_*.csv by motif evaluation. Includes all monomer columns above plus:

ColumnDescription
contig_stringContig used for this sample's motif alignment
_res_motif_rmsd_caDirect motif RMSD, CA atoms
_res_motif_rmsd_all_atomDirect motif RMSD, all atoms
_res_motif_seq_recMotif sequence recovery (0.0 - 1.0)
_res_scRMSD_{mode}_{model}Best full-structure designability scRMSD (at motif argmin)
_res_scRMSD_{mode}_{model}_allAll full-structure designability scRMSD values
_res_des_motif_scRMSD_{mode}_{model}Best motif-region designability scRMSD
_res_des_motif_scRMSD_{mode}_{model}_allAll motif-region designability scRMSD values
_res_co_scRMSD_{mode}_{model}Best full-structure codesignability scRMSD (at motif argmin)
_res_co_scRMSD_{mode}_{model}_allAll full-structure codesignability scRMSD values
_res_co_motif_scRMSD_{mode}_{model}Best motif-region codesignability scRMSD
_res_co_motif_scRMSD_{mode}_{model}_allAll motif-region codesignability scRMSD values
_res_mpnn_sequencesMPNN-generated sequences
_res_mpnn_best_sequenceBest MPNN sequence (by motif-region RMSD)

Important: For motif evaluation, "best" means the sequence whose motif-region scRMSD is lowest (argmin of motif scRMSD), not the full-structure minimum. The full-structure scRMSD reported is the value at that same index.

Motif Binder Result Columns

Written to motif_binder_results_*.csv by motif binder evaluation. Used by both motif_protein_binder and motif_ligand_binder result types. Combines binder and motif columns.

Metadata columns:

ColumnDescription
task_nameMotif task name
result_typemotif_protein_binder or motif_ligand_binder

Binder columns (same as binder results, per sequence type):

ColumnDescription
{seq}_complex_i_pAEBest interface PAE (lower = better binding)
{seq}_complex_i_pTMBest interface pTM
{seq}_complex_pLDDTBest overall pLDDT
{seq}_binder_scRMSDBest binder backbone RMSD after refolding
{seq}_binder_scRMSD_caCA-only binder scRMSD
{seq}_binder_scRMSD_bb3BB3 (N, CA, C) binder scRMSD
{seq}_complex_pdb_pathPath to best refolded structure

Generated-structure motif columns (computed on the generated structure before refolding):

ColumnDescription
motif_rmsd_genMotif RMSD in the generated (pre-refolding) structure
motif_seq_rec_genMotif sequence recovery in generated structure
correct_motif_sequence_genWhether motif sequence is fully recovered in generated structure
has_ligand_clashes_genLigand clash flag in generated structure (ligand binder only)

Predicted-structure motif columns (per sequence type, with _all list variants for per-redesign evaluation):

ColumnDescription
{seq}_motif_rmsd_predBest motif RMSD in the predicted/refolded structure
{seq}_motif_rmsd_pred_allMotif RMSD per redesign (list)
{seq}_motif_seq_recMotif sequence recovery fraction
{seq}_correct_motif_sequenceWhether motif sequence is fully recovered (best)
{seq}_correct_motif_sequence_allMotif sequence recovery per redesign (list)
{seq}_has_ligand_clashesLigand clash flag (ligand binder only, best)
{seq}_has_ligand_clashes_allLigand clash flag per redesign (list, ligand only)

Interface metric columns (if pre/post-refolding metrics enabled):

ColumnDescription
generated_n_interface_hbonds_tmolH-bond count (generated structure)
generated_total_interface_hbond_energy_tmolH-bond energy (kcal/mol)
refolded_{seq}_n_interface_hbonds_tmolH-bond count (refolded structure)
generated_binder_interface_scShape complementarity
generated_binder_interface_dSASABuried surface area (A^2)

Reading Results in Python

Loading and Basic Inspection
import pandas as pd

# Load motif results
df = pd.read_csv("evaluation_results/my_run/motif_results_my_config_combined.csv")

# Check available columns
print(df.columns.tolist())

# Basic stats
print(f"Samples: {len(df)}")
print(f"Mean motif RMSD (CA): {df['_res_motif_rmsd_ca'].mean():.2f}")
print(f"Mean motif seq rec:   {df['_res_motif_seq_rec'].mean():.2f}")
Working with List Columns

Some columns store lists of values (one per MPNN sequence). After loading from CSV, these are strings that need parsing:

import ast

# Parse list columns
df["_res_scRMSD_ca_esmfold_all"] = df["_res_scRMSD_ca_esmfold_all"].apply(ast.literal_eval)

# Get the number of sequences evaluated per sample
df["n_seqs"] = df["_res_scRMSD_ca_esmfold_all"].apply(len)
Filtering Successful Motif Scaffolds
# Direct motif RMSD filter
good_motif = df[
    (df["_res_motif_rmsd_all_atom"] < 2.0) &
    (df["_res_motif_seq_rec"] >= 1.0)
]
print(f"Motif RMSD pass rate: {len(good_motif) / len(df) * 100:.1f}%")

# Full success criteria (motif + codesignability)
success = df[
    (df["_res_motif_seq_rec"] >= 1.0) &
    (df["_res_motif_rmsd_ca"] < 1.0) &
    (df["_res_motif_rmsd_all_atom"] < 2.0) &
    (df["_res_co_scRMSD_all_atom_esmfold"] < 2.0)
]
print(f"Motif success rate: {len(success) / len(df) * 100:.1f}%")
Filtering Successful Protein Binders
# Standard protein binder success
success = df[
    (df["mpnn_complex_i_pAE"] * 31 <= 7.0) &
    (df["mpnn_complex_pLDDT"] >= 0.9) &
    (df["mpnn_binder_scRMSD"] < 1.5)
]
print(f"Protein binder success rate: {len(success) / len(df) * 100:.1f}%")
Filtering Successful Ligand Binders
# Default ligand binder success thresholds
success = df[
    (df["mpnn_complex_min_ipAE"] * 31 < 2.0) &
    (df["mpnn_binder_scRMSD_ca"] < 2.0) &
    (df["mpnn_ligand_scRMSD_aligned_allatom"] < 5.0)
]
print(f"Ligand binder success rate: {len(success) / len(df) * 100:.1f}%")
Filtering Successful Motif Protein Binders
# Load motif binder results
df = pd.read_csv("evaluation_results/my_run/motif_binder_results_combined.csv")

# Joint binder + motif success (protein target)
success = df[
    (df["mpnn_fixed_complex_i_pAE"] * 31 <= 7.0) &
    (df["mpnn_fixed_complex_pLDDT"] >= 0.8) &
    (df["mpnn_fixed_binder_scRMSD_ca"] < 2.0) &
    (df["mpnn_fixed_motif_rmsd_pred"] < 2.0) &
    (df["mpnn_fixed_correct_motif_sequence"] >= 1.0)
]
print(f"Motif protein binder success rate: {len(success) / len(df) * 100:.1f}%")
Filtering Successful Motif Ligand Binders (AME)
# Load motif binder results
df = pd.read_csv("evaluation_results/my_ame_run/motif_binder_results_combined.csv")

# Joint binder + motif success (ligand target — includes clash check)
success = df[
    (df["mpnn_fixed_binder_scRMSD_bb3"] <= 2.0) &
    (df["mpnn_fixed_motif_rmsd_pred"] <= 1.5) &
    (df["mpnn_fixed_correct_motif_sequence"] >= 1.0) &
    (df["mpnn_fixed_has_ligand_clashes"] < 0.5)
]
print(f"Motif ligand binder success rate: {len(success) / len(df) * 100:.1f}%")
Comparing Across Experiments
# Load multiple experiments
dfs = []
for run in ["run_A", "run_B", "run_C"]:
    d = pd.read_csv(f"evaluation_results/{run}/motif_results_*_combined.csv")
    d["experiment"] = run
    dfs.append(d)

df_all = pd.concat(dfs, ignore_index=True)

# Compare by experiment
summary = df_all.groupby("experiment").agg(
    motif_rmsd_mean=("_res_motif_rmsd_all_atom", "mean"),
    motif_rmsd_median=("_res_motif_rmsd_all_atom", "median"),
    seq_rec_mean=("_res_motif_seq_rec", "mean"),
    des_rmsd_mean=("_res_scRMSD_ca_esmfold", "mean"),
)
print(summary)

Success Criteria

Result TypeKey Thresholds (defaults)
protein_binderi_pAE*31 <= 7.0, pLDDT >= 0.9, scRMSD_ca < 1.5 A
ligand_bindermin_ipAE*31 < 2.0, scRMSD_ca < 2.0 A, ligand scRMSD < 5.0 A
monomerdesignability scRMSD < 2.0 A
monomer_motifmotif RMSD + codesignability (see below)
motif_protein_binderbinder (i_pAE, pLDDT, scRMSD) + motif RMSD < 2.0 + seq recovery >= 1.0
motif_ligand_binderbinder scRMSD_bb3 <= 2.0 + motif RMSD <= 1.5 + seq recovery + no clashes

All thresholds are customizable via aggregation.success_thresholds in the analysis config. Details for each type below.

Protein Binder Success

Default thresholds (result_type: protein_binder), based on AlphaProteo criteria:

MetricColumnThresholdDirection
i_pAE{seq}_complex_i_pAE* 31 <= 7.0Lower is better
pLDDT{seq}_complex_pLDDT>= 0.9Higher is better
scRMSD_ca{seq}_binder_scRMSD_ca< 1.5 ALower is better

A sample passes if all three thresholds are met for at least one redesigned sequence.

Ligand Binder Success

Default thresholds (result_type: ligand_binder):

MetricColumnThresholdDirection
min_ipAE{seq}_complex_min_ipAE* 31 < 2.0Lower is better
scRMSD_ca{seq}_binder_scRMSD_ca< 2.0 ALower is better
scRMSD_aligned_allatom{seq}_ligand_scRMSD_aligned_allatom< 5.0 ALower is better

A sample passes if all three thresholds are met for at least one redesigned sequence.

Customizing Binder Thresholds

Both protein and ligand binder thresholds can be overridden in the analysis config via success_thresholds. Each entry has a metric name, threshold, comparison operator, optional scale factor, and column prefix:

# In binder_analyze.yaml or ligand_binder_analyze.yaml
aggregation:
  success_thresholds:
    i_pAE:
      threshold: 10.0       # less strict than default 7.0
      op: "<="
      scale: 31.0
      column_prefix: complex
    pLDDT:
      threshold: 0.8        # less strict than default 0.9
      op: ">="
      scale: 1.0
      column_prefix: complex
    scRMSD_ca:
      threshold: 2.0        # less strict than default 1.5
      op: "<"
      scale: 1.0
      column_prefix: binder

If success_thresholds is null (the default), the built-in defaults for the result_type are used (DEFAULT_PROTEIN_BINDER_THRESHOLDS or DEFAULT_LIGAND_BINDER_THRESHOLDS).

Monomer Success
MetricDefault thresholdDirection
_res_scRMSD_ca_{model}< 2.0 ALower is better
_res_co_scRMSD_ca_{model}< 2.0 ALower is better
_res_co_scRMSD_all_atom_{model}< 2.0 ALower is better
Motif Success (Built-in Presets)

Two presets are evaluated automatically during analyze:

motif_success — Direct motif quality:

  1. _res_motif_seq_rec >= 1.0 (perfect sequence recovery)

  2. _res_motif_rmsd_ca < 1.0 A (CA motif RMSD)

  3. _res_motif_rmsd_all_atom < 2.0 A (all-atom motif RMSD)

  4. _res_co_scRMSD_all_atom_{model} < 2.0 A (full-structure codesignability)

refolded_motif_success — Refolded motif quality:

  1. _res_motif_seq_rec >= 1.0

  2. _res_co_motif_scRMSD_ca_{model} < 1.0 A (motif-region codesign CA scRMSD)

  3. _res_co_motif_scRMSD_all_atom_{model} < 2.0 A (motif-region codesign all-atom scRMSD)

  4. _res_co_scRMSD_all_atom_{model} < 2.0 A (full-structure codesignability)

Custom success criteria can be added in the config:

aggregation:
  motif_success_criteria:
    - column: "_res_motif_rmsd_ca"
      threshold: 0.5
      op: "<"
    - column: "_res_motif_seq_rec"
      threshold: 1.0
      op: ">="

Tip atoms note: For tasks with atom_selection_mode: tip_atoms, CA-based motif metrics are auto-filled with 0.0, so CA threshold checks in success criteria pass automatically. The all-atom thresholds evaluate the actual tip atom RMSD.

Motif Protein Binder Success

A sample is "successful" when at least one redesign passes ALL binder AND ALL motif criteria jointly:

Binder criteria:

MetricDefault thresholdDirection
{seq}_complex_i_pAE (scaled by 31)<= 7.0Lower is better
{seq}_complex_pLDDT>= 0.8Higher is better
{seq}_binder_scRMSD_ca< 2.0 ALower is better

Motif criteria (evaluated on the same redesign):

MetricDefault thresholdDirection
{seq}_motif_rmsd_pred< 2.0 ALower is better
{seq}_correct_motif_sequence>= 1.0 (perfect recovery)Higher is better
Motif Ligand Binder Success (AME Pipeline)

Same joint per-redesign evaluation, but with ligand-specific criteria including clash detection:

Binder criteria:

MetricDefault thresholdDirection
{seq}_binder_scRMSD_bb3<= 2.0 ALower is better

Motif criteria (evaluated on the same redesign):

MetricDefault thresholdDirection
{seq}_motif_rmsd_pred<= 1.5 ALower is better
{seq}_correct_motif_sequence>= 1.0 (perfect recovery)Higher is better
{seq}_has_ligand_clashes< 0.5 (no clashes)Lower is better
Customizing Motif Binder Thresholds

Both binder and motif criteria can be overridden in the analysis config. The motif_binder_success_thresholds has two sub-keys: binder (same format as standard binder thresholds) and motif (list of column/threshold/op dicts):

# In analyze_motif_binder.yaml or ame_analyze.yaml
aggregation:
  motif_binder_success_thresholds:
    binder:
      i_pAE:
        threshold: 8.0
        op: "<="
        scale: 31.0
        column_prefix: complex
      scRMSD:
        threshold: 2.0
        op: "<"
        scale: 1.0
        column_prefix: binder
    motif:
      - column: "{seq_type}_motif_rmsd_pred_all"
        threshold: 1.5
        op: "<"
      - column: "{seq_type}_correct_motif_sequence_all"
        threshold: 1.0
        op: ">="

The {seq_type} placeholder in motif column names is automatically resolved to the active sequence type (e.g. self, mpnn_fixed) at analysis time.


Metric Interpretation Cheat Sheet

RMSD Metrics (Lower is Better)
ValueInterpretation
< 1.0 AExcellent — near-identical structure
1.0 - 2.0 AGood — minor deviations, design likely preserved
2.0 - 4.0 AModerate — noticeable structural change
> 4.0 APoor — structure not preserved
Binding Confidence (i_pAE, Lower is Better)
ValueInterpretation
< 5Excellent binding confidence
5 - 8Good, likely successful
8 - 15Moderate, needs validation
> 15Poor prediction
Structure Confidence (pLDDT, Higher is Better)
ValueInterpretation
> 90Very high confidence
70 - 90Confident
50 - 70Low confidence
< 50Very low / disordered
Folding Models

Binder refolding (binder_folding_method):

ValueModelBest for
colabdesignAlphaFold2 Multimer (ColabDesign)Protein-protein binder refolding
rf3_latestRoseTTAFold3Protein-ligand, high accuracy
protenix_base_default_v0.5.0Protenix (base)Alternative structure prediction
protenix_mini_default_v0.5.0Protenix (mini)Faster Protenix variant

ColabDesign does not support ligand targets. Use RF3 or Protenix for ligand binder evaluation.

Monomer refolding (monomer_folding_models):

ValueModelBest for
esmfoldESMFoldFast monomer designability screening
colabfoldColabFold (AF2 monomer)Higher accuracy monomer refolding

Inverse folding (inverse_folding_model):

ValueModelBest for
protein_mpnnProteinMPNNStandard protein redesign
soluble_mpnnSolubleMPNNProtein binder redesign (solubility-aware)
ligand_mpnnLigandMPNNLigand-aware binder redesign

RF3 requires environment variables (see Environment Variables). Protenix uses its own checkpoint management.


Environment Variables

These variables are used by the evaluation and generation pipelines when external tools are involved.

RF3 (RoseTTAFold3)

Required when using RF3 for refolding (e.g. binder_folding_method: rf3_latest or RF3 reward during generation):

VariableDescription
RF3_CKPT_PATHPath to the RF3 checkpoint file (e.g. rf3_latest.pt).
RF3_EXEC_PATHPath to the RF3 executable.

If either is unset, RF3 reward/refolding will fail at initialization with a clear error.

RF3 output directory: Predictions are written to an output directory passed at call time. In config you can set search.rf3_dump_dir (e.g. under the generation config) to control where RF3 writes results; if unset, the reward runner uses a default of ./rf3_outputs (relative to the process working directory). The output directory is not created at reward initialization—it is created only when a prediction is actually run (e.g. by the binder evaluation pipeline or by the code that calls reset_dump_dir with a concrete path). This avoids leaving an empty rf3_outputs directory when RF3 is never used.

Interface Metrics

Optional pre- and post-refolding interface metrics can be enabled in config:

metric:
  pre_refolding:
    bioinformatics: true   # SC, SASA, hydrophobicity
    tmol: true             # H-bonds, electrostatics (requires TMOL)
  refolded:
    bioinformatics: true
    tmol: true
ESM Model Cache
VariableDescription
ESM_DIRDirectory for ESM model cache
CACHE_DIRFallback cache directory if ESM_DIR is unset
Ligand Evaluation
VariableDescriptionDefault
LIGAND_CLASH_THRESHOLDDistance threshold (Å) for ligand clash detection1.5
Novelty Computation

Novelty is computed using FoldSeek against reference databases. Enable via config:

Config keyDatabase
compute_novelty_pdbPDB
compute_novelty_afdbAlphaFold DB
compute_novelty_afdb_rep_v4AlphaFold DB representative v4
compute_novelty_afdb_rep_v4_geniefilters_maxlen512AlphaFold DB rep v4, filtered (max 512 residues)

Configuration Guide

For complete evaluation and analysis configuration examples -- including binder, monomer, combined, external PDB, custom ranking criteria, custom success thresholds, and training configs -- see the Configuration Guide.

Minimal Config Quick Reference

Protein binder (protein_type: binder, result_type: protein_binder):

protein_type: binder
metric:
  compute_binder_metrics: true
  binder_folding_method: colabdesign
  sequence_types: [mpnn]
  inverse_folding_model: soluble_mpnn

Ligand binder (protein_type: binder, result_type: ligand_binder):

protein_type: binder
metric:
  compute_binder_metrics: true
  binder_folding_method: rf3_latest
  sequence_types: [mpnn]
  inverse_folding_model: ligand_mpnn

Monomer (protein_type: monomer, result_type: monomer):

protein_type: monomer
metric:
  compute_monomer_metrics: true
  monomer_folding_models: [esmfold]

Motif (protein_type: monomer_motif, result_type: monomer_motif):

protein_type: monomer_motif
dataset:
  motif_task_name: 1QJG_AA_TIP
  unindexed: true
metric:
  compute_motif_metrics: true
  compute_monomer_metrics: true
  monomer_folding_models: [esmfold]
Common Evaluation Options
Config keyDefaultDescription
input_modegeneratedgenerated (pipeline output) or pdb_dir (external PDBs)
dryrunfalseShow what would be evaluated without running
show_progresstrueDisplay progress bar
file_limitnullLimit number of PDBs to evaluate (useful for testing)
job_id0Parallel job index (0-based)
eval_njobs1Total parallel jobs for splitting
metric.num_redesign_seqs8Number of MPNN redesign sequences per sample
metric.interface_cutoff8.0Distance cutoff (Å) for defining interface residues
metric.compute_esm_metricsfalseCompute ESM pseudo-perplexity
metric.compute_pre_refolding_metricsfalseCompute interface metrics on generated structure
metric.compute_refolded_structure_metricsfalseCompute interface metrics on refolded structure
metric.keep_folding_outputstrueRetain intermediate folding output files
metric.designability_num_seq8Number of MPNN sequences for monomer designability

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs Python

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Ohad Mosafi
Publisher
NVIDIA (Official)
Distributed by
NVIDIA
Source
NVIDIA/skills · skills/bionemo-complexa-sweep · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Ohad Mosafi or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download complexa-sweep.zip