openchemlib-utils
    Preparing search index...

    Class TopicMolecule

    This class deals with topicity information and hose codes It is optimized to avoid recalculation of the same information

    Index

    Constructors

    Properties

    idCode: string
    molecule: Molecule
    options: TopicMoleculeInternalOptions

    Accessors

    • get diaIDs(): string[]

      This is related to the current moleculeWithH. The order is NOT canonized

      Returns string[]

    • get distanceMatrix(): any[]

      Returns the distance matrix for the current moleculeWithH

      Returns any[]

    • get enantioIDs(): string[]

      Computes a canonical ID for each atom in moleculeWithH that encodes absolute stereochemistry (no makeRacemic step). Unlike diaIDs, these IDs differ between enantiomers and are used as cache keys for pro-R / pro-S assignment so that each enantiomer gets an independent computation.

      Returns string[]

    • get finalRanks(): any

      Returns finalRanks for all the atoms including hydrogens. Those ranks deals with topicity and is related to the current moleculeWithH. All the atoms have a unique identifier.j In order to calculate the ranks we replace all the hydrogens with a X atom.

      Returns any

    • get heterotopicSymmetryRanks(): number[]

      Returns symmetryRanks for all the atoms including hydrogens. Those ranks deals with topicity and is related to the current moleculeWithH. In order to calculate the ranks we replace all the hydrogens with a X atom.

      Returns number[]

    • get hoseCodes(): any

      This is related to the current moleculeWithH. The order is NOT canonized

      Returns any

    • get moleculeWithH(): Molecule

      Returns a molecule with all the hydrogens added. The order is NOT canonized

      Returns Molecule

    • get prochiralities(): ("r" | "s" | undefined)[]

      Returns an array, indexed by atom number in moleculeWithH, holding the pro-R / pro-S descriptor ('r' or 's') for every hydrogen of a CH2 whose two hydrogens are diastereotopic. Atoms that are not labelled prochiral hydrogens hold undefined. The underlying hash (prochiralityByEnantioID) is keyed by enantioID, which encodes absolute stereochemistry, so two enantiomers receive independent assignments. Hydrogens are never R or S themselves (that is a stereocenter descriptor), so the label is always lowercase regardless of whether the prochiral carbon is a true or a pseudoasymmetric centre. The assignment is determined by replacing one H with a higher-priority pseudo-atom (via tagAtom) and reading getAtomCIPParity of the carbon.

      Returns ("r" | "s" | undefined)[]

      array of 'r' / 's' / undefined indexed by atom number

    Methods

    • This method ensures that all the atoms have a mapNo in the molecule (and not the moleculeWithH! )

      Returns void

    • Returns a new TopicMolecule but will copy precalculated information if possible (same idCode). This is very practical when expanding hydrogens for example.

      Parameters

      • molecule: Molecule

      Returns TopicMolecule

    • Parameters

      • atom1: number
      • atom2: number
      • options: GetAtomPathOptions = {}

      Returns number[][]

    • This method returns a mapping between the diaIDs of the current molecule. It expects that the initial molfile and the final molfile contains atomMapNo in order to track which atom becomes which one.

      Parameters

      • molecule: Molecule

      Returns Record<string, string | undefined>

    • For each atom we will return an array of objects that contains the different possible path as well as the canonic hose codes

      Parameters

      • options: HoseCodesForPathOptions = {}

      Returns HosesForPath[]

    • Return one fragment for a specific sphere size and specific root atoms

      Parameters

      • rootAtoms: number[]
      • options: GetHoseFragmentOptions = {}

      Returns Molecule

    • Remove a trailing pro-R / pro-S character (r or s) from the customLabel of every hydrogen that carries one, in both molecule and moleculeWithH. Idempotent. Hydrogens whose customLabel does not end with r or s are left untouched.

      Returns number

      The number of labels that were stripped from moleculeWithH

    • This method ensures that all the atoms have a mapNo corresponding to the atom number. It will enforce mapNo in molecule and moleculeWithH We start numbering the atoms at 1

      Returns void

    • Set a pro-R / pro-S customLabel on each diastereotopic CH2 hydrogen, appended as lowercase r or s. Idempotent: calling it again replaces any trailing pro-R / pro-S letter rather than stacking. The label is appended to whatever customLabel the hydrogen already has, falling back to the parent carbon's customLabel when the hydrogen has none. Both molecule and moleculeWithH are labelled in place, sharing the same cached prochiralityByEnantioID hash; on molecule only hydrogens that are explicit (i.e. exist as atoms there) receive a label. Repeated calls do no extra CIP work.

      Returns number

      The number of hydrogens labelled in moleculeWithH

    • Parameters

      • options: ToMolfileOptions = {}

      Returns string

    • Parameters

      • options: ToMolfileOptions = {}

      Returns string

    • Parameters

      • options: ToMolfileOptions = {}

      Returns string