Lone Pair

v1.0.0
app.lonepair/lonepair Checked 7 hours ago Published 10 days ago

Draws chemical structures and reactions as journal-style figures; converts and analyses molecules.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

draw Draw a structure

Draw a chemical structure or reaction as a publication-style figure (ChemDraw-like skeletal formula) with the Lone Pair editor's renderer. Give SMILES, reaction SMILES, InChI, a molfile, a ChemDraw file, or a compound name with name=true. Refused, with the reason, instead of drawn wrongly: SMILES that cannot be read, aromatic rings that cannot alternate single and double bonds, and atoms with too many bonds (unless `as_written`). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format). The SVG a…

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
chairstringWith projection chair: stable (default) draws the chair with the larger groups equatorial; flipped draws the other chair (the ring flip).
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
dpinumberPNG resolution, 300 by default; 600 for print.
embedbooleanFor a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-…
embed_idstringWith embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
highlightarrayHighlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ "atoms": [1, 2, 3], "color": "#ffe066" }]. Atoms are numbered from 1 in input order; bonds between liste…
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
projectionstringskeletal (default): flat rings, stereo as wedges. chair: a six-membered ring as a chair, groups axial or equatorial. haworth: a five- or six-membered ring (furanose, pyranose) flat, groups up or down.…
stereoisomersstringall: draw every stereoisomer of the structure side by side (each stereocentre and E/Z double bond both ways; a meso form once), each labelled R/S and E/Z by atom number. Up to 16; more is refused. Wor…
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.

render_reaction Draw a reaction scheme

Draw a reaction scheme from its parts: reactants joined by plus signs, an arrow with optional text above and below, then products. Each structure is SMILES, InChI or a molfile, not a name: use draw with name=true to get a SMILES first. Refused, with the reason, instead of drawn wrongly: SMILES that cannot be read, aromatic rings that cannot alternate single and double bonds, and atoms with too many bonds (unless `as_written`). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format). Not for a re…

ParameterTypeDescription
products *arrayStructures right of the arrow.
reactants *arrayStructures left of the arrow.
abovestringText above the arrow: reagents or catalyst. Digits after letters become subscripts (H2SO4).
arrowstringArrow type (default reaction). unbalanced_forward: an equilibrium lying to the right (back shaft short).
arrow_sizestringArrowhead size (default small, the journal size).
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
belowstringText below the arrow: solvent, temperature, time.
boldbooleanBold arrow line.
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
dpinumberPNG resolution, 300 by default; 600 for print.
embedbooleanFor a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-…
embed_idstringWith embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
highlightarrayHighlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ "atoms": [1, 2, 3], "color": "#ffe066" }]. Atoms are numbered from 1 in input order; bonds between liste…
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.

render_scheme Draw a multi-step scheme

Draw a synthesis of several steps as one scheme, in journal style: numbered compounds (the numbers bold under each structure), an arrow per step with reagents above, conditions below and the yield under them, a compound shared by two steps drawn once, and rows that wrap. Give compounds as {"1": SMILES, "2": SMILES} and steps as [{"from": ["1"], "to": ["2"], "above": "PCC", "below": "CH2Cl2, rt", "yield": "85%"}]. retro: true draws it as a retrosynthesis from the target, with retrosynthetic arrows. `notes` checks the scheme without refusing it: a step that starts from a compound a later step ma…

ParameterTypeDescription
compounds *objectCompound number → SMILES, e.g. {"1": "CCO", "2": "CC=O"}. Numbers are short: 1, 2a, 3′.
steps *arrayThe steps in order.
arrow_sizestringArrowhead size (default small, the journal size).
boldbooleanBold arrow line.
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
dpinumberPNG resolution, 300 by default; 600 for print.
embedbooleanFor a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-…
embed_idstringWith embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
highlightarrayHighlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ "atoms": [1, 2, 3], "color": "#ffe066" }]. Atoms are numbered from 1 in input order; bonds between liste…
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
retrobooleanDraw it as a retrosynthesis from the target. Default false.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.
wrapintegerSteps per row before it wraps. Default 4.

render_sar_table Draw a series from a core and R groups

Draw a structure–activity series: a core with R groups and each compound made by putting its substituents on, all in the same pose and numbered. `compounds` in the result gives each one’s SMILES, formula, molecular weight and InChIKey, for a table beside your data. Stereo on the core and the substituents is kept. A compound whose atoms do not add up, or that breaks a valence, is refused by name. Not for unrelated structures side by side (use draw or render_scheme) or for stereoisomers (use draw with stereoisomers).

ParameterTypeDescription
compounds *arrayOne per compound: its id and a substituent for every R, e.g. [{"id": "1a", "R1": "OC", "R2": "H"}]. A substituent is a SMILES that attaches by its first atom (or at * if it has one), or "H".
core *stringThe core as SMILES, each R group as [*:n] on one single bond, e.g. "c1ccc(cc1)[*:1]".
dpinumberPNG resolution, 300 by default; 600 for print.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.

render_mechanism Draw a reaction mechanism

Draw one step of a reaction mechanism with curved (arrow-pushing) arrows. Give the structures as SMILES with atom-map numbers on the atoms the arrows touch, e.g. ["[CH3:1][Br:2]", "[OH-:3]"], and each arrow's `from` and `to` by those numbers: {"atom": n}, {"bond": [n, m]}, {"lone_pair": n}, {"charge": n}, or {"between": [n, m]} for a bond that forms. An arrow from a lone pair starts at the drawn pair (the atom's lone pairs are shown if the drawing had none); a curly arrow moves two electrons, a fishhook one. The curves bow away from the structures. `notes` warns about chemistry that looks wron…

ParameterTypeDescription
arrows *arrayThe curved arrows, in order.
structures *arraySMILES of each species, left to right, with atom-map numbers ([CH3:1]) on the atoms the arrows name.
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
dpinumberPNG resolution, 300 by default; 600 for print.
embedbooleanFor a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-…
embed_idstringWith embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
highlightarrayHighlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ "atoms": [1, 2, 3], "color": "#ffe066" }]. Atoms are numbered from 1 in input order; bonds between liste…
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
show_lone_pairsstringWhich lone pairs to draw: on the atoms arrows start from (default), on every heteroatom, or none.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.

convert Convert a structure file

Convert a structure between formats: cdxml, cdx, mol, molV3, sdf, rxn, rxnV3, smiles, inchi, inchikey, rinchi, cml, mrv, json (mol = V2000 molfile, molV3 = V3000, json = Lone Pair drawing, rinchi = the RInChI of a reaction). A SMILES may carry a CXSMILES stereo block (|&1:1,3|), which is read and written back. Reads ChemDraw CDXML and CDX. `notes` says what the target format cannot keep (for example dative bonds in a V2000 molfile). Refused, with the reason, instead of drawn wrongly: SMILES that cannot be read, aromatic rings that cannot alternate single and double bonds, and atoms with too ma…

ParameterTypeDescription
to *stringThe format to write.
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

analyze Formula, masses and identifiers

For each structure in the input: molecular formula, molecular weight, exact (monoisotopic) mass, elemental analysis, SMILES, InChI and InChIKey. For a reaction: each structure's role and whether atoms and charge balance (each drawn structure counted once). Calculated from the structure, not looked up. Not for pKa (use estimate_pka), bond dissociation energies (use estimate_bde), NMR (use predict_nmr) or mass spectra (use mass_spectrum).

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

check_structure Check a structure before using it

Check what a structure is before using it, above all a SMILES you wrote or recalled yourself. For each structure: formula, masses, canonical SMILES, InChI, InChIKey, how many stereocentres and E/Z double bonds are set and which are open (atom numbers from 1, in input order), and warnings (open stereo, charges that do not cancel, atoms over their valence with as_written). With `compare_to`: identical, enantiomers, diastereomers, same skeleton with stereo not set, same compound by InChIKey, constitutional isomers, or different. Calculated, not looked up, except a name at PubChem. An unreadable s…

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
compare_is_namebooleanTrue when `compare_to` is a compound name to look up at PubChem. Default false.
compare_tostringA second structure to compare with: SMILES, InChI, a molfile, or a name with compare_is_name. E.g. your SMILES as `input` and the name of the compound you mean here.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

edit_drawing Change an earlier figure

Change a figure Lone Pair made earlier and get the new figure. `ops` changes atoms and bonds: add, change element or charge, delete, bond, move, recolour. Atoms are named by their id in `drawing` (or {map: n} for an atom-map number from SMILES such as [CH3:1]). The operations are applied all or nothing: if one fails or leaves an atom over its valence, nothing changes and the error names the operation. The result's `changes` lists what was added, changed and removed, with the formula before and after. Also: add a structure beside it, change the journal style, or put a caption under it. Give the…

ParameterTypeDescription
addstringA structure to add to the right of the drawing (SMILES, InChI, molfile).
add_is_namebooleanTrue when `add` is a compound name to look up at PubChem. Default false.
captionstringText to put under the drawing.
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
dpinumberPNG resolution, 300 by default; 600 for print.
drawingobjectThe `drawing` object from an earlier result.
embedbooleanFor a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-…
embed_idstringWith embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey.
formatstringpng (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`).
highlightarrayHighlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ "atoms": [1, 2, 3], "color": "#ffe066" }]. Atoms are numbered from 1 in input order; bonds between liste…
opaquebooleanWhite background instead of transparent (SVG, PNG). Default false.
opsarrayOperations, in order. add_atom {el, bond_to, order}; set_atom {atom, el, charge, lp, iso, map}; delete {atoms, bonds}; add_bond {a, b, order, stereo}; set_bond {bond or a+b, order, stereo, kind}; move…
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.

estimate_pka Estimate pKa values

Estimate the pKa of each acidic site (the X–H, in water and in DMSO where tabulated) and the pKaH of each basic site of a structure, most acidic first, with the basis of each value. These are the same rule-based estimates as the Lone Pair editor's pKa tool: tabulated values (Evans–Ripin, Bordwell/Reich, Williams) with Hammett and inductive corrections, usually within ±1 unit for simple sites. Call this instead of searching the web for an estimate, and say the numbers are estimates. Atoms are numbered from 1 in the order the input writes them (SMILES order); `atoms` limits the answer to th…

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
atomsarrayOnly these atoms (numbered from 1 in input order). Default: every site.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

estimate_bde Estimate bond dissociation energies

Estimate homolytic bond dissociation energies (gas phase, 298 K) in kcal/mol and kJ/mol, weakest bond first, with the basis of each value. By default every X–H bond and every acyclic single bond between heavy atoms. These are the same estimates as the Lone Pair editor's BDE tool: Blanksby & Ellison reference values with additive radical-stabilization terms, and the Sanderson/Reusch R–X compilation; expect about ±2–3 kcal/mol. Where no specific value exists, an average bond enthalpy is given and marked. Call this instead of searching the web for an estimate, and say the numbers are estim…

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
atomsarrayThe X–H bonds at these atoms (numbered from 1 in input order).
bondsarrayBonds between heavy atoms, each a pair of atom numbers, e.g. [[1, 2]].
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

predict_nmr Estimate 1H and 13C NMR

Estimate the 1H and 13C NMR spectrum of a structure in CDCl3: each peak's shift in ppm, the number of protons, multiplicity and J in Hz, and the atoms it comes from (numbered from 1 in input order). These are the same additive-increment estimates as the Lone Pair editor's NMR tool (Shoolery/Pretsch, Pascual–Meier–Simon, Grant–Paul), not a spectral database: expect roughly ±0.3 ppm for 1H and ±5 ppm for 13C. A peak from an environment with little reference data is marked confidence: low. Call this instead of searching the web for an estimate, and say the numbers are estimates. Not for m…

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

mass_spectrum Masses, isotope pattern and MS/MS estimate

For each structure: monoisotopic mass, m/z of the common adducts ([M+H]+, [M+Na]+, [M−H]− and more), the isotope pattern, and a rule-based estimate of MS/MS fragments of [M+H]+ (mode neg: [M−H]−) with each fragment's formula and how it forms. Masses and the isotope pattern are calculated exactly; the fragments are an estimate, not validated against measured spectra, so present them as fragments to look for. Not for NMR (use predict_nmr) or a formula and molecular weight alone (use analyze).

ParameterTypeDescription
as_writtenbooleanDraw atoms that have too many bonds instead of refusing the structure. Default false.
inputstringThe structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the S…
modestringMS/MS of [M+H]+ (pos, default) or [M−H]− (neg).
namebooleanSet to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Short text that…

verify_figure Check the molecules in a finished figure

Check a finished figure (SVG, or HTML with inline SVG) that holds structures Lone Pair drew with embed: true. Each Lone Pair molecule is found by the drawing data inside it and rebuilt from it, then checked: its label (data-inchikey) names that structure; its lines and atom labels are the ones Lone Pair draws for it, drawn the same way (nothing redrawn, relabelled, recoloured, hidden or moved, whether by an attribute, an inline style or a rule in the figure's style sheets); nothing around it hides, clips, stretches, skews or mirrors it (SVG groups, HTML wrappers and their CSS included); and, w…

ParameterTypeDescription
expectarrayThe structures the figure should show, each as SMILES or InChI. Default: none, and only the molecules themselves are checked.
figurestringThe whole figure as text: an SVG, or HTML with the SVG inside.

compose_figure Put molecules over a picture

Put Lone Pair structures over a picture, such as a background an image model made with empty space for each molecule, so that no structure is drawn by the image model. Give the picture's size in pixels and, for each molecule, its structure and a box (x, y, width, height in the picture's pixels). Each molecule is drawn by Lone Pair, fitted to its box at one bond length for the whole figure, centred, and laid over the picture as the top layer on a white plate (plate: false for none). SVG (default): the figure the size of the picture, showing the picture by background_href; it can be checked agai…

ParameterTypeDescription
molecules *arrayThe molecules to place, each over the empty space left for it.
background_hrefstringThe picture's file name or URL, written into the SVG so that it shows the picture (it is not fetched).
bond_lengthnumberBond length in pixels for every molecule. Default: the largest that fits every box.
colorstringblack (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture.
formatstringsvg (default) or png.
heightintegerThe picture's height in pixels.
outline_textbooleanSVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false.
platebooleanA white rounded plate behind each molecule so it reads over the picture. Default true.
stylestringJournal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides.
widthintegerThe picture's width in pixels.