Skip to content

Stereo and Queries

nodemode-ai edited this page Dec 3, 2026 · 1 revision

Stereo and Queries

From 0.6.0 FormChem reads and edits stereochemistry in depth and draws query structures: atom lists, generic atoms, query bonds, R-groups and Markush structures. Every command here is one undo step. The engine side, with every route, is docs/ANALYSIS.md.

Stereo labels

Draw stereocentres with wedges and hashes (bond tool B, or hover a bond and press W or H). View > Show Stereochemistry draws the labels the engine works out with the CIP rules:

Label Where it shows
(R), (S) under the centre's label or position
(r), (s) pseudo-asymmetric centres, such as C3 of pentane-2,3,4-triol
(E), (Z) beside a stereogenic double bond

A centre without a wedge, or a double bond with a substituent on its line, is undefined and gets no label; a wavy bond marks it unknown on purpose. Isotopes count, so a CHD centre is a stereocentre. Allene axial chirality and atropisomers (a hindered biaryl) are not perceived in this version.

Structure > Assign Wedges redraws the wedges of the selected centres (or every defined centre) the way the chemistry reads them: one wedge per centre, on a bond outside a ring where possible, with its narrow end on the centre. Use it after a clean-up or an import that left wedges in awkward places.

Enhanced stereo

Enhanced stereo says what is known about a mixture:

Group Means Shown as
abs this configuration, as drawn abs
AND n both configurations of these centres are present (a racemate when the group holds every centre) and1, and2
OR n one configuration, not known which or1, or2

Select stereocentres and use Structure > Enhanced Stereo: Absolute (abs), New AND Group, New OR Group or Clear Stereo Group. Stereo Group... opens a small popover with the kind, the group number and the groups already in the drawing as chips: click a chip to join it. The same items are on the atom right-click menu. View > Show Enhanced Stereo Groups draws the group labels under the CIP labels, in a colour per group when group colours are on.

The structure's chiral flag (absolute, relative or racemic) shows under it. Relative puts every centre that is in no group into one OR group, racemic into one AND group. A molfile with its chiral flag at 0 opens with its centres absolute, as most programs mean it.

Abbreviations

Select a group of atoms (for example the CO2H of a carboxylic acid, without the carbon it hangs on) and choose Structure > Contract Abbreviation.... The dialog searches the library of 106 abbreviations (Me to TBS, Ts, Boc, Fmoc, CO2Et and the rest) and proposes the match; type a new label to use your own. Expand Abbreviation on a selected label such as OTs or Ph (or with nothing selected, on every abbreviation on the page) draws its atoms back, laid out along the attachment bond on the side with more room; after a contract, expand returns the same atoms to the same place. Your own abbreviations go in abbreviations.json in the FormChem data folder: a list of {"label": "PMB", "smiles": "*Cc1ccc(OC)cc1"} entries, the * marking the attachment.

Structure > Add Explicit Hydrogens draws the implicit hydrogens as atoms (of the selection, or everything), and Remove Explicit Hydrogens folds them back. Hydrogens that carry stereo, an isotope, a charge or a map number are kept.

Query atoms and bonds

A query structure describes what to search for. Right-click an atom for Atom Query, or use Structure > Query:

Feature Tag on the canvas Means
Atom List... [C,N,O] or not [Cl,Br] any of these elements, or none of them (pick from the periodic table)
Any Atom (A) A any atom except hydrogen
Any Heteroatom (Q) Q any atom except carbon and hydrogen
Any Halogen (X) X F, Cl, Br, I or At
Any Metal (M) M any metal
Aromatic, Aliphatic arom, aliph the atom must or must not be aromatic
Unsaturated u the atom has a double, triple or aromatic bond
Substitution as Drawn s* exactly as many heavy neighbours as drawn
Ring Bonds as Drawn rb2 exactly as many ring bonds as drawn

The hover keys A, Q, X and M set the generic atoms directly. Right-click a bond for Query Bond: Any Bond, Single or Double (S/D), Single or Aromatic (S/A), Double or Aromatic (D/A), In a Ring, In a Chain, or Clear Bond Query; the hover key 0 sets any bond. Query features are drawn as small purple tags; View > Show Query Features hides or shows them. Check Structure notes query features in a drawing that is not meant as a query.

Find Substructure and SMARTS

Edit > Find Substructure... searches every structure on the page and selects the matches. With atoms of one structure selected, those atoms (and the bonds among them) are the query; with nothing selected it asks for a SMARTS pattern such as C(=O)[OH]. The toast says how many matches in how many structures.

Copy as SMARTS (Edit or Structure > Query) copies the selected atoms, or every structure on the page, as SMARTS with its query features; Export SMARTS... saves a .sma file (in the desktop app it copies instead, until 0.7.0).

R-groups and Markush structures

  1. Draw the scaffold and each substituent as its own structure. Mark where a substituent attaches with an attachment point: a * atom with one bond.
  2. Select the scaffold atom that varies and choose Structure > Query > Define R-Group... (or right-click it). The atom becomes R1 (the next free number).
  3. In the dialog, pick the members, the occurrence (1, a range such as 1-3, or >0), whether unfilled positions are hydrogen (Rest H), and an if-then condition (R1 only when R2 is present).

The canvas writes R1 = beside each member, a wavy mark at its attachment and a summary line under the scaffold. Structure > Query > Enumerate R-Groups... lists every structure the definition stands for, with its SMILES and formula; Copy SMILES copies them all. Molfiles in V3000 carry the R-group definitions in and out.

Not built yet: link nodes and variable attachment (a substituent on any position of a ring).

Clone this wiki locally