vibesketch.document.abbreviations¶
Abbreviations such as Ph, Boc and OTf: contracted and expanded on a drawn species (#90).
An abbreviation is the canvas engine’s own superatom (SUP) S-group: the
KET molecule keeps every atom and bond, and the group names the atoms that
the canvas and figures show as one label. Contracting or expanding therefore
changes only how a structure is drawn; its SMILES, InChIKey, calculations
and exports are those of the full structure, and each atom stays where it
was drawn.
Groups are found with RDKit’s abbreviation matcher (rdAbbreviations,
G. Landrum, RDKit 2020.09), over a table of the abbreviations the Journal
of Organic Chemistry lists as standard (“Standard Abbreviations and
Acronyms”, J. Org. Chem. author guidelines) followed by RDKit’s own
defaults. Larger groups come first, so Cbz is preferred over Bn and Bn over
Ph. Figures draw a contracted group as its label at the atom that carries
the bond, with the label reversed (TfO, EtO2C) when the bond leaves it to
the right.
Functions
The labels that can be contracted, largest groups first. |
|
|
The contracted abbreviations drawn in each species, by species id. |
|
A copy of |
|
|
|
|
Exceptions
Abbreviations that cannot be contracted or expanded as asked. |
- exception vibesketch.document.abbreviations.AbbreviationRefused[source]¶
Bases:
ValueErrorAbbreviations that cannot be contracted or expanded as asked.
- vibesketch.document.abbreviations.abbreviation_labels()[source]¶
The labels that can be contracted, largest groups first.
- vibesketch.document.abbreviations.abbreviations_of(document)[source]¶
The contracted abbreviations drawn in each species, by species id.
- vibesketch.document.abbreviations.condensed(mol, abbreviations)[source]¶
A copy of
molwith each abbreviation drawn as one labelled atom, for figures.Each atom kept carries its index in
molas thevibesketch_indexproperty, so highlights and other marks can follow it. A group with no bond to the rest of the molecule is drawn in full.- Parameters:
mol (Any)
abbreviations (Sequence[KetAbbreviation])
- Return type:
- vibesketch.document.abbreviations.with_abbreviations(document, species=None, labels=None)[source]¶
documentwith abbreviations contracted in the drawing ofspecies, or of all.Without
labelsevery known group is contracted, as long as the groups leave most of each molecule drawn; named labels are contracted wherever they occur. A group that overlaps one already on the canvas is left alone.
- vibesketch.document.abbreviations.without_abbreviations(document, species=None, labels=None)[source]¶
documentwith the abbreviations ofspecies, or of all, expanded to their atoms.labelslimits it to groups of those names; any group the canvas holds, including one made in the canvas, can be named.