coot-refinement
БесплатноБез исполняемых скриптовНе проверенBest practices for protein structure refinement and validation in Coot. Use when performing (1) Residue refinement operations, (2) Model building and fitting…
Об этом скилле
Coot Refinement Best Practices
This skill provides guidance for effective and safe structure refinement in Coot, based on lessons learned from crashes and workflow optimization.
Critical Configuration
Set Immediate Replacement Mode for Scripting
ALWAYS call these two before any refinement operations in scripts:
coot.set_refinement_immediate_replacement(1)
# Makes refinement synchronous — results are committed immediately.
coot.set_imol_refinement_map(imol_map)
# Tells Coot which map to refine against.
# CRITICAL: without this, refine_residues_py() silently fails (returns -2 with no atoms moved).
# Call once per session, or whenever the active map changes.
Why: Enables synchronous operation where refinement directly updates coordinates. Without this:
- Refinement happens asynchronously in background threads
- Need to call
coot.set_refinement_immediate_replacement()before using refinement functions (just once is enough) which should remove the risk of threading conflicts and crashes, race conditions between refinement and rendering.
When to use: Any time you're scripting refinement operations (refine_residues_py, refine_zone, etc.)
Updating Maps
Rule: if a map has attached data (Fobs, sigFobs, rfree from an MTZ file) and the model is unambiguous, use updating maps. The difference map must be assigned too.
- Test for attached data:
coot.refmac_parameters_py(imol_map)returns[mtz, F, phi, weight, use_weights, is_diff, have_params, fobs, sigfobs, rfree, sensible], or[]if nothing is attached. - Make maps that carry the data:
coot.make_and_draw_map_with_refmac_params(mtz, F, phi, weight, use_weights, is_diff, 1, fobs, sigfobs, rfree, 1). Do this for FWT/PHWT (2Fo-Fc) and for DELFWT/PHDELWT (difference). - Bind them:
coot.set_auto_updating_sfcalc_genmaps(imol_model, imol_map_with_data, imol_2fofc, imol_diff). - Never pass a target map without refmac params to
sfcalc_genmap(it crashed Coot). - Updating maps follow edits and checkpoint restores. To confirm an edit reached the maps, sample
density_at_pointin the difference map before and after, at the changed atoms. Do not rely onmap_sigma_pychanging.
CRITICAL: check the refinement map after creating maps
After maps were created, coot.imol_refinement_map() silently became the DIFFERENCE map. Refining against it degrades the fit, and every rotamer or peptide-flip trial run in that state is invalid.
- Call
coot.set_imol_refinement_map(imol_2fofc)after any map creation, and printcoot.imol_refinement_map()before refining. - Sanity check: refining a well-fitted ligand against the right map moves its atoms only ~0.02 A. If a refinement lowers the density fit of something that fitted well, check the refinement map first.
- Make a checkpoint before each trial and restore if the metric worsens.
Safe Refinement Workflow
# 1. Enable immediate replacement
coot.set_refinement_immediate_replacement(1)
# 2. Set the refinement map
coot.set_imol_refinement_map(imol_map)
# 3. Refine residues (preferred method)
# Pass a list of residue specs: [["A", 42, ""], ["A", 43, ""], ...]
residue_specs = [["A", resno, ""] for resno in range(start_resno, end_resno + 1)]
result = coot.refine_residues_py(imol, residue_specs)
# 4. so-called "sphere refine" is often useful because it allows movement/improvement
# of residues that are close in space but distant in sequence.
central_residue_spec = ['A', 12, '']
neighbours = coot.residues_near_residue_py(imol, central_residue_spec, 4.5) # radius in Angstroms
residue_specs = neighbours + [central_residue_spec]
result = coot.refine_residues_py(imol, residue_specs)
Hard-Mode-Soft-Mode-Hard-Mode
Some problems are of the kind where the geometry restraints "get in the way" of the atoms moving to the correct minimum. In such cases, you can try letting the refinement "go soft" - ie.
o Mediocre Refinement o increase the map weight (weight_matrix) by a factor of 10 or so. o Refine the same residues again o Restore the previous map weight o Refine the same residues again
This can sometimes be helpful to remove bad geometry or bad fit - atom clashes in particular.
Additionally, or perhaps at the same time, you can try to reduce LJ epsilon using coot.set_refinement_lennard_jones_epsilon() by a factor of 100 or so. And then restore it and re-refine the same residues.
Zone Refinement
# Enable immediate replacement
coot.set_refinement_immediate_replacement(1)
# Refine zone
coot.refine_zone(
imol,
chain_id,
start_resno,
end_resno,
"" # alt conf
)
Validation and Correlation
Check Residue Quality
# Per-residue density correlation for a chain (1 residue per range, all atoms)
all_atom, _sidechain = coot.map_to_model_correlation_stats_per_residue_range_py(
imol, chain_id, imol_map, 1, 0)
# Each entry is [[chain_id, resno, ins_code], [n_points, correlation]]
# Worst-fitting residues:
Установить coot-refinement в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл coot-refinement?
Best practices for protein structure refinement and validation in Coot. Use when performing (1) Residue refinement operations, (2) Model building and fitting, (3) Rotamer fixing, (4) Scripted/automated refinement workflows, (5) Validation and correlation checking.
Как установить скилл coot-refinement?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл coot-refinement запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic