Command-line options#

The program’s own help text, read from its option parser when the site is built. The same options in plain words, grouped by what they are for, are on Command line.

Orthonym: IUPAC names for chemical structures. Give a SMILES string and get its IUPAC name, checked by reading it back with OPSIN. The default returns the preferred IUPAC name (PIN) when the strict path builds one, and otherwise a systematic name that is not the PIN (–emit-tier pin gives PINs only). A structure that gets no name has an empty name and a reason on the error stream (–on-failure). –provenance shows how each name was built and checked.

usage: orthonym [-h] [--style {pin,general,cas}] [--version] [--verbose]
                [--batch BATCH] [--output OUTPUT] [--sdf SDF] [--jobs JOBS]
                [--confidence] [--validation-stats] [--dispatch-stats]
                [--dump-tree] [--format {text,json}]
                [--enable-triviality-controller] [--trivial]
                [--emit-tier {pin,valid,complete,best-effort,full-coverage}]
                [--provenance] [--engine-only] [--fetch-jars]
                [--opsin {2.9.0,main,main@COMMIT}]
                [--binding-proof {off,audit,enforce}]
                [--on-failure {empty,label,raise}] [--time-limit SECONDS]
                [smiles]

Positional Arguments#

smiles

The structure, as a SMILES string (in quotes).

Named Arguments#

--style

Possible choices: pin, general, cas

Naming style: pin (aim at the Preferred IUPAC Name; the default), general or cas. general allows general IUPAC forms where the recommendations offer one, for example functional class names (‘dimethyl sulfoxide’, ‘methyl isocyanate’), hydrate names (‘oxalic acid dihydrate’) and the axial descriptors Ra and Sa. The PIN-only rule (–emit-tier pin) applies to pin only, so with general or cas a name that pin declines with NO_VERIFIED_PIN is returned; the default tier of general and cas is not widened. cas is accepted and at present gives the names of general, except that hydrate names and axial descriptors keep their pin form.

Default: 'pin'

--version, -V

Print the version, in the form ‘orthonym X.Y.Z’, and stop. When –opsin or ORTHONYM_OPSIN selects OPSIN’s main branch, a second line names the OPSIN build.

Default: False

--verbose, -v

Also print the SMILES and the style. With –batch, also say how many lines were read, how many failed and how many got no name.

Default: False

--batch, -b

Name every SMILES in this file, one per line, and print one ‘SMILES<tab>name’ line each; the name is empty for a line that gets no name (–on-failure). It names each line as one SMILES is named: the default, or the names of the –emit-tier given, and –provenance prints the JSON row of each line in place of the name. –validation-stats, –dispatch-stats, –engine-only, –dump-tree and –format look inside one SMILES and stop with a usage error here.

--output, -o

With –batch or –sdf: write the lines to this file instead of the screen.

--sdf

Name every record of this MOL or SDF file, as –batch names the lines of a file: one ‘SMILES<tab>name’ line per record, in file order (the SMILES is the one named; a CXSMILES for a record with an AND or OR stereo group). The stereo is the file’s own: wedges, the coordinates of double bonds and 3D records, ‘either’ bonds open, V3000 AND/OR collections; a V2000 chiral flag is not read); the coordinates are then dropped and never read again. A record that cannot be read gets the line ‘<record N>’ (ERROR:, as an unreadable –batch line) and a message on the error stream. Takes the options of –batch.

--jobs, -j

With –batch: name the lines in this many processes at once (default 1). The output is the same, line for line and in the same order (with –time-limit, a line that needs about as long as the limit can run out of time in one run and not in another); each process starts its own JVM.

Default: 1

--confidence

Print the name with a coverage score, the tier the name earned (for a tier above pin), the part of the engine that built it, and the parts of the score. Not with –provenance.

Default: False

--validation-stats

After the name, print on the error stream how often the OPSIN grammar pre-check passed or repaired a candidate name. Not with –batch.

Default: False

--dispatch-stats

After the name, print on the error stream which compound-class routes the engine took. Not with –batch.

Default: False

--dump-tree

Print the parts of the name as a tree instead of the name. Not with –batch.

Default: False

--format

Possible choices: text, json

Layout for –dump-tree: text (an indented tree; the default) or json. Not with –batch.

--trivial

When no preferred name can be built, also allow a retained trivial name that is not a preferred name. A preferred name that can be built is never replaced (glycerol stays propane-1,2,3-triol). Without this option, two kinds of retained trivial name are still used at the wider tiers, and the PIN-only tier declines them: names from a small last-resort table, and the trivial natural-product names of molecules whose preferred bridged fused name the engine does not build yet (diamorphine). –provenance labels both systematic_verified, source trivial_retained. A natural-product name built on a parent, such as ‘(9R,13S,14S)-3-methoxy-17-methylmorphinan’, is not a trivial name, and –trivial does not return it at the PIN-only tier.

Default: False

--emit-tier

Possible choices: pin, valid, complete, best-effort, full-coverage

Which names to return. Without this option: the best-effort tier (the preferred IUPAC name (PIN) when the strict PIN path builds one, otherwise a systematic name that is not the PIN; the run says so once on the error stream, and –provenance shows the tier of each name), and the pin tier for –style general and cas and when no OPSIN reads the names back. pin: a name only when the pipeline can build the preferred IUPAC name (PIN), that is when the strict PIN path built the name and verified it (tier pin_verified); this was the default up to release 1.0.x. The exceptions are the name formats absent from OPSIN’s grammar (phanes, checked by building their structure), PIN spellings that OPSIN reads back through a twin spelling of the same structure (ethan(2H)ol, diphenyliodanuide, methane-SO-thioperoxol) or through their acids (dianhydrides), PINs whose stereodescriptors OPSIN cannot read, for which the PIN-only tier compares the constitution, and, with –trivial, a retained trivial name. Otherwise it declines, with the reason code NO_VERIFIED_PIN when it built a name that is not a verified PIN, such as the name of a compound without carbon (a preselected name at most) or a name from the natural-product and metal-complex lists. The rule applies to –style pin. valid: also names from the general engine. complete: also general names for aromatic and heterocyclic ring systems. best-effort: also the last-resort producers, von Baeyer and spiro names for ring systems of up to 100 skeletal atoms and 15 rings (the other tiers build them up to 40 atoms and 8 rings), and adducts with a one-atom ion, and, for a molecule that has no other name, the name the PIN-only tier ships although OPSIN cannot read its stereodescriptors, with the label of the PIN-only tier (pin_unverified), or, failing that, such a name of another producer whose descriptors two CIP labellers confirm (best_effort). full-coverage: also the coordination-name builder for metal tetrapyrrole and corrin complexes, which builds a name or declines. The tiers above pin also return the names the PIN-only tier declines, each labelled with its tier; there every name must pass a full-InChIKey OPSIN round trip, except a name from the natural-product and metal-complex lists, a twin-checked name for which the engine has no other spelling (a halogen -uide anion, the anion of a thioperoxol, an organometallic name with halido ligands) and the best-effort name described above, so the other name formats absent from OPSIN’s grammar are declined there. –provenance shows each name’s tier.

--provenance

Print a JSON row instead of the bare name, with the keys name, tier, is_pin, source, opsin, gates_passed, gate_outcome, formula, limit_code, stereo_unexpressed, suffix_free_prefix_name, prefix_order_fallback, verified, spelling_failures and producer. ‘verified’ is opsin (OPSIN read the whole name back to the same molecule), opsin_constitution (the same constitution; the stereodescriptors were not confirmed by OPSIN), identity (a name from an exact-match list: a metal-complex name found by the input’s exact InChIKey, or a natural-product parent name found by its exact structure; OPSIN cannot read these names), opsin_split (read back to the input without its dative bonds, which the drawing as given has no key for), opsin_twin (a PIN spelling OPSIN has no grammar for, read back through a twin spelling of the same structure), opsin_acids (a poly-anhydride, read through its acids), reconstructor (a name with a count word above 50, which OPSIN cannot read: the structure built from its text) or unverified (no read-back recorded). ‘gate_outcome’ says what the final OPSIN check did, for example self_consistency_verified, suppressed, not_run, carveout:<class>, twin_verified:<rules>, acid_split_verified:<rule> or reconstructed:<rule>. ‘spelling_failures’ lists the spelling rules of the PIN (rule id and detail) that a name in PIN form breaks, and the rule of a recorded non-PIN part that lowered the name; such a name is not labelled pin_verified, and pin declines it. With –batch, each line is the SMILES, a tab and the row, on one line. Not with –confidence.

Default: False

--engine-only

For inspection only: skip the strict path and print, as JSON, the general engine’s own name (checked for atom coverage, not by OPSIN) or that it declined. Never a preferred name; do not use it as a name. Not with –batch.

Default: False

--fetch-jars

Download the OPSIN and centres jars if they are missing, check each against the SHA-256 checksum recorded in Orthonym, print where they are, and stop (exit status 1 on failure). A jar given by ORTHONYM_OPSIN_JAR or ORTHONYM_CENTRES_JAR is used as given, without the checksum check.

Default: False

--opsin

Which OPSIN reads every name back. 2.9.0 (the default) is the release jar. main is the newest commit of OPSIN’s main branch, which Orthonym builds with your JDK on first use (about a minute, needs a JDK and GitHub) and keeps in the jar directory. main@COMMIT is that one commit of OPSIN’s main branch (GitHub is asked once, when it is built, whether the commit is on that branch), for a repeatable run. The same as the environment variable ORTHONYM_OPSIN. OPSIN 2.9.0 stays the default; a jar given by ORTHONYM_OPSIN_JAR wins over this option. With –fetch-jars, a main-branch OPSIN is built now instead of at first use.

--binding-proof

Possible choices: off, audit, enforce

An extra check that every part of a general-engine name still maps onto its atoms in the final name: off (the default), audit (record the result; the name never changes), or enforce (also decline when the check fails). Works for one SMILES and for –batch.

Default: 'off'

--on-failure

Possible choices: empty, label, raise

What to give for a structure that gets no name. empty (the default): an empty name, and on the error stream a line with the SMILES, the limit code and the reason, ‘<SMILES><tab><CODE>: <reason>’. label: the reason as the name, ‘unknown organic compound’ for example. raise: stop with an error (status 1; with –batch the line gets ERROR: and the run ends with status 1). It applies to a name, –confidence and –batch; –provenance (with –batch too), –dump-tree and –engine-only report the structure as it is. With –batch –verbose the count of lines without a name is printed.

Default: 'empty'

--time-limit

Give each structure at most this many seconds (a number above 0, for example 30). A structure that is not named in time gets no name, as for any other structure that gets none (–on-failure), with the reason code TIME_LIMIT; with –provenance its row has the tier abstain and limit_code TIME_LIMIT. With –batch the run goes on with the next line, and –verbose counts the lines that ran out of time. Off by default. The limit is a SIGALRM that stops the naming at the next Python statement, so a call into the JVM or into RDKit that is already running finishes first (the JVM is started before the first limit begins, and its calls last milliseconds); for one structure (no –batch), a call that is still running 5 s after the limit ends the run with the same outcome. Where SIGALRM is not available (Windows, a thread other than the main one) the run says so once and has no limit.

Retained parent names#

--enable-triviality-controller

Use a retained parent name (benzene, phenol, aniline, benzoic acid and others) where the IUPAC 2013 recommendations prefer it to the systematic one (P-15.1.8). Every change is checked by an OPSIN round trip. Off by default; ORTHONYM_ENABLE_TRIVIALITY_CONTROLLER=1 turns it on too.

Default: False