From claudemol-skills
Use when comparing multiple protein designs, ranking design candidates, tracking design iterations, overlaying before/after structures, or performing batch visual QC through PyMOL.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claudemol-skills:design-comparisonThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Workflows for comparing, ranking, and screening protein design candidates in PyMOL. Composes with any design tool skill (@rfdiffusion-viz, @proteinmpnn-viz, @alphafold-validation).
Workflows for comparing, ranking, and screening protein design candidates in PyMOL. Composes with any design tool skill (@rfdiffusion-viz, @proteinmpnn-viz, @alphafold-validation).
Send all
cmd.*code via:~/.pymol-agent-bridge/bin/pymol-agent-bridge exec "..."(or heredoc for multi-line). See @pymol-fundamentals for details.
import glob, os
design_dir = "/path/to/designs"
for f in sorted(glob.glob(os.path.join(design_dir, "*.pdb"))):
name = os.path.splitext(os.path.basename(f))[0]
cmd.load(f, name)
print("Loaded %d designs" % len(cmd.get_object_list()))
# Load designs with a prefix for easy selection
import glob, os
for f in sorted(glob.glob("/path/to/designs/*.pdb")):
name = "d_" + os.path.splitext(os.path.basename(f))[0]
cmd.load(f, name)
cmd.set("grid_mode", 1)
cmd.show("cartoon")
# Color each design uniformly
for obj in cmd.get_object_list():
cmd.do("util.cbc %s" % obj)
cmd.set("grid_mode", 1)
for obj in cmd.get_object_list():
cmd.spectrum("b", "red_yellow_green_cyan_blue", obj, minimum=50, maximum=90)
cmd.show("cartoon")
cmd.set("grid_mode", 0)
cmd.load("template.pdb", "template")
cmd.load("design.pdb", "design")
cmd.align("design", "template")
cmd.color("gray70", "template")
cmd.color("marine", "design")
cmd.show("cartoon")
rms = cmd.rms_cur("design and name CA", "template and name CA")
print("Template-design RMSD: %.2f A" % rms)
cmd.load("rfdiffusion_output.pdb", "backbone")
cmd.load("af2_prediction.pdb", "af2")
cmd.align("af2 and name CA", "backbone and name CA")
rms = cmd.rms_cur("af2 and name CA", "backbone and name CA")
print("Self-consistency RMSD: %.2f A" % rms)
cmd.color("cyan", "backbone")
cmd.color("green", "af2")
# After alignment, highlight regions with large deviations
# Select well-matching and poorly-matching regions
cmd.select("good_match", "af2 within 1.0 of backbone")
cmd.select("poor_match", "af2 and not (af2 within 2.0 of backbone)")
cmd.color("green", "good_match")
cmd.color("red", "poor_match")
import glob, os
results = []
for obj in cmd.get_object_list():
# Mean pLDDT
stored.bfactors = []
cmd.iterate("%s and name CA" % obj, "stored.bfactors.append(b)")
mean_plddt = sum(stored.bfactors) / len(stored.bfactors) if stored.bfactors else 0
# Length
n_res = cmd.count_atoms("%s and name CA" % obj)
results.append((obj, mean_plddt, n_res))
# Sort by pLDDT descending
results.sort(key=lambda x: -x[1])
print("\nDesign Rankings:")
print("%-30s pLDDT Length" % "Name")
print("-" * 50)
for name, plddt, n in results:
print("%-30s %5.1f %5d" % (name, plddt, n))
import glob, os
design_dir = "/path/to/designs"
pred_dir = "/path/to/af2_predictions"
results = []
for f in sorted(glob.glob(os.path.join(pred_dir, "*.pdb"))):
pred_name = os.path.splitext(os.path.basename(f))[0]
cmd.load(f, pred_name)
# Find corresponding design
design_name = pred_name.replace("_pred", "")
design_file = os.path.join(design_dir, design_name + ".pdb")
if os.path.exists(design_file):
cmd.load(design_file, "tmp_design")
rms = cmd.align("%s and name CA" % pred_name, "tmp_design and name CA")
rmsd = rms[0]
cmd.delete("tmp_design")
else:
rmsd = -1
stored.bfactors = []
cmd.iterate("%s and name CA" % pred_name, "stored.bfactors.append(b)")
mean_plddt = sum(stored.bfactors) / len(stored.bfactors) if stored.bfactors else 0
results.append((pred_name, mean_plddt, rmsd))
# Sort by combined score (high pLDDT, low RMSD); unscored entries sort last
results.sort(key=lambda x: (-x[1], x[2] if x[2] >= 0 else float('inf')))
print("\nDesign Rankings (pLDDT + self-consistency):")
print("%-30s pLDDT RMSD Pass?" % "Name")
print("-" * 60)
for name, plddt, rmsd in results:
if rmsd < 0:
print("%-30s %5.1f N/A -" % (name, plddt))
else:
passed = "Y" if plddt > 80 and rmsd < 1.5 else "N"
print("%-30s %5.1f %5.2f %s" % (name, plddt, rmsd, passed))
# Load designs from different rounds
cmd.load("round1/best_design.pdb", "round1")
cmd.load("round2/best_design.pdb", "round2")
cmd.load("round3/best_design.pdb", "round3")
# Align all to round 1
cmd.align("round2", "round1")
cmd.align("round3", "round1")
# Color by round
cmd.color("gray70", "round1")
cmd.color("marine", "round2")
cmd.color("green", "round3")
cmd.show("cartoon")
rounds = ["round1", "round2", "round3"]
print("\nIteration Progress:")
print("%-10s pLDDT RMSD_vs_r1" % "Round")
print("-" * 35)
for r in rounds:
stored.bfactors = []
cmd.iterate("%s and name CA" % r, "stored.bfactors.append(b)")
mean_plddt = sum(stored.bfactors) / len(stored.bfactors) if stored.bfactors else 0
if r == "round1":
rmsd = 0.0
else:
rms = cmd.align("%s and name CA" % r, "round1 and name CA")
rmsd = rms[0]
print("%-10s %5.1f %5.2f" % (r, mean_plddt, rmsd))
# Load target + multiple binder designs
cmd.load("target.pdb", "target")
cmd.color("gray80", "target")
cmd.show("surface", "target")
cmd.set("transparency", 0.7, "target")
binder_colors = ["marine", "green", "salmon", "orange", "cyan"]
for i, f in enumerate(sorted(glob.glob("/path/to/binders/*.pdb"))):
name = "binder_%d" % i
cmd.load(f, name)
cmd.align(name, "target")
cmd.color(binder_colors[i % len(binder_colors)], name)
cmd.show("cartoon", name)
For motif scaffolding: compare how well each scaffold preserves the motif geometry.
cmd.load("original_motif.pdb", "motif_ref")
motif_resi = "10-30" # residue range of motif in scaffolds
for obj in cmd.get_object_list():
if obj == "motif_ref":
continue
rms = cmd.align(
"%s and resi %s and name CA" % (obj, motif_resi),
"motif_ref and name CA"
)
print("%s motif RMSD: %.2f A" % (obj, rms[0]))
| RMSD | Interpretation |
|---|---|
| < 0.5 A | Excellent — motif geometry preserved |
| 0.5-1.0 A | Good — minor backbone deviations |
| 1.0-2.0 A | Marginal — check functional contacts |
| > 2.0 A | Poor — motif likely non-functional |
import os
output_dir = os.path.expanduser("~/Desktop/design_comparison")
os.makedirs(output_dir, exist_ok=True)
# Store views for each design
designs = cmd.get_object_list()[:4] # top 4
for d in designs:
cmd.disable("all")
cmd.enable(d)
cmd.orient(d)
cmd.spectrum("b", "red_yellow_green_cyan_blue", d, minimum=50, maximum=90)
cmd.ray(1200, 900)
cmd.png(os.path.join(output_dir, d + ".png"), dpi=300)
print("Saved %s.png" % d)
cmd.enable("all")
cmd.set("grid_mode", 1)
cmd.show("cartoon")
for obj in cmd.get_object_list():
cmd.spectrum("b", "red_yellow_green_cyan_blue", obj, minimum=50, maximum=90)
cmd.ray(2400, 1800)
cmd.png(os.path.expanduser("~/Desktop/design_grid.png"), dpi=300)
cmd.set("grid_mode", 0)
grid_mode=1) is essential for screening >5 designsnpx claudepluginhub anaka/claudemol --plugin claudemol-skillsDesigns therapeutic proteins using RFdiffusion backbone generation, ProteinMPNN sequence optimization, and structure validation with ESMFold/AlphaFold2. Useful for protein binders, scaffolds, enzyme variants, and miniprotein design.
Predicts protein-ligand binding poses using DiffDock diffusion-based molecular docking. Processes PDB structures and SMILES inputs for virtual screening and structure-based drug design. Does not predict binding affinity.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.