计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
conformers-drawing【效率与协作】Generate/optimize RDKit 3D conformers, compute alignment/RMSD, create 2D coordinates, and render molecule/reaction/grid depictions as SVG or PNG.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task asks for RDKit 3D conformer generation, force-field optimization, conformer alignment/RMSD, 2D coordinate generation, or molecule/reaction drawing. Route basic parsing, validation, suppliers, and molecule editing to molecule-io-core; route reaction semantics and product chemistry to reactions-standardization; route descriptor/fingerprint features to descriptors-fingerprints.
AllChem.ETKDGv3() or AllChem.EmbedMolecule, optimize with MMFF or UFF, then remove hydrogens only if the caller wants heavy-atom output.AllChem.EmbedMultipleConfs, optimize with AllChem.MMFFOptimizeMoleculeConfs or per-conformer UFF/MMFF, then align with AllChem.AlignMolConformers and inspect RMS values.rdkit.Chem.rdMolAlign.AlignMol for a fixed atom map and rdMolAlign.GetBestRMS for symmetry-aware best RMSD.AllChem.Compute2DCoords / rdDepictor.Compute2DCoords before drawing when molecules lack depiction coordinates, or GenerateDepictionMatching2DStructure for template-aligned drawings.Draw.MolToSVG, Draw.MolsToGridImage(..., useSVG=True), or direct rdMolDraw2D.MolDraw2DSVG for headless, portable output.Draw.MolToImage, Draw.MolToFile(..., imageType='png'), or rdMolDraw2D.MolDraw2DCairo only when Cairo/Pillow support is available.molecule-io-core; never continue with None molecules.mol_h = Chem.AddHs(mol).params = AllChem.ETKDGv3(); params.randomSeed = 0xF00D; params.numThreads = 0 where supported.EmbedMolecule returns 0 on success and negative values on failure; EmbedMultipleConfs returns conformer ids.references/conformers.md covers embedding, optimization, hydrogens, alignment, RMSD, and retry patterns.references/drawing.md covers 2D coordinates, SVG/PNG output, grids, legends, highlights, and reactions.references/troubleshooting.md covers embedding failures, missing conformers, force-field parameter failures, and drawing backend issues.scripts/conformer_draw_smoke.py is a bundled smoke CLI that embeds a tiny molecule and writes an SVG without requiring the source checkout.from rdkit import Chem
from rdkit.Chem import AllChem
mol = Chem.AddHs(Chem.MolFromSmiles('CCO'))
params = AllChem.ETKDGv3()
params.randomSeed = 0xF00D
status = AllChem.EmbedMolecule(mol, params)
if status < 0:
raise RuntimeError(f'RDKit embedding failed: {status}')
if AllChem.MMFFHasAllMoleculeParams(mol):
AllChem.MMFFOptimizeMolecule(mol)
else:
AllChem.UFFOptimizeMolecule(mol)
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
mol = Chem.MolFromSmiles('c1ccccc1O')
AllChem.Compute2DCoords(mol)
svg = Draw.MolsToGridImage([mol], legends=['phenol'], useSVG=True)
mol.GetNumConformers() before optimization, alignment, RMSD, or shape work.