Constructors

Properties

CANONIZER_ASSIGN_PARITIES_TO_TETRAHEDRAL_N CANONIZER_CONSIDER_DIASTEREOTOPICITY CANONIZER_CONSIDER_ENANTIOTOPICITY CANONIZER_CONSIDER_STEREOHETEROTOPICITY CANONIZER_COORDS_ARE_3D CANONIZER_CREATE_PSEUDO_STEREO_GROUPS CANONIZER_CREATE_SYMMETRY_RANK CANONIZER_DISTINGUISH_RACEMIC_OR_GROUPS CANONIZER_ENCODE_ATOM_CUSTOM_LABELS CANONIZER_ENCODE_ATOM_CUSTOM_LABELS_WITHOUT_RANKING CANONIZER_ENCODE_ATOM_SELECTION CANONIZER_NEGLECT_ANY_STEREO_INFORMATION CANONIZER_TIE_BREAK_FREE_VALENCE_ATOMS FISCHER_PROJECTION_LIMIT FISCHER_PROJECTION_RING_LIMIT STEREO_ANGLE_LIMIT VALIDATION_ERRORS_STEREO VALIDATION_ERROR_AMBIGUOUS_CONFIGURATION VALIDATION_ERROR_ESR_CENTER_UNKNOWN VALIDATION_ERROR_OVER_UNDER_SPECIFIED cAtomCIPParityNone cAtomCIPParityProblem cAtomCIPParityRorM cAtomCIPParitySorP cAtomColorBlue cAtomColorDarkGreen cAtomColorDarkRed cAtomColorGreen cAtomColorMagenta cAtomColorNone cAtomColorOrange cAtomColorRed cAtomLabel cAtomParity1 cAtomParity2 cAtomParityIsPseudo cAtomParityNone cAtomParityUnknown cAtomQFAny cAtomQFAromState cAtomQFAromStateBits cAtomQFAromStateShift cAtomQFAromatic cAtomQFCharge cAtomQFChargeBits cAtomQFChargeShift cAtomQFENeighbourBits cAtomQFENeighbourShift cAtomQFENeighbours cAtomQFExcludeGroup cAtomQFFlatNitrogen cAtomQFHeteroAromatic cAtomQFHydrogen cAtomQFHydrogenBits cAtomQFHydrogenShift cAtomQFIsNotStereo cAtomQFIsStereo cAtomQFMatchStereo cAtomQFMoreNeighbours cAtomQFNarrowing cAtomQFNeighbourBits cAtomQFNeighbourShift cAtomQFNeighbours cAtomQFNewRingSize cAtomQFNewRingSizeBits cAtomQFNewRingSizeShift cAtomQFNoMoreNeighbours cAtomQFNoOfBits cAtomQFNot0ENeighbours cAtomQFNot0Hydrogen cAtomQFNot0Neighbours cAtomQFNot0PiElectrons cAtomQFNot1ENeighbour cAtomQFNot1Hydrogen cAtomQFNot1Neighbour cAtomQFNot1PiElectron cAtomQFNot2ENeighbours cAtomQFNot2Hydrogen cAtomQFNot2Neighbours cAtomQFNot2PiElectrons cAtomQFNot2RingBonds cAtomQFNot3ENeighbours cAtomQFNot3Hydrogen cAtomQFNot3Neighbours cAtomQFNot3RingBonds cAtomQFNot4ENeighbours cAtomQFNot4Neighbours cAtomQFNot4RingBonds cAtomQFNotAromatic cAtomQFNotChain cAtomQFNotCharge0 cAtomQFNotChargeNeg cAtomQFNotChargePos cAtomQFPiElectronBits cAtomQFPiElectronShift cAtomQFPiElectrons cAtomQFRingSize0 cAtomQFRingSize3 cAtomQFRingSize4 cAtomQFRingSize5 cAtomQFRingSize6 cAtomQFRingSize7 cAtomQFRingSizeLarge cAtomQFRingState cAtomQFRingStateBits cAtomQFRingStateShift cAtomQFRxnParityBits cAtomQFRxnParityHint cAtomQFRxnParityInvert cAtomQFRxnParityRacemize cAtomQFRxnParityRetain cAtomQFRxnParityShift cAtomQFSimpleFeatures cAtomQFSmallRingSize cAtomQFSmallRingSizeBits cAtomQFSmallRingSizeShift cAtomQFStereoState cAtomQFStereoStateBits cAtomQFStereoStateShift cAtomRadicalState cAtomRadicalStateD cAtomRadicalStateNone cAtomRadicalStateS cAtomRadicalStateShift cAtomRadicalStateT cAtomValence cBondCIPParityEorP cBondCIPParityNone cBondCIPParityProblem cBondCIPParityZorM cBondFlagsHelper2 cBondFlagsHelper3 cBondParityEor1 cBondParityNone cBondParityUnknown cBondParityZor2 cBondQFAllFeatures cBondQFAromState cBondQFAromStateBits cBondQFAromStateShift cBondQFAromatic cBondQFBondTypes cBondQFBondTypesBits cBondQFBondTypesShift cBondQFBridge cBondQFBridgeBits cBondQFBridgeMin cBondQFBridgeMinBits cBondQFBridgeMinShift cBondQFBridgeShift cBondQFBridgeSpan cBondQFBridgeSpanBits cBondQFBridgeSpanShift cBondQFDelocalized cBondQFDouble cBondQFMatchFormalOrder cBondQFMatchStereo cBondQFMetalLigand cBondQFNarrowing cBondQFNoOfBits cBondQFNotAromatic cBondQFNotRing cBondQFQuadruple cBondQFQuintuple cBondQFRareBondTypes cBondQFRareBondTypesBits cBondQFRareBondTypesShift cBondQFRing cBondQFRingSize cBondQFRingSizeBits cBondQFRingSizeShift cBondQFRingState cBondQFRingStateBits cBondQFRingStateShift cBondQFSimpleFeatures cBondQFSingle cBondQFTriple cBondTypeCross cBondTypeDeleted cBondTypeDelocalized cBondTypeDouble cBondTypeDown cBondTypeIncreaseOrder cBondTypeMaskSimple cBondTypeMaskStereo cBondTypeMetalLigand cBondTypeQuadruple cBondTypeQuintuple cBondTypeSingle cBondTypeTriple cBondTypeUp cChiralityDiastereomers cChiralityEpimers cChiralityIsomerCountMask cChiralityKnownEnantiomer cChiralityMeso cChiralityNotChiral cChiralityRacemic cChiralityUnknown cChiralityUnknownEnantiomer cCommonOxidationState cDefaultAVBL cDefaultAllowedPseudoAtoms cDefaultAtomValence cESRGroupBits cESRMaxGroups cESRTypeAbs cESRTypeAnd cESRTypeOr cHelperAll cHelperBitCIP cHelperBitIncludeNitrogenParities cHelperBitNeighbours cHelperBitParities cHelperBitRings cHelperBitRingsSimple cHelperBitSymmetrySimple cHelperBitSymmetryStereoHeterotopicity cHelperBitsStereo cHelperCIP cHelperNeighbours cHelperNone cHelperParities cHelperRings cHelperRingsSimple cHelperSymmetrySimple cHelperSymmetryStereoHeterotopicity cMaxAtomicNo cMaxConnAtoms cMoleculeColorDefault cMoleculeColorNeutral cPseudoAtomA cPseudoAtomAttachmentPoint cPseudoAtomPolymer cPseudoAtomR cPseudoAtomX cPseudoAtomsAGroups cPseudoAtomsAll cPseudoAtomsAminoAcids cPseudoAtomsHydrogenIsotops cPseudoAtomsRGroups cRoundedMass

Methods

addAtom addBond addFragment addImplicitHydrogens addMissingChirality addMolecule addOrChangeAtom addOrChangeBond addRing addRingToAtom addRingToBond addSubstituent calculateTorsion canonizeCharge changeAtom changeAtomCharge changeBond clear convertStereoBondsToSingleBonds copyAtom copyBond copyMolecule copyMoleculeByAtoms copyMoleculeByBonds copyMoleculeProperties deleteAtom deleteAtomOrBond deleteAtoms deleteBond deleteBondAndSurrounding deleteMarkedAtomsAndBonds deleteMolecule deleteSelectedAtoms ensureHelperArrays findAlleneCenterAtom findAlleneEndAtom findAtom findBINAPChiralityBond findBond findRingSystem getAbsoluteAtomParity getAbsoluteBondParity getAllAtoms getAllBonds getAllConnAtoms getAllConnAtomsPlusMetalBonds getAllHydrogens getAromaticRingCount getAtomAbnormalValence getAtomCIPParity getAtomCharge getAtomColor getAtomCustomLabel getAtomESRGroup getAtomESRType getAtomLabel getAtomList getAtomListString getAtomMapNo getAtomMass getAtomParity getAtomPi getAtomPreferredStereoBond getAtomRadical getAtomRingBondCount getAtomRingCount getAtomRingSize getAtomX getAtomY getAtomZ getAtomicNo getAtoms getAverageBondLength getAverageTopologicalAtomDistance getBond getBondAngle getBondAtom getBondBridgeMaxSize getBondBridgeMinSize getBondCIPParity getBondESRGroup getBondESRType getBondLength getBondOrder getBondParity getBondPreferredStereoBond getBondQueryFeatures getBondRingSize getBondType getBondTypeSimple getBonds getBounds getCanonizedIDCode getChiralText getChirality getCompactCopy getConnAtom getConnAtoms getConnBond getConnBondOrder getDefaultMaxValenceUncharged getDiastereotopicAtomIDs getElectronValenceCorrection getExcludedNeighbourCount getExplicitHydrogens getFinalRanks getFisherProjectionParity getFragmentAtoms getFragmentNumbers getFragments getFreeValence getHandleHydrogenMap getHelperArrayStatus getHoseCodes getIDCode getIDCodeAndCoordinates getIDCoordinates getImplicitHigherValence getImplicitHydrogens getIndex getLowestFreeValence getMaxAtoms getMaxBonds getMaxValence getMaxValenceUncharged getMetalBondedConnAtoms getMolecularFormula getMoleculeColor getMolweight getName getNonHydrogenNeighbourCount getNumberOfHydrogens getOCL getOccupiedValence getPath getPathBonds getPathLength getRingSet getRotatableBondCount getStereoBond getStereoCenterCount getStereoProblem getSubstituent getSubstituentSize getSymmetryRank getZNeighbour invalidateHelperArrays inventCoordinates is3D isAlkaliMetal isAllylicAtom isAmideTypeBond isAromaticAtom isAromaticBond isAtomConfigurationUnknown isAtomMarkedForDeletion isAtomParityPseudo isAtomStereoCenter isAutoMappedAtom isBINAPChiralityBond isBondBackgroundHilited isBondBridge isBondForegroundHilited isBondMarkedForDeletion isBondParityPseudo isBondParityUnknownOrNone isChalcogene isDelocalizedBond isEarthAlkaliMetal isElectronegative isElectropositive isFlatNitrogen isFragment isHalogene isMarkedAtom isMetalAtom isNaturalAbundanc isNitrogenFamily isOrganicAtom isPseudoRotatableBond isPurelyOrganic isRingAtom isRingBond isSelectedAtom isSelectedBond isSimpleHydrogen isSmallRingAtom isSmallRingBond isStabilizedAtom isStereoBond markAtomForDeletion markBondForDeletion normalizeAmbiguousBonds removeAtomColors removeAtomCustomLabels removeAtomMarkers removeAtomSelection removeBondHiliting removeExplicitHydrogens removeQueryFeatures renumberESRGroups scaleCoords setAllAtoms setAllBonds setAssignParitiesToNitrogen setAtomAbnormalValence setAtomCIPParity setAtomCharge setAtomColor setAtomConfigurationUnknown setAtomCustomLabel setAtomESR setAtomList setAtomMapNo setAtomMarker setAtomMass setAtomParity setAtomRadical setAtomSelection setAtomX setAtomY setAtomZ setAtomicNo setBondAtom setBondBackgroundHiliting setBondCIPParity setBondESR setBondForegroundHiliting setBondOrder setBondParity setBondParityUnknownOrNone setBondQueryFeature setBondType setChirality setFragment setHelperValidity setHydrogenProtection setMaxAtoms setMaxBonds setMoleculeColor setName setParitiesValid setStereoBondFromAtomParity setStereoBondFromBondParity setStereoBondsFromParity setToRacemate setUnknownParitiesToExplicitlyUnknown shareSameFragment stripIsotopInfo stripSmallFragments stripStereoInformation suggestBondType supportsImplicitHydrogen swapAtoms swapBonds toIsomericSmiles toMolfile toMolfileV3 toSVG toSmiles translateCoords validate zoomAndRotate zoomAndRotateInit fromIDCode fromMolfile fromMolfileWithAtomMap fromSmiles getAngle getAngleDif getAtomicNoFromLabel getDefaultAverageBondLength isAtomicNoElectronegative isAtomicNoElectropositive setDefaultAverageBondLength

Constructors

  • Construct a new molecule.

    Parameters

    • maxAtoms: number

      Maximum number of initialized atoms. Default: 256.

    • maxBonds: number

      Maximum number of initialized bonds. Default: 256.

    Returns Molecule

Properties

CANONIZER_ASSIGN_PARITIES_TO_TETRAHEDRAL_N: number
CANONIZER_CONSIDER_DIASTEREOTOPICITY: number
CANONIZER_CONSIDER_ENANTIOTOPICITY: number
CANONIZER_CONSIDER_STEREOHETEROTOPICITY: number
CANONIZER_COORDS_ARE_3D: number
CANONIZER_CREATE_PSEUDO_STEREO_GROUPS: number
CANONIZER_CREATE_SYMMETRY_RANK: number
CANONIZER_DISTINGUISH_RACEMIC_OR_GROUPS: number
CANONIZER_ENCODE_ATOM_CUSTOM_LABELS: number
CANONIZER_ENCODE_ATOM_CUSTOM_LABELS_WITHOUT_RANKING: number
CANONIZER_ENCODE_ATOM_SELECTION: number
CANONIZER_NEGLECT_ANY_STEREO_INFORMATION: number
CANONIZER_TIE_BREAK_FREE_VALENCE_ATOMS: number
FISCHER_PROJECTION_LIMIT: number
FISCHER_PROJECTION_RING_LIMIT: number
STEREO_ANGLE_LIMIT: number
VALIDATION_ERRORS_STEREO: string[]
VALIDATION_ERROR_AMBIGUOUS_CONFIGURATION: string
VALIDATION_ERROR_ESR_CENTER_UNKNOWN: string
VALIDATION_ERROR_OVER_UNDER_SPECIFIED: string
cAtomCIPParityNone: number
cAtomCIPParityProblem: number
cAtomCIPParityRorM: number
cAtomCIPParitySorP: number
cAtomColorBlue: number
cAtomColorDarkGreen: number
cAtomColorDarkRed: number
cAtomColorGreen: number
cAtomColorMagenta: number
cAtomColorNone: number
cAtomColorOrange: number
cAtomColorRed: number
cAtomLabel: string[]
cAtomParity1: number
cAtomParity2: number
cAtomParityIsPseudo: number
cAtomParityNone: number
cAtomParityUnknown: number
cAtomQFAny: number
cAtomQFAromState: number
cAtomQFAromStateBits: number
cAtomQFAromStateShift: number
cAtomQFAromatic: number
cAtomQFCharge: number
cAtomQFChargeBits: number
cAtomQFChargeShift: number
cAtomQFENeighbourBits: number
cAtomQFENeighbourShift: number
cAtomQFENeighbours: number
cAtomQFExcludeGroup: number
cAtomQFFlatNitrogen: number
cAtomQFHeteroAromatic: number
cAtomQFHydrogen: number
cAtomQFHydrogenBits: number
cAtomQFHydrogenShift: number
cAtomQFIsNotStereo: number
cAtomQFIsStereo: number
cAtomQFMatchStereo: number
cAtomQFMoreNeighbours: number
cAtomQFNarrowing: number
cAtomQFNeighbourBits: number
cAtomQFNeighbourShift: number
cAtomQFNeighbours: number
cAtomQFNewRingSize: number
cAtomQFNewRingSizeBits: number
cAtomQFNewRingSizeShift: number
cAtomQFNoMoreNeighbours: number
cAtomQFNoOfBits: number
cAtomQFNot0ENeighbours: number
cAtomQFNot0Hydrogen: number
cAtomQFNot0Neighbours: number
cAtomQFNot0PiElectrons: number
cAtomQFNot1ENeighbour: number
cAtomQFNot1Hydrogen: number
cAtomQFNot1Neighbour: number
cAtomQFNot1PiElectron: number
cAtomQFNot2ENeighbours: number
cAtomQFNot2Hydrogen: number
cAtomQFNot2Neighbours: number
cAtomQFNot2PiElectrons: number
cAtomQFNot2RingBonds: number
cAtomQFNot3ENeighbours: number
cAtomQFNot3Hydrogen: number
cAtomQFNot3Neighbours: number
cAtomQFNot3RingBonds: number
cAtomQFNot4ENeighbours: number
cAtomQFNot4Neighbours: number
cAtomQFNot4RingBonds: number
cAtomQFNotAromatic: number
cAtomQFNotChain: number
cAtomQFNotCharge0: number
cAtomQFNotChargeNeg: number
cAtomQFNotChargePos: number
cAtomQFPiElectronBits: number
cAtomQFPiElectronShift: number
cAtomQFPiElectrons: number
cAtomQFRingSize0: number
cAtomQFRingSize3: number
cAtomQFRingSize4: number
cAtomQFRingSize5: number
cAtomQFRingSize6: number
cAtomQFRingSize7: number
cAtomQFRingSizeLarge: number
cAtomQFRingState: number
cAtomQFRingStateBits: number
cAtomQFRingStateShift: number
cAtomQFRxnParityBits: number
cAtomQFRxnParityHint: number
cAtomQFRxnParityInvert: number
cAtomQFRxnParityRacemize: number
cAtomQFRxnParityRetain: number
cAtomQFRxnParityShift: number
cAtomQFSimpleFeatures: number
cAtomQFSmallRingSize: number
cAtomQFSmallRingSizeBits: number
cAtomQFSmallRingSizeShift: number
cAtomQFStereoState: number
cAtomQFStereoStateBits: number
cAtomQFStereoStateShift: number
cAtomRadicalState: number
cAtomRadicalStateD: number
cAtomRadicalStateNone: number
cAtomRadicalStateS: number
cAtomRadicalStateShift: number
cAtomRadicalStateT: number
cAtomValence: number[][]
cBondCIPParityEorP: number
cBondCIPParityNone: number
cBondCIPParityProblem: number
cBondCIPParityZorM: number
cBondFlagsHelper2: number
cBondFlagsHelper3: number
cBondParityEor1: number
cBondParityNone: number
cBondParityUnknown: number
cBondParityZor2: number
cBondQFAllFeatures: number
cBondQFAromState: number
cBondQFAromStateBits: number
cBondQFAromStateShift: number
cBondQFAromatic: number
cBondQFBondTypes: number
cBondQFBondTypesBits: number
cBondQFBondTypesShift: number
cBondQFBridge: number
cBondQFBridgeBits: number
cBondQFBridgeMin: number
cBondQFBridgeMinBits: number
cBondQFBridgeMinShift: number
cBondQFBridgeShift: number
cBondQFBridgeSpan: number
cBondQFBridgeSpanBits: number
cBondQFBridgeSpanShift: number
cBondQFDelocalized: number
cBondQFDouble: number
cBondQFMatchFormalOrder: number
cBondQFMatchStereo: number
cBondQFMetalLigand: number
cBondQFNarrowing: number
cBondQFNoOfBits: number
cBondQFNotAromatic: number
cBondQFNotRing: number
cBondQFQuadruple: number
cBondQFQuintuple: number
cBondQFRareBondTypes: number
cBondQFRareBondTypesBits: number
cBondQFRareBondTypesShift: number
cBondQFRing: number
cBondQFRingSize: number
cBondQFRingSizeBits: number
cBondQFRingSizeShift: number
cBondQFRingState: number
cBondQFRingStateBits: number
cBondQFRingStateShift: number
cBondQFSimpleFeatures: number
cBondQFSingle: number
cBondQFTriple: number
cBondTypeCross: number
cBondTypeDeleted: number
cBondTypeDelocalized: number
cBondTypeDouble: number
cBondTypeDown: number
cBondTypeIncreaseOrder: number
cBondTypeMaskSimple: number
cBondTypeMaskStereo: number
cBondTypeMetalLigand: number
cBondTypeQuadruple: number
cBondTypeQuintuple: number
cBondTypeSingle: number
cBondTypeTriple: number
cBondTypeUp: number
cChiralityDiastereomers: number
cChiralityEpimers: number
cChiralityIsomerCountMask: number
cChiralityKnownEnantiomer: number
cChiralityMeso: number
cChiralityNotChiral: number
cChiralityRacemic: number
cChiralityUnknown: number
cChiralityUnknownEnantiomer: number
cCommonOxidationState: number[][]
cDefaultAVBL: number
cDefaultAllowedPseudoAtoms: number
cDefaultAtomValence: number
cESRGroupBits: number
cESRMaxGroups: number
cESRTypeAbs: number
cESRTypeAnd: number
cESRTypeOr: number
cHelperAll: number
cHelperBitCIP: number
cHelperBitIncludeNitrogenParities: number
cHelperBitNeighbours: number
cHelperBitParities: number
cHelperBitRings: number
cHelperBitRingsSimple: number
cHelperBitSymmetrySimple: number
cHelperBitSymmetryStereoHeterotopicity: number
cHelperBitsStereo: number
cHelperCIP: number
cHelperNeighbours: number
cHelperNone: number
cHelperParities: number
cHelperRings: number
cHelperRingsSimple: number
cHelperSymmetrySimple: number
cHelperSymmetryStereoHeterotopicity: number
cMaxAtomicNo: number
cMaxConnAtoms: number
cMoleculeColorDefault: number
cMoleculeColorNeutral: number
cPseudoAtomA: number
cPseudoAtomAttachmentPoint: number
cPseudoAtomPolymer: number
cPseudoAtomR: number
cPseudoAtomX: number
cPseudoAtomsAGroups: number
cPseudoAtomsAll: number
cPseudoAtomsAminoAcids: number
cPseudoAtomsHydrogenIsotops: number
cPseudoAtomsRGroups: number
cRoundedMass: number[]

Methods

  • Parameters

    • atomicNo: number

    Returns number

  • Adds a single or metal bond between the two atoms depending on whether one of them is a metal atom.

    Parameters

    • atom1: number
    • atom2: number

    Returns number

  • This adds a fragment from sourceMol to this molecule by first copying rootAtom and then all connected atoms and bonds by traversing the graph breadth first.

    Parameters

    • sourceMol: Molecule

      molecule from which the fragment is copied to this

    • rootAtom: number
    • atomMap: number[]

      null or int[] not smaller than sourceMol.mAllAtoms; receives atom indices of this molecule

    Returns void

  • Expand and find a position for all the hydrogens of the 2D molecule. If atomNumber is specified, the function only applies for the hydrogens of the given atom.

    Parameters

    • Optional atomNumber: number

    Returns void

  • Parameters

    • Optional esrType: number

    Returns void

  • Copies all atoms and bonds of mol to the end of this Molecule's atom and bond tables. If mol is a fragment then this Molecule's fragment flag is set to true and all query features of mol are also copied.

    Parameters

    Returns number[]

    Atom mapping from original mol to this molecule after incorporation of mol.

  • Parameters

    • x: number
    • y: number
    • atomicNo: number
    • mass: number
    • abnormalValence: number
    • radical: number
    • customLabel: string

    Returns boolean

  • Parameters

    • atm1: number
    • atm2: number
    • type: number

    Returns number

  • Parameters

    • x: number
    • y: number
    • ringSize: number
    • aromatic: boolean
    • bondLength: number

    Returns boolean

  • Parameters

    • atom: number
    • ringSize: number
    • aromatic: boolean
    • bondLength: number

    Returns boolean

  • Parameters

    • bond: number
    • ringSize: number
    • aromatic: boolean
    • bondLength: number

    Returns boolean

  • Adds and connects the substituent molecule to the connectionAtom of this molecule. Substituent atoms with atomicNo=0 are not copied and considered to represent the connectionAtom. Bonds leading to them, however, are copied and connected to the connectionAtom. High level function for constructing a molecule.

    Parameters

    • substituent: Molecule
    • connectionAtom: number

    Returns number[]

    atom mapping from substituent to this molecule after addition of substituent

  • Calculates a signed torsion as an exterior spherical angle from a valid 4-atom strand. Looking along the central bond, the torsion angle is 0.0, if the projection of front and rear bonds point in the same direction. If the front bond is rotated in the clockwise direction, the angle increases, i.e. has a positive value. http://en.wikipedia.org/wiki/Dihedral_angle

    Parameters

    • atom: number[]

      4 valid atom indices defining a connected atom sequence

    Returns number

    torsion in the range: -pi <= torsion <= pi

  • Normalizes charge distribution in single- and multifragment molecules. In a first step polar bonds (both atoms have opposite charge) are neutralized by removing both atom charges and increasing the bond order, provided that atom valences allow the change. Neutralizes positive and an equal amount of negative charges on electronegative atoms, provided these are not on 1,2-dipolar structures, in order to ideally achieve a neutral molecule. This method does not change the overall charge of the molecule. It does not change the number of explicit atoms or bonds or their connectivity except bond orders. This method does not deprotonate acidic groups to compensate for quarternary charged nitrogen.

    Parameters

    • allowUnbalancedCharge: boolean

      throws an exception after polar bond neutralization, if overall charge is not zero

    Returns number

    remaining overall molecule charge

  • Parameters

    • atom: number
    • atomicNo: number
    • mass: number
    • abnormalValence: number
    • radical: number

    Returns boolean

  • Parameters

    • atom: number
    • positive: boolean

    Returns boolean

  • Parameters

    • bnd: number
    • type: number

    Returns boolean

  • Empties the molecule to serve as container for constructing a new molecule, e.g. by multiply calling addAtom(...), addBond(...) and other high level methods.

    Returns void

  • Converts any stereo bond attached with its pointed tip to this atom into a single bond.

    Parameters

    • atom: number

    Returns void

  • Creates a new atom in destMol and copies all source atom properties including atom list, custom label, flags, and mapNo to it.

    Parameters

    • destMol: Molecule
    • sourceAtom: number
    • esrGroupOffsetAND: number

      1 to create new ESR group or destMol ESR group count from esrGroupCountAND()

    • esrGroupOffsetOR: number

      1 to create new ESR group or destMol ESR group count from esrGroupCountOR()

    Returns number

    Index of new atom in destMol.

  • Parameters

    • destMol: Molecule
    • sourceBond: number
    • esrGroupOffsetAND: number

      1 to create new ESR group or destMol ESR group count from esrGroupCountAND()

    • esrGroupOffsetOR: number

      1 to create new ESR group or destMol ESR group count from esrGroupCountOR()

    Returns number

  • Copies this molecule including parity settings, if valid. The original content of destMol is replaced. Helper arrays are not copied and need to be recalculated if needed.

    Parameters

    Returns void

  • Clears destmol and then copies a part of this Molecule into destMol, being defined by a mask of atoms to be included. If not all atoms are copied, then destMol is set to be a substructure fragment.

    Parameters

    • destMol: Molecule

      receives the part of this Molecule

    • includeAtom: boolean[]

      defines atoms to be copied; its size may be this.getAtoms() or this.getAllAtoms()

    • recognizeDelocalizedBonds: boolean

      defines whether disconnected delocalized bonds will keep their single/double bond status or whether the query feature 'delocalized bond' will be set

    • atomMap: number[]

      null or int[] not smaller than includeAtom.length; receives atom indices of dest molecule

    Returns void

  • Clears destmol and then copies a part of this Molecule into destMol, being defined by a mask of bonds to be included. Bonds, whose atoms carry opposite charges are treated in the following manner: If only one of the two bond atoms is kept, then its absolute charge will be reduced by 1.

    Parameters

    • destMol: Molecule

      receives the part of this Molecule

    • includeBond: boolean[]

      defines bonds to be copied

    • recognizeDelocalizedBonds: boolean

      defines whether disconnected delocalized bonds will keep their single/double bond status or whether the query feature 'delocalized bond' will be set

    • atomMap: number[]

      null or int[] not smaller than this.getAllAtoms()

    Returns number[]

    atom map from this to destMol with not copied atom's index being -1

  • Copies name,isFragment,chirality and validity of parity & CIP flags. When copying molecules parts only or when changing the atom order during copy, then atom parities or CIP parities may not be valid anymore and invalidateHelperArrays([affected bits]) should be called in these cases.

    Parameters

    Returns void

  • After the deletion the original order of atom and bond indexes is retained.

    Parameters

    • atom: number

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns boolean

  • After the deletion the original order of atom and bond indexes is retained.

    Parameters

    • atomList: number[]

    Returns number[]

  • After the deletion the original order of atom and bond indexes is retained.

    Parameters

    • bond: number

    Returns void

  • After the deletion the original order of atom and bond indexes is retained.

    Parameters

    • bond: number

    Returns void

  • Deletes all atoms and bonds from the molecule, which were marked before for deletion by calling markAtomForDeletion() or markBondForDeletion(). Bonds connecting atoms of which at least one is marked for deletion, are deleted automatically and don't require to be explicitly marked.
    When multiple atoms and/or bonds need to be deleted, marking them and calling this method is more efficient than deleting them individually with deleteAtom() and deleteBond(). Bonds, whose atoms carry opposite charges are treated in the following manner: If only one of the two bond atoms is kept, then its absolute charge will be reduced by 1. After the deletion the original order of atom and bond indexes is retained.

    Returns number[]

    mapping from old to new atom indices; null if no atoms nor bonds were deleted.

  • Returns void

    Deprecated

    Use clear() instead of this method.

  • Delete all selected atoms and all bonds attached to them. After the deletion the original order of atom and bond indexes is retained.

    Returns boolean

  • While the Molecule class covers all primary molecule information, its derived class ExtendedMolecule handles secondary, i.e. calculated molecule information, which is cached in helper arrays and stays valid as long as the molecule's primary information is not changed. Most methods of ExtendedMolecule require some of the helper array's information. High level methods, e.g. getPath(), take care of updating an outdated cache themselves. Low level methods, e.g. isAromaticAtom(), which typically are called very often, do not check for validity nor update the helper arrays themselves. If you use low level methods, then you need to make sure that the needed helper array information is valid by this method.
    For performance reasons there are distinct levels of helper information. (A higher level always includes all properties of the previous level):
    cHelperNeighbours: explicit hydrogen atoms are moved to the end of the atom table and bonds leading to them are moved to the end of the bond table. This way algorithms can skip hydrogen atoms easily. For every atom directly connected atoms and bonds (with and without hydrogens) are determined. The number of pi electrons is counted.
    cHelperRings: Aromatic and non-aromatic rings are detected. Atom and bond ring properties are set and a ring collection provides a total set of small rings (7 or less atoms). Atoms being in allylic/benzylic or stabilized (neighbor of a carbonyl or similar group) position are flagged as such.
    cHelperParities: Atom (tetrahedral or axial) and bond (E/Z or atrop) parities are calculated from the stereo configurations.
    cHelperCIP: Cahn-Ingold-Prelog stereo information for atoms and bonds.

    cHelperParities and cHelperCIP require a StereoMolecule!!!

    Parameters

    • required: number

      one of cHelperNeighbours,cHelperRings,cHelperParities,cHelperCIP

    Returns void

    true if the molecule was changed

  • If atom is one of the two ends of an allene then returns allene center atom.

    Parameters

    • atom: number

    Returns number

    allene center or -1

  • Crawls along a chain of sp-hybridized atoms starting from atom2 (which may not be sp-hybridized) away from its sp-hybridized neighbour atom1. Returns the first atom that is either not sp-hybridized anymore or the last atom of the chain if that is still sp-hybridized. Returns -1 in case of an sp-hybridized cycle.

    Parameters

    • atom1: number

      sp-hybridized atom

    • atom2: number

      neighbour atom of atom1

    Returns number

    first non-sp-hybridized atom when crawling from atom2 away from atom1

  • Parameters

    • pickx: number
    • picky: number

    Returns number

    index of closest of nearby atoms or -1, if no atom is close.

  • Checks whether atom is one of the two atoms of an axial chirality bond of BINAP type. Condition: non-aromatic single bond connecting two aromatic rings with 6 or more members that together bear at least three ortho substituents. A stereo bond indicating the chirality is not(!!!) a condition.

    Parameters

    • atom: number

      to check, whether it is part of a bond, which has BINAP type of axial chirality

    Returns number

    axial chirality bond or -1 if axial chirality conditions are not met

  • Parameters

    • pickx: number
    • picky: number

    Returns number

    index of closest of nearby bonds or -1, if no bond is close.

  • Starting from startAtom this method locates a system of annelated or bridged ring systems with all members bonds being a ring bond. Detected member atoms and bonds are flagged accordingly.

    Parameters

    • startAtom: number
    • aromaticOnly: boolean

      if set then only aromatic atoms and bonds are considered

    • isMemberAtom: boolean[]
    • isMemberBond: boolean[]

    Returns void

  • This returns the absolute(!) atom parity from the canonization procedure. While the molecule's (relative) atom parity returned by getAtomParity() is based on atom indices and therefore depends on the order of atoms, the absolute atom parity is based on atom ranks and therefore independent of the molecule's atom order. Usually relative parities are used, because the atom's stereo situation can be interpreted without the need for atom rank calculation. This requires valid helper arrays level cHelperParities or higher.

    Parameters

    • atom: number

    Returns number

    one of the Molecule.cAtomParityXXX constants

  • This returns the absolute(!) bond parity from the canonization procedure. While the molecule's (relative) bond parity returned by getBondParity() is based on atom indices and therefore depends on the order of atoms, the absolute bond parity is based on atom ranks and therefore independent of the molecule's atom order. Usually relative parities are used, because the bond's stereo situation can be interpreted without the need for atom rank calculation. This requires valid helper arrays level cHelperParities or higher.

    Parameters

    • bond: number

    Returns number

    one of the Molecule.cBondParityXXX constants

  • Returns number

    the number of all atoms, which includes hydrogen atoms.

  • Returns number

    the number of all bonds, which includes those connecting hydrogen atoms.

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number

    Returns number

    count of category 1 & 2 neighbour atoms (excludes neighbours connected with zero bond order)

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number

    Returns number

    count of category 1 & 2 & 3 neighbour atoms

  • Parameters

    • atom: number

    Returns number

    the number of connected plain explicit and implicit hydrogen atoms

  • Get an atom's defined maximum valance if different from the default one.

    Parameters

    • atom: number

    Returns number

    valence 0-14: new maximum valence; -1: use default

  • The atom Cahn-Ingold-Prelog parity is a calculated property available above/equal helper level cHelperCIP. It encodes the stereo configuration of an atom with its neighbors using up/down-bonds or 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation is space. This method is called by the Canonizer and usually should not be called otherwise.

    Parameters

    • atom: number

    Returns number

    one of cAtomCIPParityNone,cAtomCIPParityRorM,cAtomCIPParitySorP,cAtomCIPParityProblem

  • Parameters

    • atom: number

    Returns number

    The formal atom charge.

  • Parameters

    • atom: number

    Returns number

  • If a custom atom label is set, a molecule depiction displays the custom label instead of the original one.

    Parameters

    • atom: number

    Returns string

    null or previously defined atom custom label

  • This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • atom: number

    Returns number

    group index starting with 0

  • This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • atom: number

    Returns number

    one of cESRTypeAbs,cESRTypeAnd,cESRTypeOr

  • Parameters

    • atom: number

    Returns string

    standard atom label of the atom: C,Li,Sc,...

  • The list of atoms that are allowed at this position during sub-structure search. (or refused atoms, if atom query feature cAtomQFAny is set).

    Parameters

    • atom: number

    Returns number[]

    null or sorted list of unique atomic numbers, if defined.

  • Parameters

    • atom: number

    Returns string

  • Returns an atom mapping number within the context of a reaction. Atoms that that share the same mapping number on the reactant and product side are considered to be the same atom.

    Parameters

    • atom: number

    Returns number

  • Parameters

    • atom: number

    Returns number

    atom mass, if is specific isotop, otherwise 0 for natural abundance

  • The atom parity is a calculated property available above/equal helper level cHelperParities. It describes the stereo configuration of a chiral atom and is calculated either from 2D-atom-coordinates and up/down-bonds or from 3D-atom-coordinates, whatever is available. It depends on the atom indexes of the neighbor atoms and their orientation in space.
    The parity is defined as follows: Look at the chiral atom such that its neighbor atom with the highest atom index (or the hydrogen atom if it is implicit) is oriented to the back. If the remaining three neighbors are in clockwise order (considering ascending atom indexes) than the parity is 1. If they are in anti-clockwise order, then the parity is 2.
    For linear chirality (allenes): Look along the straight line of double bonds such that the rear neighbor with the lower atom index points to the top. If the front neighbor with the lower atom index points to the right than the parity is 1.

    Parameters

    • atom: number

    Returns number

    one of cAtomParity1,cAtomParity2,cAtomParityNone,cAtomParityUnknown

  • This is different from the Hendrickson pi-value, which considers pi-bonds to carbons only.

    Parameters

    • atom: number

    Returns number

    the number pi electrons at atom (the central atom of acetone would have 1)

  • Locates that single bond which is the preferred one to be converted into up/down bond in order to define the atom chirality.

    Parameters

    • atom: number

      parity carrying atom, i.e. a tetrahedral stereocenter or central allene atom

    Returns number

    preferred bond or -1, if no single bond existing

  • Gets an atom's radical state as singulet,dublet,triplet or none

    Parameters

    • atom: number

    Returns number

    one of cAtomRadicalStateNone,cAtomRadicalStateS,cAtomRadicalStateD,cAtomRadicalStateT

  • Parameters

    • atom: number

    Returns number

  • Calculates the number of independent rings of which 'atom' is a member. Any combination of two connected atoms to 'atom' is used for: - finding the shortest path connecting these two neighbors avoiding 'atom' - if such a path exists and at least one bonds of that path is not a member of a path found earlier then count this path as an independent ring closure.

    Parameters

    • atom: number
    • maxRingSize: number

    Returns number

    number of independent rings

  • Parameters

    • atom: number

    Returns number

    0 or the size of the smallest ring that atom is a member of

  • Parameters

    • atom: number

    Returns number

  • Parameters

    • atom: number

    Returns number

  • Parameters

    • atom: number

    Returns number

  • In addition to the natural atomic numbers, we support additional pseudo atomic numbers. Most of these are for compatibility with the MDL atom table, e.g. for amino acids and R-groups. D and T are accepted for setting, but are on-the-fly translated to H with the proper atom mass.

    Parameters

    • atom: number

    Returns number

  • A validated molecule (after helper array creation) contains a sorted list of all atoms with the plain (neglegible) hydrogen atoms at the end of the list. Neglegible hydrogen atoms a those that can be considered implicit, because they have no attached relevant information. Hydrogen atoms that cannot be neglected are special isotops (mass != 0), if they carry a custom label, if they are connected to another atom with bond order different from 1, or if they are connected to another neglegible hydrogen.
    Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Returns number

    the number relevant atoms not including neglegible hydrogen atoms

  • Calculates and returns the mean bond length of all bonds including or not including hydrogen bonds. If there are no bonds, then the average distance between unconnected atoms is returned. If we have less than 2 atoms, cDefaultAverageBondLength is returned.

    Parameters

    • nonHydrogenBondsOnly: boolean

    Returns number

  • Calculates for every non-H atom the mean value of all shortest routes (bonds in between) to any other atom of the same fragment.

    Returns number[]

  • Parameters

    • atom1: number
    • atom2: number

    Returns number

    -1 or the bond that connects atom1 with atom2

  • Parameters

    • atom1: number
    • atom2: number

    Returns number

  • Parameters

    • no: 0 | 1

      0 or 1

    • bond: number

    Returns number

    atom index

  • Parameters

    • bond: number

    Returns number

  • Parameters

    • bond: number

    Returns number

  • The bond Cahn-Ingold-Prelog parity is a calculated property available above/equal helper level cHelperCIP. It encodes the stereo configuration of a bond with its neighbors using 2D-coordinates and up/down-bonds or 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation is space. This method is called by the Canonizer and usually should not be called otherwise. Considered are E/Z-double bonds and M/P-BINAP type single bonds.

    Parameters

    • bond: number

    Returns number

    one of cBondCIPParityNone,cBondCIPParityEorP,cBondCIPParityZorM,cBondCIPParityProblem

  • This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • bond: number

    Returns number

    group index starting with 0

  • This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • bond: number

    Returns number

    one of cESRTypeAbs,cESRTypeAnd,cESRTypeOr

  • Parameters

    • bond: number

    Returns number

    bond length calculated from atom 2D-coordinates.

  • Returns the formal bond order. Delocalized rings have alternating single and double bonds, which are returned as such. Bonds that are explicitly marked as being delocalized are returned as 1. Dative bonds are returned as 0.

    Parameters

    • bond: number

    Returns number

    formal bond order 0 (dative bonds), 1, 2, or 3

  • Returns the pre-calculated bond parity, e.g. cBondParityEor1. To distinguish double bond parities (E/Z) from parities of axial chirality, e.g. BINAP type (1/2) simply check with getBondOrder(bond): If the order is 2, then the parity describes E/Z, otherwise an axial parity.

    Parameters

    • bond: number

    Returns number

    one of cBondParity???

  • Locates that single bond which is the preferred one to be converted into up/down bond in order to define the bond chirality.

    Parameters

    • bond: number

      BINAP type of chirality bond

    Returns number

    preferred bond or -1, if no single bond existing

  • Parameters

    • bond: number

    Returns number

  • Parameters

    • bond: number

    Returns number

    0 or the size of the smallest ring that bond is a member of

  • Returns bond type combining bond order and stereo orientation.

    Parameters

    • bond: number

    Returns number

    one of cBondTypeSingle,cBondTypeDouble,cBondTypeUp,cBondTypeCross,...

  • This is the bond type without stereo information.

    Parameters

    • bond: number

    Returns number

    cBondTypeSingle,cBondTypeDouble,cBondTypeTriple,cBondTypeDelocalized

  • The bond list is preprocessed such that all bonds leading to a plain hydrogen atom (natural abundance, no custom labels) are at the end of the list. Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Returns number

    count of bonds not including those connecting plain-H atoms

  • Get an ID code for the molecule

    Parameters

    • flag: number

    Returns string

  • Gets the overall chirality of the molecule, which is a calculated information considering: Recognition of stereo centers and stereo bonds, defined ESR features, meso detection. The chirality combines the knowledge about how many stereo isomers are represented, whether all of these are meso, whether we have one defined stereo isomer, a mixture of racemates, epimers, or other diastereomers. The information is used during depiction.

    Returns number

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number
    • i: number

      index into sorted neighbour list

    Returns number

    the i-th neighbor atom of atom

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number

    Returns number

    count of category 1 neighbour atoms (excludes plain H and bond zero orders)

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number
    • i: number

      index into sorted neighbour list

    Returns number

    index of bond connecting atom with its i-th neighbor

  • The neighbours (connected atoms) of any atom are sorted by their relevance:

    1. non-plain-hydrogen atoms (bond order 1 and above)
    2. plain-hydrogen atoms (natural abundance, bond order 1)
    3. non-plain-hydrogen atoms (bond order 0, i.e. metall ligand bond)
      Only valid after calling ensureHelperArrays(cHelperNeighbours or higher);

    Parameters

    • atom: number
    • i: number

      index into sorted neighbour list

    Returns number

    order of bond connecting atom with its i-th neighbor

  • This is the default maximum valence of the atom neglecting atom charge or radical influences, e.g. N or N(+) -> 3. If the atomic no has multiple valid max valences, it is the highest one.

    Parameters

    • atom: number

    Returns number

  • Returns the diastereotopic Ids of all the atoms in the molecule.

    Returns string[]

  • This is the maximum valence correction caused by atom charge or radical status, e.g. N+ -> 1; N- -> -1; Al+ -> -1; C+,C- -> -1. In some cases, where the atomicNo can have multiple valences, the influence of a charge depends on the atom's actual valence, e.g. valence corrections for R3P(+) and R5P(+) are 1 and -1, respectively. Criteria are:
    -in the given valence state is there a lone pair that can be protonated
    -can we introduce a negative substituent as in BH3 or PF5 vs. SF6

    Parameters

    • atom: number
    • occupiedValence: number

    Returns number

  • This method returns the count of atom neighbours which are marked as being an exclude group.

    Parameters

    • atom: number

    Returns number

    the number of non-hydrogen neighbor atoms

  • Parameters

    • atom: number

    Returns number

    number of explicit plain hydrogen atoms (does not include D,T,custom labelled H, etc)

  • Returns the canonic numbering of the atoms.

    Parameters

    • flag: number

    Returns number[]

  • If the atom is a stereo center in fisher projection, then its tetrahedral parity is returned. If the horizontal bonds are plain single bonds, then they are interpreted as up-bonds.

    Parameters

    • atom: number

      the stereo center

    • sortedConnMap: number[]

      map of neighbours sorted by atom index

    • angle: number[]

      bond angles sorted by neighbour atom index

    • direction: number[]

      null or int[] large enough to receive bond directions

    Returns number

    cAtomParity1,cAtomParity2 or cAtomParityUnknown

  • Returns an array of all atoms for which a path of bonds leads to rootAtom. Metal ligand bonds may or may not be considered a connection.

    Parameters

    • rootAtom: number
    • considerMetalBonds: boolean

    Returns number[]

    atoms being in the same fragment as rootAtom

  • Locates all unconnected fragments in the Molecule and assigns fragment indexes for every atom starting with 0. Optionally the fragment detection may be restricted to those atoms that have been previously marked with setAtomMarker(). In that case non-marked atoms receive the fragment number -1 and are not considered a connection between marked atoms potentially causing two marked atoms to end up in different fragments, despite sharing the same fragment. Metal ligand bonds may or may not be considered a connection.

    Parameters

    • fragmentNo: number[]

      array at least mAllAtoms big to receive atom fragment indexes

    • markedAtomsOnly: boolean

      if true, then only atoms marked with setAtomMarker() are considered

    • considerMetalBonds: boolean

    Returns number

    number of disconnected fragments

  • Separates all disconnected fragments of this Molecule into individual Molecule objects. If fragment separation is only needed, if there are multiple fragments, it may be more efficient to run this functionality in two steps, e.g.:
    int[] fragmentNo = new int[mol.getAllAtoms()];
    int fragmentCount = getFragmentNumbers(fragmentNo, boolean, boolean);
    if (fragmentCount > 1) {
    StereoMolecule[] fragment = getUniqueFragmentsEstimated(int[] fragmentNo, fragmentCount);
    ...
    }

    Returns Molecule[]

  • The free valence is the number of potential additional single bonded neighbours to reach the atom's maximum valence. Atomic numbers that have multiple possible valences, the highest value is taken. Atom charges are considered. Implicit hydrogens are not considered. Thus, the oxygen in a R-O(-) has a free valence of 0, the nitrogen in R3N(+) has a free valence of

    1. Chlorine in Cl(-) has a free valence of 6. If you need the free valence taking the lowest possible valence into account, use getLowestFreeValence(), which would return 0 for Cl(-).

    Parameters

    • atom: number

    Returns number

  • If ensureHelperArrays() (and with it handleHydrogens()) was not called yet on a fresh molecule and if the molecule contains simple hydrogen atoms within non-hydrogens atoms, then this function returns a map from current atom indexes to those new atom indexes that would result from a call to handleHydrogens.

    Returns number[]

  • This function returns an array of HOSE(Hierarchical Organisation of Spherical Environments) codes represented as diastereotopic actelion IDs.

    Parameters

    Returns string[][]

  • This is a convenience method that creates the molecule's idcode without explicitly creating a Canonizer object for this purpose. The idcode is a compact String that uniquely encodes the molecule with all stereo and query features.
    WARNING: If the molecule has no atom coordinates but valid parities, e.g. after new IDCodeParser(false).parse(idcode, null), this method returns null;

    Returns string

  • Returns an object with both the ID code and coordinates of the molecule.

    Returns {
        coordinates: string;
        idCode: string;
    }

    • coordinates: string
    • idCode: string
  • This is a convenience method that creates the molecule's id-coordinates matching the idcode available with getIDCode(). It does not explicitly create a Canonizer object for this purpose.
    WARNING: If the molecule has no atom coordinates but valid parities, e.g. after new IDCodeParser(false).parse(idcode, null), this method returns null;

    Returns string

  • If the explicitly attached neighbors cause an atom valence to exceed the lowest allowed valence for this atomic no, then this method returns the next higher allowed valence, e.g. O=P(-H)-OMe :
    standard P valence is 3, used valence is 4, implicit abnormal valence is 5. The molecule is interpreted as O=PH2-OMe. Requires cHelperNeighbours!

    Parameters

    • atom: number
    • neglectExplicitHydrogen: boolean

    Returns number

    abnormal valence or -1 if valence doesn't exceed standard valence

  • Calculates and return the number of implicit hydrogens at atom. If atom is itself a hydrogen atom, a metal except Al, or a noble gase, then 0 is returned. For all other atom kinds the number of implicit hydrogens is basically the lowest typical valence that is compatible with the occupied valence, minus the occupied valence corrected by atom charge and radical state.

    Parameters

    • atom: number

    Returns number

  • Returns the int[] index array that can be used for substructure search.

    Returns number[]

  • The lowest free valence is the number of potential additional single bonded neighbours to reach the atom's lowest valence above or equal its current occupied valence. Atom charges are considered. Implicit hydrogens are not considered. Thus, the phosphor atoms in PF2 and PF4 both have a lowest free valence of 1. The oxygen in R-O(-) has a lowest free valence of 0, the nitrogen in R3N(+) has a free valence of 1. If you need the maximum possible free valence, use getFreeValence(), which would give 6 for Cl(-) and HCl.

    Parameters

    • atom: number

    Returns number

  • The currently defined maximum of atoms, which increases automatically when using high level construction methods and new atoms exceed the current maximum.

    Returns number

  • The currently defined maximum of bonds, which increases automatically when using high level construction methods and new bonds exceed the current maximum.

    Returns number

  • This is the defined maximum valence (or set abnormal valence) corrected by atom charge or radical influences, e.g. N(+) -> 4.

    Parameters

    • atom: number

    Returns number

  • This is the defined maximum valence (or set abnormal valence) neglecting atom charge or radical influences, e.g. N or N(+) -> 3.

    Parameters

    • atom: number

    Returns number

  • Parameters

    • atom: number

    Returns number

    count of neighbour atoms connected by a 0-order metal ligand bond

  • cMoleculeColorDefault: atom coloring depends on atomic number. Carbon and hydrogen are drawn in neutral color
    cMoleculeColorNeutral: all atoms and bonds and CIP letters are drawn in neutral color

    Returns number

    cMoleculeColorNeutral or cMoleculeColorDefault. In future may also return ARGB values.

  • Calculates a rounded mass of the molecule

    Returns number

  • Allows to set a molecule name or identifier, that is, for instance, written to or read from molfiles.

    Returns string

  • This method returns the non-hydrogen neighbour count of atom. It excludes any hydrogen atoms in contrast to getConnAtoms(), which only excludes plain hydrogen (not deuterium, tritium, custom labelled hydrogen, etc.). Don't use this method's return value for loops with getConnAtom(), getConnBond(), or getConnBondOrder().

    Parameters

    • atom: number

    Returns number

    the number of non-hydrogen neighbor atoms

  • Returns the count of hydrogens in the molecule.

    Returns number

  • Returns the OCL object.

    Returns any

  • The sum of bond orders of explicitly connected neighbour atoms including explicit hydrogen. In case of a fragment the occupied valence does not include bonds to atoms of which the cAtomQFExcludeGroup flag is set. Atom charge and radical states are not considered.

    Parameters

    • atom: number

    Returns number

    explicitly used valence

  • Locates and returns the shortest path between atoms atom1 and atom2

    Parameters

    • pathAtom: number[]

      array large enough to hold all path atoms, i.e. maxLength+1

    • atom1: number

      first atom of path; ends up in pathAtom[0]

    • atom2: number

      last atom of path; ends up in pathAtom[pathLength]

    • maxLength: number

      paths larger than maxLength won't be detected

    • neglectBond: boolean[]

      null or bitmask of forbidden bonds

    Returns number

    number of bonds of path; -1 if there is no path

  • Finds bonds of a path that is defined by an atom sequence.

    Parameters

    • pathAtom: number[]

      pathAtom[0]...[pathLength] -> list of atoms on path

    • pathBond: number[]

      int array not smaller than pathLength

    • pathLength: number

      no of path bonds == no of path atoms - 1

    Returns void

  • Calculates the length of the shortest path between atoms atom1 and atom2

    Parameters

    • atom1: number
    • atom2: number

    Returns number

    path length (no of bonds); -1 if there is no path

  • Simple method to calculate rotatable bonds. This method counts all single bonds provided that they

    • are not a terminal bond
    • are not part of a ring
    • are not an amide bond
    • are not the second of two equivalent bonds next to the same triple bond

    Returns number

  • Checks whether at least one of the connected bonds is a stereo bond. If atom is the central atom of an allene, then its direct neighbours are checked, whether one of them has a stereo bond.

    Parameters

    • atom: number

    Returns number

    the stereo bond or -1 if not found

  • The stereo problem flag is set by the stereo recognition (available equal/above helper level cHelperParities) if an atom has over- or under-specified stereo bonds attached, i.e. a stereo center with less or more than one up/down-bond, an non-stereo-center atom carrying (a) stereo bond(s), or a stereo center with neighbors coordinates such that the stereo configuration cannot be deduced. This flag is used by the depiction and causes affected atoms to be drawn in margenta.

    Parameters

    • atom: number

    Returns boolean

  • Determines all atoms of the substituent attached to coreAtom and starting with firstAtom. If isMemberAtom!=null, then all substituent member atoms will have the the respective index being flagged upon return. This includes firstAtom and excludes coreAtom. If substituent!=null, then it will contain the substituent as Molecule. At the position of the coreAtom substituent will contain a wildcard atom. If substituent!=null and atomMap!=null then atomMap receives atom index mapping from this to substituent with non-member atoms being -1. Returns -1 and an empty substituent if coreAtom and firstAtom share a ring

    Parameters

    • coreAtom: number

      the atom to which the substituent is connected

    • firstAtom: number

      the substituent's atom that is connected to coreAtom

    • isMemberAtom: boolean[]

      may be null, otherwise set to contain atom membership mask

    • substituent: Molecule

      may be null, otherwise set to contain the substituent

    • atomMap: number[]

      null or int[] not smaller than this.getAllAtoms()

    Returns number

    substituent atom count not counting coreAtom; -1 if coreAtom and firstAtom share a ring

  • Counts the number of atoms of the substituent connected to coreAtom defined by firstAtom and not including the coreAtom.

    Parameters

    • coreAtom: number
    • firstAtom: number

    Returns number

    atom count of substituent or -1 if coreAtom and firstAtom are in the same ring

  • This returns atom symmetry numbers from within the molecule canonicalization procedure. Atoms with same symmetry numbers can be considered topologically equivalent. Symmetry ranks are only available after calling ensureHelperArrays(cHelperSymmetry...). In mode cHelperSymmetrySimple stereoheterotopic atoms are considered equivalent. In mode cHelperSymmetryDiastereotopic only diastereotopic atoms are distinguished. In mode cHelperSymmetryEnantiotopic all stereoheterotopic atoms, i.e. enantiotopic and diastereotopic atoms, are distinguished.

    Parameters

    • atom: number

    Returns number

  • Provided that the bond parity of a double bond is available, this method determines, whether connAtom has a counterpart with Z- (cis) configuration at the other end of the double bond. If there is no Z-counterpart, then -1 is returned. Requires cHelperParities.

    Parameters

    • connAtom: number

      directly connected to one of the double bond atoms

    • bond: number

      double bond with available bond parity

    Returns number

    -1 or counterpart to connAtom in Z-configuration

  • Clears helperBits from mValidHelperArrays.

    Parameters

    • helperBits: number

    Returns void

  • Compute and set atom coordinates for this molecule.

    Returns void

  • Returns boolean

    true if at least one z-coordinate is different from 0.0

  • Parameters

    • atom: number

    Returns boolean

    whether atom is one of Li,Na,K,Rb,Cs

  • Parameters

    • atom: number

    Returns boolean

    whether the atom is in an allylic/benzylic position

  • Evaluates, whether bond is an amide bond, thio-amide, or amidine bond.

    Parameters

    • bond: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

  • Parameters

    • bond: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

    whether the atom's stereo configuration was explicitly declared unknown

  • Checks whether this atom was marked to be deleted and not deleted yet.

    Parameters

    • atom: number

    Returns boolean

  • Pseudo paries are parities that indicate a relative configuration. It always needs at least 2 pseudo parities (atom or bond) within a part of a molecule to be meaningful. This information is calculated by ensureHelperArrays(Molecule.cHelperCIP). Molecules extracted from IDCode don't know about pseudo parities.

    Parameters

    • atom: number

    Returns boolean

    whether this atom's parity is a relative configuration

  • Atoms with pseudo parities are not considered stereo centers. While parities are canonized and always refer to the full set of molecules (in case ESR groups are defined), this method returns true if this atom is a stereo center in any(!) of the individual molecules described by the ESR settings.

    Parameters

    • atom: number

    Returns boolean

    true if atom is stereo center in at least one molecule after ESR resolution

  • Parameters

    • atom: number

    Returns boolean

  • Checks whether bond is an axial chirality bond of the BINAP type. Condition: non-aromatic, non-small-ring (<= 7 members) single bond connecting two aromatic rings with 6 or more members each that together bear at least three ortho substituents. A stereo bond indicating the chirality is not(!!!) a condition.

    Parameters

    • bond: number

    Returns boolean

    true if axial chirality conditions are met

  • Used for depiction only.

    Parameters

    • bond: number

    Returns boolean

  • Parameters

    • bond: number

    Returns boolean

  • Used for depiction only.

    Parameters

    • bond: number

    Returns boolean

  • Checks whether this bond was marked to be deleted and not deleted yet.

    Parameters

    • bond: number

    Returns boolean

  • Parameters

    • bond: number

    Returns boolean

  • This hint/flag is set by CoordinateInventor for double bonds without given EZ-parity, because the new coordinates may imply a not intended EZ-parity. If parities are calculated later by the Canonizer is can correctly assign cBondParityUnknown if the bond is a stereo bond. The setBondParity() method clears this flag. This method usually should not be called for other purposes.

    Parameters

    • bond: number

    Returns boolean

    whether the bond parity was unknown when 2D- atom coordinates were created

  • Parameters

    • atom: number

    Returns boolean

    whether atom is one of O,S,Se,Te

  • A bond is considered delocalized, if it has different bond orders in different, but energetically equivalent mesomeric structures. Bonds in aromatic 6-membered rings typically are delocalized, while those in uncharged 5-membered aromatic rings are not. Indole has 6 delocalized bonds.

    Parameters

    • bond: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

    whether atom is one of Mg,Ca,Sr,Ba

  • Parameters

    • atom: number

    Returns boolean

    whether atom is an electronegative one

  • Parameters

    • atom: number

    Returns boolean

    whether atom is an electropositive one

  • Checks whether this nitrogen atom is flat, because it has a double bond, is member of an aromatic ring or is part of amide, an enamine or in resonance with an aromatic ring. It is also checked that ortho substituents don't force the amine into a non-resonance torsion. State of helper arrays must be at least cHelperRings.

    Parameters

    • atom: number

    Returns boolean

  • Molecule objects may represent complete molecules or sub-structure fragments, depending on, whether they are flagges as being a fragment or not. Both representations have much in common, but in certain aspects behave differently. Thus, complete molecules are considered to carry implicit hydrogens to fill unoccupied atom valences. Sub-structure fragments on the other hand may carry atom or bond query features. Depiction, sub-structure search, and other algorithms treat fragments and complete molecules differerently.

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

    whether atom is one of F,Cl,Br,I

  • Atom marking may be used for any external purpose

    Parameters

    • atom: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

    whether atom is any metal atom

  • Parameters

    • atom: number

    Returns boolean

    whether the atom has the natural isotop distribution

  • Parameters

    • atom: number

    Returns boolean

    whether atom is one of N,P,As

  • Parameters

    • atom: number

    Returns boolean

    true if this atom is not a metal and not a nobel gas

  • In a consecutive sequence of sp-hybridized atoms multiple single bonds cause redundant torsions. Only that single bond with the smallest bond index is considered really rotatable; all other single bonds are pseudo rotatable. If one/both end(s) of the sp-atom sequence doesn't carry atoms outside of the straight line then no bond is considered rotatable. A simple terminal single bond

    Parameters

    • bond: number

    Returns boolean

    true, if this bond is not considered rotatable because of a redundancy

  • Returns boolean

    true if atom is one of H,B,C,N,O,F,Si,P,S,Cl,As,Se,Br,Te,I

  • Parameters

    • atom: number

    Returns boolean

  • Parameters

    • bond: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

  • Parameters

    • bond: number

    Returns boolean

  • Uncharged hydrogen atoms with no isotop information nor with an attached custom label are considered simple and can usually be suppressed, effectively converting them from an explicit to an implicit hydrogen atom.
    Note: This method returns true for uncharged, natural abundance hydrogens without custom labels even if they have a non-standard bonding situation (everything being different from having one single bonded non-simple-hydrogen neighbour, e.g. unbonded hydrogen, H2, a metal ligand bond to another atom, two single bonds, etc.) If unusual bonding needs to be considered, check for that independently from this method.

    Parameters

    • atom: number

    Returns boolean

  • Parameters

    • atom: number

    Returns boolean

    whether atom is a member of a ring not larger than 7 atoms

  • Parameters

    • bond: number

    Returns boolean

    whether bond is a member of a ring not larger than 7 atoms

  • Parameters

    • atom: number

    Returns boolean

    whether atom has a neighbor that is connected through a double/triple bond to a hetero atom

  • Checks whether bond is drawn as up/down single bond

    Parameters

    • bond: number

    Returns boolean

    true if bond is a stereo bond

  • Marks this atom to be deleted in a later call to deleteMarkedAtomsAndBonds().

    Parameters

    • atom: number

    Returns void

  • Marks this bond to be deleted in a later call to deleteMarkedAtomsAndBonds().

    Parameters

    • bond: number

    Returns void

  • Normalizes different forms of functional groups (e.g. nitro) to a preferred one. This step should precede any canonicalization.

    Returns boolean

    true if the molecule was changed

  • Removes all plain explicit hydrogens atoms from the molecule, converting them effectively to implicit ones. If the molecules has 2D-coordinates (is3D==false), then this method perceives stereo configurations from up/down-bonds to explicit hydrogens before deleting them and turns another bond into a stereo bond to indicate the proper configuration. If the removal of a hydrogen atom would change an atom's implicit valence, the atom's abnormal valence is set accordingly.

    Parameters

    • is3D: boolean

      pass true, if atom coordinates are three dimensional

    Returns void

  • Removes any query features from the molecule

    Returns boolean

    whether any query features were removed

  • For the given ESR type (AND or OR) renumbers all group indexes starting from 0. Use this, if stereo center deletion or other operations caused an inconsisten ESR number state. Molecule and derived methods do this automatically.

    Parameters

    • type: number

      cESRTypeAnd or cESRTypeOr

    Returns number

    number of ESR groups

  • Parameters

    • f: number

    Returns void

  • Low level method for constructing/modifying a molecule from scratch. Use setAtomicNo(), possibly setAtomX(), setAtomY() and other setAtomXXX() methods for new atoms.

    Parameters

    • no: number

    Returns void

  • Low level method for constructing/modifying a molecule from scratch. Use setBondType() and setBondAtom() if you increase the number of bonds with this method.

    Parameters

    • no: number

    Returns void

  • This is a policy setting for this StereoMolecule as molecule container. If set to true then this StereoMolecule will treat tetrahedral nitrogen atoms with three or four distinguishable substituents as stereo centers and will assign parities. deleteMolecule() does not change this behavior.

    Parameters

    • b: boolean

    Returns void

  • Set an atom's maximum valance to be different from the default one. If a carbon atom's valence is set to -1,0 or 4 its radical state is removed. If a carbon atom's valence is set to 2, a singulet carbene state is assumed.

    Parameters

    • atom: number
    • valence: number

      0-14: new maximum valence; -1: use default

    Returns void

  • The atom Cahn-Ingold-Prelog parity is a calculated property available above/equal helper level cHelperCIP. It encodes the stereo configuration of an atom with its neighbors using up/down-bonds or 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation is space. This method is called by the Canonizer and usually should not be called otherwise.

    Parameters

    • atom: number
    • parity: number

      one of cAtomCIPParityRorM,cAtomCIPParitySorP,cAtomCIPParityProblem

    Returns void

  • Parameters

    • atom: number
    • charge: number

    Returns void

  • Parameters

    • atom: number
    • color: number

    Returns void

  • This is a user applied information, rather than a calculated value. The stereo center configuration is declared to be unknown. If the atom is recognized a stereo center, then its parity will be cAtomParityUnknown.

    Parameters

    • atom: number
    • u: boolean

    Returns void

  • If a custom atom label is set, a molecule depiction displays the custom label instead of the original one. Custom labels are not interpreted otherwise. However, they may optionally be encoded into idcodes; see Canonizer.encodeAtomCustomLabels(). If a custom label start with ']' then the label without the ']' symbol is shown at the top left of the original atom label rather than replacing the original atom label. If label is null or equals the normal atom label, then the custom label is removed. This method is less efficient than the byte[] version: setAtomCustomLabel(int, byte[])

    Parameters

    • atom: number
    • label: string

      null to remove custom label

    Returns void

  • This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • atom: number
    • type: number

      one of cESRTypeAbs,cESRTypeAnd,cESRTypeOr

    • group: number

      index starting with 0 (not considered if type is cESRTypeAbs)

    Returns void

  • Defines an atom list as query feature for substructure search

    Parameters

    • atom: number
    • list: number[]

      is null or a sorted int[] of valid atomic numbers

    • isExcludeList: boolean

      true if atom is a wild card and list contains atoms to be excluded

    Returns void

  • Defines an atom mapping number within the context of a reaction. Atoms that that share the same mapping number on the reactant and product side are considered to be the same atom.

    Parameters

    • atom: number
    • mapNo: number
    • autoMapped: boolean

    Returns void

  • Atom marking may be used for any external purpose.

    Parameters

    • atom: number
    • s: boolean

    Returns void

  • Set atom to specific isotop or to have a natural isotop distribution

    Parameters

    • atom: number
    • mass: number

      rounded atom mass or 0 (default) for natural abundance

    Returns void

  • The atom parity is a calculated property available above/equal helper level cHelperParities. It describes the stereo configuration of a chiral atom and is calculated either from 2D-atom-coordinates and up/down-bonds or from 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation in space.
    The parity is defined as follows: Look at the chiral atom such that its neighbor atom with the highest atom index (or the hydrogen atom if it is implicit) is oriented to the back. If the remaining three neighbors are in clockwise order (considering ascending atom indexes) than the parity is 1. If they are in anti-clockwise order, then the parity is 2.
    For linear chirality (allenes): Look along the straight line of double bonds such that the rear neighbor with the lower atom index points to the top. If the front neighbor with the lower atom index points to the right than the parity is 1.
    This method is called by the Canonizer and usually should not be called otherwise.

    Parameters

    • atom: number
    • parity: number

      one of cAtomParity1,cAtomParity2,cAtomParityNone,cAtomParityUnknown

    • isPseudo: boolean

      true if the configuration is only meaningful relative to another one

    Returns void

  • Sets an atom's radical state as singulet,dublet,triplet or none

    Parameters

    • atom: number
    • radical: number

      one of cAtomRadicalStateNone,cAtomRadicalStateS,cAtomRadicalStateD,cAtomRadicalStateT

    Returns void

  • Parameters

    • atom: number
    • s: boolean

    Returns void

  • Parameters

    • atom: number
    • x: number

    Returns void

  • Parameters

    • atom: number
    • y: number

    Returns void

  • Parameters

    • atom: number
    • z: number

    Returns void

  • Set an atom's atomic number and defines the isotop to be natural abundance.

    Parameters

    • atom: number
    • no: number

    Returns void

  • Parameters

    • no: number
    • bond: number
    • atom: number

    Returns void

  • Used for depiction only.

    Parameters

    • bond: number
    • s: boolean

    Returns void

  • The bond Cahn-Ingold-Prelog parity is a calculated property available above/equal helper level cHelperCIP. It encodes the stereo configuration of a bond with its neighbors using 2D-coordinates and up/down-bonds or 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation is space. This method is called by the Canonizer and usually should not be called otherwise. Considered are E/Z-double bonds and M/P-BINAP type single bonds.

    Parameters

    • bond: number
    • parity: number

      one of cBondCIPParityEorP,cBondCIPParityZorM,cBondCIPParityProblem

    Returns void

  • MDL's enhanced stereo representation for BINAP type of stereo bonds. Stereo atoms and bonds with the same ESR type (AND or OR) and the same ESR group number are in the same group, i.e. within this group they have the defined (relative) stereo configuration.

    Parameters

    • bond: number
    • type: number

      one of cESRTypeAbs,cESRTypeAnd,cESRTypeOr

    • group: number

      index starting with 0

    Returns void

  • Used for depiction only.

    Parameters

    • bond: number
    • s: boolean

    Returns void

  • Sets the bond type based on bond order without stereo orientation.

    Parameters

    • bond: number
    • order: number

      1,2, or 3

    Returns void

  • The bond parity is a calculated property available above/equal helper level cHelperParities. It encodes the stereo configuration of a double bond or BINAP type single bond from up/down-bonds and 2D-coordinates or 3D-atom-coordinates, whatever is available. It depends on the atom indices of the neighbor atoms and their orientation is space. This method is called by the Canonizer and usually should not be called otherwise.

    Parameters

    • bond: number
    • parity: number

      one of cBondParityEor1,cBondParityZor2,cBondParityNone,cBondParityUnknown

    • isPseudo: boolean

      true if the configuration is only meaningful relative to another one

    Returns void

  • This hint/flag is set by CoordinateInventor for double bonds without given EZ-parity, because the new coordinates may imply a not intended EZ-parity. If parities are calculated later by the Canonizer is can correctly assign cBondParityUnknown if the bond is a stereo bond. The setBondParity() method clears this flag. This method usually should not be called for other purposes.

    Parameters

    • bond: number

    Returns void

  • Parameters

    • bond: number
    • feature: number
    • value: boolean

    Returns void

  • Defines a bond type combining bod order and stereo orientation.

    Parameters

    • bond: number
    • type: number

      one of cBondTypeSingle,cBondTypeDouble,cBondTypeUp,cBondTypeCross,...

    Returns void

  • Sets the overall chirality of the molecule taking into account: Recognition of stereo centers and stereo bonds, defined ESR features, meso detection. The chirality combines the knowledge about how many stereo isomers are represented, whether all of these are meso, whether we have one defined stereo isomer, a mixture of racemates, epimers, or other diastereomers. The information is used during depiction. This method is called by the Canonizer and usually should not be called otherwise.

    Parameters

    • c: number

    Returns void

  • Molecule objects may represent complete molecules or sub-structure fragments, depending on, whether they are flagges as being a fragment or not. Both representations have much in common, but in certain aspects behave differently. Thus, complete molecules are considered to carry implicit hydrogens to fill unoccupied atom valences. Sub-structure fragments on the other hand may carry atom or bond query features. Depiction, sub-structure search, and other algorithms treat fragments and complete molecules differently.

    Parameters

    • isFragment: boolean

      if false, then all query features are removed

    Returns void

  • Use this method with extreme care. If you make a change to the molecule, the validity of the helper arrays is typically set to cHelperNone. If you make a small change to a molecule that doesn't change its topology, you may override the automatic automatically cleared helper validity with this method and avoid a new calculation of the neighbour arrays and ring detection.

    Parameters

    • helperValidity: number

      cHelperNeighbours or cHelperRings

    Returns void

  • Fragment's query features are checked for consistency and normalized during helper array creation. As part of this, simple hydrogen atoms are converted into hydrogen-count query features. If hydrogen protection is enabled, explicit hydrogens are not touched.

    Parameters

    • protectHydrogen: boolean

    Returns void

  • Usually called automatically and hardly needed to be called.

    Parameters

    • v: number

    Returns void

  • Usually called automatically and hardly needed to be called.

    Parameters

    • v: number

    Returns void

  • Currently, this method only allows to switch the default atomic number dependent atom coloring off by passing cMoleculeColorNeutral. In future updates it may also accept ARGB values.

    Parameters

    • color: number

      currently supported values: cMoleculeColorDefault, cMoleculeColorNeutral

    Returns void

  • Parameters

    • name: string

    Returns void

  • Atom stereo parities and bond E/Z-parities are properties that are usually perceived from up/down-bonds and atom coordinates, respectively. This is done during the helper array calculation triggered by ensureHelperArrays(cHelperParities).
    This method tells the molecule that current atom/bond parities are valid, even if the stereo perception not has been performed. In addition to the stereo parities one may declare CIP parities and/or symmetry ranks also to be valid (helperStereoBits != 0). setParitiesValid(0) should be called if no coordinates are available but the parities are valid nevertheless, e.g. after the IDCodeParser has parsed an idcode without coordinates. (Note: After idcode parsing unknown stereo centers have parities cAtomParityNone instead of cAtomParityUnknown. Thus, calling isStereoCenter(atom) returns false!!!) Declaring parities valid prevents the Canonizer to run the stereo recognition again when ensureHelperArrays(cHelperParities or higher) is called.
    May also be called after filling valences with explicit hydrogen atoms, which have no coordinates, to tell the molecule that the earlier created stereo flags are still valid.

    Parameters

    • helperStereoBits: number

      0 or combinations of cHelperBitCIP,cHelperBitSymmetry...,cHelperBitIncludeNitrogenParities

    Returns void

  • Parameters

    • atom: number

    Returns void

  • In case bond is a BINAP kind of chiral bond with defined parity, then the preferred neighbour single bond is converted into a stereo bond to correctly reflect its defined parity.

    Parameters

    • bond: number

    Returns void

  • This converts one single bond per parity into a stereo up/down bond to correctly reflect the given parity. This works for tetrahedral and allene atom parities as well as for BINAP type of bond parities. Should only be called with valid TH and EZ parities and valid coordinates, e.g. after idcode parsing with coordinates or after coordinate generation.

    Returns void

  • This is for compatibility with old MDL stereo representation that contained a 'chiral' flag to indicate that the molecule is not a racemate. If a molecule is constructed from a source format (e.g. a molfile version 2) that contains a 'chiral' flag then setToRacemate() needs to be called if the chiral flag is not(!) set. This causes after stereo center recognition to turn all absolute stereo centers into racemic ones.

    Returns void

  • Sets all atoms with TH-parity 'unknown' to explicitly defined 'unknown'. Sets all double bonds with EZ-parity 'unknown' to cross bonds.

    Returns void

  • Parameters

    • atom1: number
    • atom2: number

    Returns boolean

    whether there is a path of bonds leading from atom1 to atom2

  • Removes all isotop information, i.e. sets all atoms to the natural isotop abundance.

    Returns boolean

    true if something was changed

  • Removes all unconnected fragments except for the largest one. If small fragments were removed, then canonizeCharge() is called to neutralize charges after potential removal of counter ions. Metal ligand bonds may or may not be considered a connection.

    Parameters

    • considerMetalBonds: boolean

    Returns number[]

    atom mapping from old to new index; null if no fragments were removed

  • Removes defined and implicit stereo information from the molecule.

    • up/down-bonds are converted to double bonds
    • stereo centers are flagged to be unknown
    • double bonds with implicit stereo configurations are converted into cross bonds
    • all atom and bond ESR assignments are removed
    • parity and CIP helper state is set to invalid, such that stereo calculation is redone, if needed.

    Returns void

  • Suggests either cBondTypeSingle or cBondTypeMetalLigand whatever seems more appropriate for a new bond between the two atoms.

    Parameters

    • atom1: number
    • atom2: number

    Returns number

  • Whether an atom may be considered to carry implicit hydrogen atoms depends on the atomicNo of that atom. Aluminum and all non/metal atoms except the nobel gases and except hydrogen itself are considered to carry implicit hydrogens to fill up their unoccupied valences. Atoms with an assigned unusual valence always support implicit hydrogens independent of their atomicNo.

    Parameters

    • atom: number

    Returns boolean

    true if this atom's unoccupied valences are considered to be implicit hydrogens

  • Swaps two atoms' indexes/locations in the atom table.

    Parameters

    • atom1: number
    • atom2: number

    Returns void

  • Swaps two bonds' indexes/locations in the atom table.

    Parameters

    • bond1: number
    • bond2: number

    Returns void

  • Returns a MDL Molfile V2000 string.

    Returns string

  • Returns a MDL Molfile V3000 string.

    Returns string

  • Returns an SVG string representing the structure in two dimensions.

    Parameters

    • width: number
    • height: number
    • Optional id: string

      Id attribute of the resulting svg element. Defaults to "id" followed by an automatically incremented number.

    • Optional options: IMoleculeToSVGOptions

    Returns string

  • Parameters

    • dx: number
    • dy: number

    Returns void

  • Parameters

    • zoom: number
    • angle: number
    • selected: boolean

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parse the provided idcode and return a Molecule.

    Parameters

    • idcode: string
    • Optional coordinates: string

    Returns Molecule

  • Parse the provided idcode and return a Molecule.

    Parameters

    • idcode: string
    • Optional ensure2DCoordinates: boolean

      boolean indicating if the 2D coordinates should be computed. Default: true.

    Returns Molecule

  • Parse the provided molfile and return a Molecule.

    Parameters

    • molfile: string

      MDL Molfile string in V2000 or V3000

    Returns Molecule

  • Parse the provided molfile and return an object with Molecule and map.

    Parameters

    • molfile: string

      MDL Molfile string in V2000 or V3000.

    Returns {
        map: number[];
        molecule: Molecule;
    }

  • Parse the provided smiles and return a Molecule. By default, stereo features are parsed, which triggers itself a coordinate computation and coordinates are computed again after parsing to guarantee that they are always the same. If you do not need stereo features and want the fastest parsing, use this method with {noCoordinates: true, noStereo: true}.

    Parameters

    Returns Molecule

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number

    Returns number

  • Parameters

    • angle1: number
    • angle2: number

    Returns number

  • Parameters

    • atomLabel: string
    • Optional allowedPseudoAtomGroups: number

    Returns number

  • Returns number

  • Parameters

    • atomicNo: number

    Returns boolean

  • Parameters

    • atomicNo: number

    Returns boolean

  • When the molecule adds a new bond to a new atom or a new ring, then atoms are positioned such that the lengths of the new bonds are equal to the average length of existing bonds. If there are no existing bonds, then this default is used. If the default is not set by this function, then it is 24.

    Parameters

    • defaultAVBL: number

    Returns void