vibesketch.document.clean¶
Clean up the drawing: standard bond lengths and angles, everything else kept.
Cleaning works on the canvas (KET) in place. Each molecule gets the
coordinates vibesketch.chem.clean.clean_2d() computes, with bonds of
the length Ketcher draws with; arrows, plus signs, text and every atom and
bond property stay as they were, and molecules stay where they were drawn.
Moving atoms can change what a wedge means, so the wedges are re-derived and every molecule is checked: its canonical isomeric SMILES, read back from the cleaned canvas the way the rest of vibe-sketch reads it, must equal the one before. The wedges are tried in this order:
as drawn, on the same bonds;
all wedges and hashes swapped, for a layout that came out mirrored;
swapped only at the stereocentres whose CIP label changed;
placed afresh by RDKit (
WedgeMolBonds).
A molecule for which none of them keeps the stereochemistry is left as drawn and reported, as is anything that is not a plain structure (query atoms, R-groups, polymer brackets).
Functions
|
|
|
A copy of |
Classes
|
What cleaning did. |
- class vibesketch.document.clean.CleanReport(cleaned=0, left=<factory>)¶
Bases:
objectWhat cleaning did.