Structure Validation & Cleanup
Draw a nitrogen with four bonds and no charge, and a small marker appears beside it: validation has noticed that the atom only makes sense as an ammonium ion. Validation checks every atom as you draw and is on by default. Its companion, Structure > Clean Up Structure, moves atoms toward standard bond lengths and angles so a quickly sketched molecule looks drawn to scale.
Check a structure
To see validation catch a missing charge on a four-bonded nitrogen (tetramethylammonium):
- With the Bond tool, draw a central atom with four single bonds to four neighbors. Hover the central atom and type
Nto make it nitrogen (hover-type). - A marker appears next to the N, and the amber badge in the status bar shows the issue count.
- Hover the marker. The message says the atom is drawn neutral but its bonds imply a formal charge of +1.
- Add a + charge to the nitrogen with the charge tool. The marker and the badge disappear.
Structure validation
What gets checked
Validation runs per atom and reports three kinds of issues.
Valence errors and warnings. Each element has a list of accepted valences (C: 4; N: 3, 4, 5; O: 2, 3; S: 2, 4, 6; halogens, common metals, and so on). The total bond order on an atom is compared against that list, with an allowance for charged atoms (a positive charge permits one fewer bond per unit of charge, a negative charge one more). Exceeding the maximum is an error; an unusual but not impossible count is a warning. Pentavalent carbon and hydrogen with more than one bond are always errors.
Charge mismatches. If an atom carries a drawn charge that differs from the formal charge computed from its bonds, lone pairs, and element, you get a warning showing both values. An atom drawn neutral whose bonds and electrons imply a charge gets the warning “drawn neutral but its bonds imply a formal charge of … add a charge?”. The charge check skips an atom that has a dative (coordinate) bond, because the arrow already shows the donation.
Coincident atoms. Two unbonded atoms sitting at the same position (within 1 px) are flagged as errors, since one is hidden behind the other. Bonded pairs at the same spot are skipped because Newman projections place front and back carbons together intentionally.
Ions drawn in brackets
A common way to draw an ion is with every atom neutral, brackets around the structure, and the net charge written outside, for example nitrate as [NO3]-. Validation recognises this. When a standalone charge sits with a structure (in the same named selection or set, inside a bracket around it, or close beside it) and its value equals the sum of the formal charges worked out for that structure, the “drawn neutral” warnings on its atoms are dropped. If the bracket charge does not match the electrons you drew, the warnings stay, which usually points to a missing or extra lone pair.
When a set holds several drawings of the same ion, each with its own charge label, each label is matched to the drawing it sits beside.
Whether lone pairs you did not draw count as missing depends on how the structure is tagged; see How lone pairs are counted.
Placeholders
Generic placeholders such as R and X are not checked, because they have no defined valence or charge.
The charge check also skips an atom whose label stands for a whole group, such as OTs, OMe, Boc or COOH. Only a label that is the element with its hydrogens (OH, NH2, CH3, H3C) is checked. An OTs label drawn with no lone pairs, for example, is not reported as a +4 oxygen.
Where issues appear
Issues show up in three places.
On the canvas, an atom with an issue gets a small marker next to its label: a filled red dot with an exclamation mark for an error, an orange ring for a warning. Hover the marker to read the message.
In the status bar, an amber triangle with the number of issues appears whenever there is at least one. Click it to open the Validation panel.
The Validation panel opens from the badge or from Structure > Validate Structure…. It floats above the status bar, lists every issue with the atom label and message, and shows the total in its header. Click an entry to center the canvas on that atom and select it. The list updates as you edit.
Turning it on and off
Validation markers are on by default in all three structure presets. To hide them, click the Toggle Validation Warnings button (the warning triangle in the action bar, next to the grid and auto-align buttons) or choose Structure > Show Validation Warnings. The button and the menu check mark stay in step, and the status-bar badge hides along with the markers. Opening the Validation panel turns the markers back on. Both menu commands are also in the command palette (Ctrl+K). The setting is saved with the document.
Validation is display-only. It never blocks drawing or modifies your structure, so you can leave warnings unresolved while working.
Structure cleanup
What it does
Structure > Clean Up Structure normalizes atom positions in four passes, applied to each connected molecule independently:
- Bond lengths. Starting from the most-connected atom, bonds that deviate more than 15% from the document’s standard bond length are pulled most of the way toward it.
- Straightening. An atom with exactly two bonds that are within 8 degrees of a straight line gets its neighbors aligned onto a single axis.
- Angle equalization. Bond angles are adjusted toward the VSEPR ideal for each atom: two-neighbor atoms move toward the ideal angle, and three-neighbor sp2 centers move toward even 120 degree spacing.
- Overlap repair. Atoms closer together than about a third of a bond length are pushed apart. Atoms stacked exactly on top of a bonded neighbor are relocated a full bond length away at a fresh angle.
Each pass moves atoms only part of the way toward the target, so one run improves the drawing without distorting it. Run the command again for a stronger correction.
What it leaves alone
Cleanup moves atoms only. Arrows, text, shapes, and other annotations stay where they are, and bond orders, charges, and labels are untouched. Isolated single atoms are skipped. If the structure is already within tolerance, the command makes no change at all and adds nothing to the undo history.
Undo
A full cleanup is a single undo step. Press Ctrl+Z once to restore every atom to its previous position.
Straighten Bonds
Clean Up redraws a structure. For small slips only, use Structure > Straighten Bonds instead: it puts bonds that are up to 2 degrees off a 15-degree line back on it and changes no other bond angle. See Straightening bonds.
To line up or distribute whole molecules and annotations, use the Arrange commands instead.