Command line#
orthonym names one SMILES, or a file of them. python -m orthonym is the same program. Every option is listed below in plain words, grouped by what it is for; the option reference prints the program’s own help text.
$ orthonym "c1ccccc1"
benzene
Naming#
orthonym "SMILES"Print the name of one structure.
--style {pin,general,cas}pin(the default) aims at the Preferred IUPAC Name.generalallows 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 descriptorsRaandSa. The PIN-only tier’s PIN-only rule applies topinonly, so withgeneralorcasa name thatpindeclines withNO_VERIFIED_PINis returned; the provenance row gives its tier.casis accepted and at present gives the names ofgeneral, except that hydrate names and axial descriptors keep theirpinform.--enable-triviality-controllerWhere the IUPAC 2013 recommendations prefer a retained parent name (benzene, phenol, aniline, benzoic acid and others) to the systematic one, use it. Every change is checked by an OPSIN round trip.
ORTHONYM_ENABLE_TRIVIALITY_CONTROLLER=1turns it on too.--trivialWhen 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). The provenance row labels bothsystematic_verifiedwith sourcetrivial_retained. A natural-product name built on a parent, such as(9R,13S,14S)-3-methoxy-17-methylmorphinan, is not a trivial name, and--trivialdoes not return it at the PIN-only tier.
Tiers#
--emit-tier {pin,valid,complete,best-effort,full-coverage}Which names to return. Without it, the
best-efforttier: the strict PIN path first, whosepin_verifiedname is returned as it is, and otherwise a systematic name that is not the PIN, labelled with its tier. A name belowpin_verifiedearns one note on the error stream per run, and--provenanceshows the tier.pinreturns 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 (pin_verified); it was the default up to release 1.0.x. Its exceptions are the name formats absent from OPSIN’s grammar (phanes, unless--opsin mainlets OPSIN itself read them; otherwise a phane name is checked by building its 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. Otherwisepindeclines, with the reason codeNO_VERIFIED_PINwhen it built a name that is not a verified PIN, such as the name of a compound without carbon or a name from the natural-product and metal-complex lists. The rule applies to the default--style pin.validadds names from the general engine,completeadds general names for aromatic and heterocyclic ring systems,best-effortadds 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 these names for ring systems of up to 40 skeletal atoms and 8 rings), and adducts with a one-atom ion such as chloride, and, for a monocycle whose two stereocentres each carry one ligand and one hydrogen atom, thecisortransname (trans-cyclohexane-1,4-diol) in place of a name with lowercaserands, which OPSIN cannot read (the conditions are in Output tiers), and an inositol name matched to your structure by its InChIKey, which OPSIN cannot read (the recommendations give it no PIN), 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), andfull-coverageadds the coordination-name builder for metal tetrapyrrole and corrin complexes. The wider tiers also return the names the PIN-only tier declines, each labelled with its tier. The default is thepintier for--style generalandcas, and when no OPSIN reads the names back (a host without Java). See Output tiers.
Output#
--provenancePrint a JSON row instead of the bare name: the name, its tier, and how it was checked. With
--batch, each line is the SMILES, a tab and the row. Not with--confidence. See The provenance row.--confidencePrint 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. When no measurement was taken it says so:Confidence: unverified (no coverage measurement was taken). With every tier; not with--provenance: a tier row has no coverage score, and the call stops with a usage error.--on-failure {empty,label,raise}What to give for a structure that gets no name.
empty(the default) prints an empty name and, on the error stream, one lineSMILES<tab>CODE: reasonwith the limit code and the label.labelprints the label in place of a name, as earlier versions did.raisestops with an error: the same line on the error stream and exit status1(with--batchthe line getsERROR:and the run ends with status1). It applies to a name, to--confidenceand to--batch(with--emit-tiertoo);--provenance(with--batchtoo),--dump-treeand--engine-onlyreport the structure as it is: in a--provenancerow,limit_codesays why there is no name. The codes are the stable part (see Declines); the label texts can change.--verbose,-vAlso print the SMILES and the style. With
--batch, also say how many lines were read, how many failed and how many got no name (with--time-limit, how many of them ran out of time).--dump-tree,--format {text,json}Print the parts of the name as a tree instead of the name.
--formatsets the layout:text(an indented tree; the default) orjson. One SMILES only: not with--batch.
$ orthonym --dump-tree "OC1CCCCC1"
NameTree: cyclohexanol (class_id=general_acyclic, cite=…)
+- parent_stem: 'cyclohex'
|- suffix: 'ol'
Batch#
--batch FILE,-b FILEName every SMILES in the file, one per line.
--emit-tier,--provenance,--trivial,--enable-triviality-controllerand--binding-proofwork as they do for one SMILES.--validation-stats,--dispatch-stats,--engine-only,--dump-treeand--formatlook inside the naming of one structure, so with--batchthey stop with a usage error. See Batch files.--sdf FILEName every record of a MOL or SDF file, one output line per record in file order, as
--batchnames the lines of a file; it takes the same options. The stereo is the file’s own (wedges, the coordinates of double bonds, ‘either’ bonds left open, V3000 AND and OR collections; a V2000 chiral flag is not read), and the coordinates are dropped before naming. See MOL and SDF files.--output FILE,-o FILEWith
--batchor--sdf, write the lines to this file instead of the screen.--jobs N,-j NWith
--batch, name the lines in N processes at once (default 1). The output and the error stream are 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 Java machine. See Many processes at once.--time-limit SECONDSGive each structure at most this many seconds: one SMILES, or each line of
--batch. A structure that is not named in time has no name, as any structure that gets none (--on-failure), with the reason codeTIME_LIMIT; with--provenanceits row has the tierabstainandlimit_codeTIME_LIMIT. A batch goes on with the next line, which is named as in a run without the limit, and--verbosecounts the lines that ran out of time. Off by default. A call into the JVM that is already running finishes before the limit stops the naming (for one SMILES, a call still running 5 s after the limit ends the run with the same output), and where no alarm can be set (Windows, a thread other than the main one) the run says so once and has no limit: see A time limit for each structure.
Diagnostics#
These are for looking inside the engine. None of them changes a name, except --binding-proof enforce, which can decline one.
--fetch-jarsDownload the OPSIN and centres jars if they are missing, check them, print where they are, and stop. With
--opsin main, also build that OPSIN. See Install.--opsin {2.9.0,main,main@COMMIT}Which OPSIN reads every name back:
2.9.0, the release jar (the default),main, the newest commit of OPSIN’s main branch, ormain@COMMIT, one commit. A main-branch OPSIN is built with your JDK on first use and kept in the jar directory.ORTHONYM_OPSINsets the same; a jar given byORTHONYM_OPSIN_JARwins over both. See Choosing the OPSIN version.--validation-statsAfter the name, print on the error stream how often the OPSIN grammar pre-check passed or repaired a candidate name. One SMILES only: not with
--batch.--dispatch-statsAfter the name, print on the error stream which compound-class routes the engine took. One SMILES only: not with
--batch.--engine-onlySkip the strict path and print, as JSON, the general engine’s own name, checked for atom coverage but not by OPSIN. Never a preferred name; do not use it as a name. One SMILES only: not with
--batch.--binding-proof {off,audit,enforce}An extra check that every part of a general-engine name still maps onto its atoms in the final name.
auditrecords the result and never changes the name;enforcealso declines when the check fails.--version,-VPrint the installed version, in the form
orthonym X.Y.Z. When--opsinorORTHONYM_OPSINselects OPSIN’s main branch, a second line,OPSIN main <commit>, names the build.
Exit status#
0 when the name was printed, when an empty name or a label was printed for a decline (--on-failure empty and label), for --help and --version, and when --fetch-jars succeeded. 1 for a SMILES that RDKit cannot read, a batch with at least one such line, a decline with --on-failure raise, a call with neither a SMILES nor --batch (the help is printed), or a --fetch-jars that could not fetch, build or check a jar. 2 for a usage error (an option the parser does not accept, --confidence together with --provenance, or --batch together with --validation-stats, --dispatch-stats, --engine-only, --dump-tree or --format), and when a jar can be neither found nor downloaded; the jar check is made before the input is read, except with --fetch-jars.