Class StructureCheckerHelper


  • @PublicAPI
    public class StructureCheckerHelper
    extends Object
    This helper class contains utility functions used by StructureChecker instances providing constants and utility functions.
    Since:
    Marvin 5.4
    • Field Detail

      • MINIMAL_ATOM_DISTANCE_LIMIT

        public static final double MINIMAL_ATOM_DISTANCE_LIMIT
        This constant represents the minimal allowed atom distance (distance here means euclidean distance) between two atoms for Chemaxon built-in StructureChecker implementations
        See Also:
        Constant Field Values
      • MINIMAL_DISTANCE_LIMIT

        public static final double MINIMAL_DISTANCE_LIMIT
        This constant represents the minimal allowed bond distance (distance here means euclidean distance) between two bonds and the lower bound of bond length for Chemaxon built-in StructureChecker implementations
        See Also:
        Constant Field Values
      • MAXIMAL_DISTANCE_LIMIT

        public static final double MAXIMAL_DISTANCE_LIMIT
        This constant represents the the upper bound of bond length for Chemaxon built-in StructureChecker implementations
        See Also:
        Constant Field Values
    • Constructor Detail

      • StructureCheckerHelper

        public StructureCheckerHelper()
    • Method Detail

      • distance

        public static double distance​(MolAtom atom1,
                                      MolAtom atom2)
        Calculates the distance of two atoms. (Distance here is the euclidean distance)
        Parameters:
        atom1 - is a MolAtom instance
        atom2 - is a MolAtom instance
        Returns:
        the distance of the two atoms
      • createNeighbourBonds

        public static List<MolBond> createNeighbourBonds​(Molecule molecule,
                                                         MolBond bond,
                                                         boolean ignoreRingBonds)
        This method returns a List of MolBond which contains all bonds which are in isNeighbour relation with the MolBond instance represented by parameter bond
        Parameters:
        molecule - is a Molecule instance which contains the bonds
        bond - is a MolBond instance. The method will return the neighbors of this bond.
        ignoreRingBonds - is a boolean parameter. If this parameter is true no ring bonds will treated as neighbor
        Returns:
        a List of MolBond which contains all bonds which are in isNeighbour relation with the MolBond instance represented by parameter bond
      • getDefaultAbbrevgroups

        public static chemaxon.util.abbrevgroup.AbbrevGroupStorage getDefaultAbbrevgroups()
        Imports default and user abbreviations and returns them in a AbbrevGroupStorage.
        Returns:
        default and user abbreviations in a AbbrevGroupStorage
      • isTerminal

        public static boolean isTerminal​(MolBond molBond)
        This method returns true if the MolBond represented by molBond parameter is terminal in a Molecule structure, false otherwise
        Parameters:
        molBond - a MolBond instance
        Returns:
        true if the MolBond represented by molBond parameter is terminal in a Molecule structure, false otherwise
      • isAbsoluteStereoRelevant

        public static boolean isAbsoluteStereoRelevant​(Molecule mol)
        Determines if molecule contains a stereo center with no enhanced stereo property. Absolute stereo makes sense only if this method returns true.
        Parameters:
        mol - is the molecule
        Returns:
        true if molecule contains a stereo center with no enhanced stereo property
      • isChiral

        public static boolean isChiral​(Molecule mol)
        Determines if the molecule contains an atom with R or S stereo configuration.
        Parameters:
        mol - is the Molecule instance
        Returns:
        true if the molecule is chiral.
      • isAromatic

        public static boolean isAromatic​(int[] is,
                                         Molecule mol)
        Determines if a ring in the molecule is aromatic or not
        Parameters:
        is - an index array containing the indices of the ring in the molecule
        mol - a Molecule instance which contains the ring
        Returns:
        true if the ring is aromatic false otherwise
      • ringHasOnlyOneNeighbour

        public static boolean ringHasOnlyOneNeighbour​(int[] is,
                                                      Molecule mol,
                                                      MolAtom atom)
        This function determines if the ring (indexed with idx parameter) has only one neighbour (and this neighbour is the the atom parameter) or not.
        Parameters:
        is - an index array containing the indices of the ring in the molecule
        mol - is a Molecule instance which contains the ring and the atom
        atom - is a MolAtom instance
        Returns:
        true if the atom is the only neighbour of the ring false otherwise
      • calculateCosAFromScalarMul

        public static double calculateCosAFromScalarMul​(MolBond bond1,
                                                        MolBond bond2)
        Calculate the cosines value of the angle between the bonds from the scalar multiplication of the bonds.
        Parameters:
        bond1 - the first bond
        bond2 - the second bond
        Returns:
        the cosines value of the angle between the bonds
      • isDaylightFormatWithoutOptions

        public static boolean isDaylightFormatWithoutOptions​(String format)
        Returns true if daylight format with options supported, false otherwise
        Parameters:
        format - the molecule format represented as a String object
        Returns:
        true if daylight format with options supported, false otherwise