Skip to content

Reactions

nodemode-ai edited this page Dec 6, 2026 · 2 revisions

Reactions

From 0.5.0 FormChem reads a drawn scheme as a reaction: which structures react, which are reagents, what the conditions are. It can then map the atoms, check the balance and work out the amounts. Everything here is in the Reaction menu, and every change it makes is one undo step. The engine side, with every route, is docs/REACTIONS.md.

Draw the scheme

  1. Draw or insert the structures (Insert > Structure from SMILES, a template, or the drawing tools).
  2. Pick the arrow tool (W, or Reaction > Add Reaction Arrow) and drag from the reactants towards the products. Shift snaps to 15 degrees; Alt draws the arrow's other kind (an equilibrium becomes unbalanced, a forward arrow dashed).
  3. Put plus signs between structures with the symbol tool (P); a plus snaps to the centre line of the structure beside it.
  4. Put reagents above or below the arrow, as structures or text (T), for example "reflux, 2 h".

Several arrows in a row make a multi-step reaction: the product of one step is the reactant of the next.

Perceive Reactions

Reaction > Perceive Reactions reads every reaction arrow on the page and stores its steps:

Role Where it sits
Reactants before the arrow's tail, within 2.5 bond lengths of the arrow's line
Products after the arrow's head, within the same distance
Reagents between the tail and the head, within 1.5 bond lengths of the arrow
Conditions text in that same band

The nearest structure on each side takes the role; the next one joins it only across a plus sign or a gap under one bond length. Captions never take a role. Resonance, electron-pushing, fishhook, plain, fragmentation and dissociation arrows are not reaction steps; a retrosynthetic arrow reads from right to left.

Running it again keeps the same reaction ids, your amounts and coefficients, and changes nothing when nothing moved. Steps read from a reaction file keep the roles the file gave, and so do steps whose roles you set by hand.

Set Reaction Roles

When perception reads a role wrongly (water drawn after the arrow that should count as a reagent, a catalyst structure on the line), select the structures or text and choose Reaction > Set Reaction Roles.... The dialog lists the step's members and the selected objects, one row each with a role: Reactant, Product, Agent, Condition or None. Apply changes them as one undo step and marks the step's roles as set by hand, so Perceive Reactions keeps them from then on. Coefficients and stoichiometry amounts of an object that left its side are removed in the same step. Structures, text, captions, groups, pictures, shapes and tables can take a role; the arrow cannot. The command works on the step touching the selection, and perceives the page first when it has no step. Agents run it without the dialog: run_command {id: "set-reaction-roles", params: {role: "agent", objects: [...]}}.

Space Reaction, fitting arrows and footnotes (0.14.0)

  • Space Reaction (Reaction menu) lays the scheme out on the first arrow's centre line: arrows horizontal, the species centred on that line, 14.4 pt between a structure and an arrow and 7.2 pt around a plus sign, plus signs added where they are missing. It uses the boxes the window draws, so long labels get their real width. When a row would run past the page width (minus margins) the next step starts one row lower, joined by a dog-leg line from under the last structure into the arrow; Space Reaction, Repeat Structure at Wraps repeats that structure at the start of the new row instead. Auto-grow pages do not wrap.
  • Conditions follow their arrow. Moving, rotating, flipping or scaling an arrow takes its reagents and conditions along in the same undo step, and dragging an arrow end keeps them centred.
  • Arrows stretch to their conditions: to the widest reagent or condition plus 7.2 pt each side, moving what comes after along so the gaps stay. Perceive Reactions does this, Space Reaction does it, and Fit Arrows to Conditions does it by itself. It does not happen on every keystroke, because roles are only read again by Perceive.
  • Conditions as Footnotes letters the steps (a), (b) above their arrows and moves each step's conditions, formatting kept, into one footnote under the scheme: "(a) H2SO4 (cat.), toluene, reflux, 12 h". Running it again changes nothing.
  • Conditions the engine places (agents, imported schemes) start at the arrow's tail and span its length; in 0.13.0 they started at its middle. A scheme row no longer starts with a stray plus sign.

Map Atoms

Reaction > Map Atoms numbers each reactant atom with the product atom it becomes and marks the bonds that break, form or change order (it perceives first when the page has no step yet). The toast says whether every atom was mapped. Clear Atom Mapping removes the numbers and marks. Map numbers show next to the atoms.

From 0.14.0 Set Atom Map Number... (also on an atom's right-click menu) numbers the selected atoms by hand, counting up from the number you type (0 or empty clears), and Reacting Centre (Reaction menu, or a bond's right-click menu) marks a bond as formed, broken, changed in order, changed in stereo, unchanged or none. The canvas draws the marks in teal: two bars across a formed bond, a cross on a broken one, a circle for an order change, a dashed circle for a stereo change, a thin bar for unchanged. The marks and map numbers are written to RXN V3000. A badge on each arrow shows a green tick when the step is balanced and fully mapped, and amber with the mapped count (such as 22/23) otherwise; the badge is on screen only, never in pictures.

A command acts on the step whose arrow or structures you selected, or the first step on the page.

Check and balance

Reaction > Check Balance... opens a dialog with the count of each element on both sides, the charge and the mass. When the step is not balanced it suggests coefficients (such as 2 A + B) or a missing co-product such as water or HCl. Balance Reaction, or the Balance button in the dialog, writes the coefficients, and from 0.14.0 coefficients over 1 are drawn before their species. Reagents drawn above the arrow are not counted.

A resonance arrow between two structures that are not resonance forms (different formula, charge or skeleton) shows a warning.

Stoichiometry

View > Stoichiometry Panel (also in the Reaction menu) opens a grid under the canvas for the selected step:

  • Type a mass, or a volume with its density, or a volume with a solution's concentration, or equivalents, for each reactant and reagent; purity and a molecular weight of your own (for a salt or hydrate) are optional.
  • Or type a scale in mmol for the reaction.
  • The grid shows moles, equivalents, masses and volumes, marks the limiting reagent, and gives the theoretical yield. Type the isolated mass of the product for the percent yield.

What you type is stored in the drawing; everything else is worked out. Typing a mass, a volume or equivalents for a component replaces the other two for that component, and a scale and the limiting reagent's own amount replace each other, so there is always one source for each number. Reaction > Insert Stoichiometry Table puts the grid on the page as a table under the reaction; inserting it again refreshes the same table.

Example: 1.00 g benzoic acid with 1.2 equiv thionyl chloride at 1.64 g/mL gives 8.19 mmol and 9.83 mmol, so 0.713 mL of thionyl chloride.

From 0.14.0 you need not type the density of a common liquid: FormChem's table of 65 neat solvents and reagents (densities at 20 to 25 °C to three significant figures, matched by structure) shows it as the density's grey placeholder, and writes it into the row when you enter a mass, volume or equivalents for it, so the example above works with no density typed. The grid's Copy button puts it on the clipboard as tab-separated text and Save as CSV writes a CSV file, with the columns Component, Formula, Role, MW, Equiv, mmol, Mass, Volume, Density, Purity, Limiting and Yield.

Copy, export, paste and open

  • Reaction > Copy Reaction As > SMILES or RXN puts the step on the clipboard, with its map numbers.
  • Reaction > Export Reaction writes a .rxn or reaction SMILES file; the RXN keeps the title and the conditions line.
  • Reaction > Insert Reaction from Clipboard lays out pasted reaction SMILES or an RXN as a drawn scheme with an arrow, plus signs and the conditions under the arrow.
  • File > Open opens .rxn files, and CML or CDXML files holding a reaction, as drawn schemes.

Coefficients have no place in reaction SMILES or RXN and are left out.

For agents

Four MCP tools: perceive_reactions, map_reaction (with mode: "clear" to remove a mapping), export_reaction and reaction_stoichiometry, and from 0.14.0 space_reaction, fit_arrows_to_conditions, conditions_as_footnotes and balance_reaction. Those that change the drawing ask you first, like any agent change; perceive_reactions does not stretch arrows. See Agents.

Known limits

  • A structure that is the product of one step and the reactant of the next has one set of map numbers; mapping the second step replaces the first step's numbers.
  • A step whose atoms come from a reagent drawn above the arrow reads as unbalanced.
  • A .smi file with reaction SMILES does not open as a reaction; paste its text with Insert Reaction from Clipboard.
  • Perception reads top-level objects only (a group counts as one) and reads a bent arrow by its ends.
  • Wrapped steps keep the roles they had, because their geometry no longer says what they are; move them back and use Set Reaction Roles... if a later edit needs new roles.

Clone this wiki locally