Class ExtendedMoleculeFunctions


  • public class ExtendedMoleculeFunctions
    extends java.lang.Object
    ExtendedMoleculeFunctions

    Copyright: Actelion Ltd., Inc. All Rights Reserved This software is the proprietary information of Actelion Pharmaceuticals, Ltd. Use is subject to license terms.

    Version:
    1.0 2005 MvK: Start implementation
    Author:
    Modest von Korff
    • Field Detail

      • COLOR_FOR_CENTER_SELECTION

        public static final int COLOR_FOR_CENTER_SELECTION
        See Also:
        Constant Field Values
      • arrRGroupsAtomicNo

        public static final int[] arrRGroupsAtomicNo
      • arrRGroupsSymbol

        public static final java.lang.String[] arrRGroupsSymbol
    • Constructor Detail

      • ExtendedMoleculeFunctions

        public ExtendedMoleculeFunctions()
    • Method Detail

      • makeSkeleton

        public static void makeSkeleton​(StereoMolecule mol)
      • analyzeMolecule

        public static void analyzeMolecule​(StereoMolecule mol)
      • getColorVal2String

        public static java.lang.String getColorVal2String​(Molecule mol,
                                                          int indexAtom)
      • getcAtomColor2String

        public static java.lang.String getcAtomColor2String​(int cAtomColor)
        Parameters:
        cAtomColor - atom color value from Molecule.
        Returns:
      • getColorRecord

        public static java.lang.String getColorRecord​(Molecule mol,
                                                      java.util.Collection<java.lang.Integer> liIndexAtom,
                                                      int cAtomColor)
        Parameters:
        mol -
        liIndexAtom -
        cAtomColor - atom color value from Molecule.
        Returns:
      • getNumQueryAtoms

        public static int getNumQueryAtoms​(ExtendedMolecule mol,
                                           int[] arrAtomicNoQuery)
      • getNumCarbonAtoms

        public static int getNumCarbonAtoms​(ExtendedMolecule mol)
      • getNumHeteroAtoms

        public static int getNumHeteroAtoms​(ExtendedMolecule mol)
      • isHetero

        public static boolean isHetero​(ExtendedMolecule mol,
                                       int indexAtom)
      • getNumNitroGroupN

        public static int getNumNitroGroupN​(StereoMolecule mol)
      • getNumCarboxy

        public static int getNumCarboxy​(StereoMolecule mol)
      • getNumAcidicOxygen

        public static int getNumAcidicOxygen​(StereoMolecule mol)
      • getNumBasicNitrogen

        public static int getNumBasicNitrogen​(StereoMolecule mol)
      • getNumAliphaticRingAtoms

        public static int getNumAliphaticRingAtoms​(ExtendedMolecule mol,
                                                   int atomicNoQuery)
      • getNumHeavyAtoms

        public static int getNumHeavyAtoms​(ExtendedMolecule mol)
        Parameters:
        mol -
        Returns:
        number of atoms which are not hydrogen.
      • getNumAromaticAtoms

        public static int getNumAromaticAtoms​(ExtendedMolecule mol)
      • getNumArylAmine

        public static int getNumArylAmine​(StereoMolecule mol)
      • getNumHeteroAromaticAtoms

        public static int getNumHeteroAromaticAtoms​(ExtendedMolecule mol)
      • getNumSubstructure

        public static int getNumSubstructure​(StereoMolecule mol,
                                             java.lang.String idcodeFragment)
      • getBondNo

        public static int getBondNo​(ExtendedMolecule mol,
                                    int atm1,
                                    int atm2)
      • getBondOrder

        public static int getBondOrder​(ExtendedMolecule mol,
                                       int atm1,
                                       int atm2)
      • getBondType

        public static int getBondType​(ExtendedMolecule mol,
                                      int atm1,
                                      int atm2)
      • getBondParity

        public static int getBondParity​(ExtendedMolecule mol,
                                        int atm1,
                                        int atm2)
      • deleteBond

        public static boolean deleteBond​(ExtendedMolecule mol,
                                         int atm1,
                                         int atm2)
      • getBiggestFragmentIDCode

        public static java.lang.String getBiggestFragmentIDCode​(java.lang.String idCode)
      • getConverted2CarbonSkeleton

        public static StereoMolecule getConverted2CarbonSkeleton​(StereoMolecule m)
        Replaces all hetero-atoms, except hydrogen, with carbon.
        Parameters:
        m -
        Returns:
      • getComparatorAtomsBonds

        public static java.util.Comparator<StereoMolecule> getComparatorAtomsBonds()
      • checkBiggestFragmentForUnwanted

        public static boolean checkBiggestFragmentForUnwanted​(StereoMolecule mol,
                                                              java.util.List<java.lang.Integer> liAtomicNo)
      • containsAtLeastOneAtomicNumbersFromHashSet

        public static boolean containsAtLeastOneAtomicNumbersFromHashSet​(ExtendedMolecule mol,
                                                                         java.util.HashSet<java.lang.Integer> hsAtomicNo)
        Parameters:
        mol -
        hsAtomicNo -
        Returns:
        true if an atomic number from the hash set is found.
      • containsHeteroAtom

        public static boolean containsHeteroAtom​(ExtendedMolecule mol,
                                                 int[] arrIndexAt)
      • containsSolelyAtomicNumbersFromHashSet

        public static boolean containsSolelyAtomicNumbersFromHashSet​(ExtendedMolecule mol,
                                                                     java.util.HashSet<java.lang.Integer> hsAtomicNo)
        Parameters:
        mol -
        hsAtomicNo -
        Returns:
        true if the molecule contains an atomic number that is not in the hash set.
      • atomAtomSubStrucMatch

        public static final boolean atomAtomSubStrucMatch​(StereoMolecule molecule,
                                                          int at,
                                                          StereoMolecule fragment)
        Parameters:
        molecule -
        at - index to specify atom in molecule
        fragment - one atom must have the color: COLOR_FOR_CENTER_SELECTION.
        Returns:
        true if the specified atom in molecule equals the colored atom in fragment.
      • getDistanceArray

        public static double[][] getDistanceArray​(ExtendedMolecule mol)
      • getTopologicalDistance

        public static final int getTopologicalDistance​(ExtendedMolecule mol,
                                                       int at1,
                                                       int at2)
      • getTopologicalDistanceMatrix

        public static final int[][] getTopologicalDistanceMatrix​(StereoMolecule mol)
      • getNumberOfBondsBetweenAtoms

        public static int[][] getNumberOfBondsBetweenAtoms​(StereoMolecule mol,
                                                           int maxBonds,
                                                           int[][] dist)
        From Joel Freyss developed for the FFMolecule Computes a matrix of distances between all the atoms in the graph. Complexity: O(m*n*maxBonds) m = number of bonds, n = number of atoms
        Parameters:
        mol -
        maxBonds -
        Returns:
        an array A[i][j] = nBonds if i and j are connected by less than maxBonds or -1 otherwise
      • isAliphaticAtom

        public static boolean isAliphaticAtom​(StereoMolecule mol,
                                              int atm)
        Parameters:
        mol -
        atm - index of atom
        Returns:
        false if atom is not C or if one of the neighbours is N, O, F, S, P or Cl.
      • isAcceptor

        public static boolean isAcceptor​(StereoMolecule mol,
                                         int atom)
      • isDonor

        public static boolean isDonor​(StereoMolecule mol,
                                      int atom)
      • isCarbonTwoValencesMinimum

        public static boolean isCarbonTwoValencesMinimum​(StereoMolecule mol)
      • isCarbonOnlyConnected2Hetero

        public static boolean isCarbonOnlyConnected2Hetero​(StereoMolecule mol)
      • isCarbonConnected2Hetero

        public static boolean isCarbonConnected2Hetero​(StereoMolecule mol,
                                                       int atomIndex)
        Parameters:
        mol -
        atomIndex -
        Returns:
        true if at least one neighbour is a hetero atom.
      • isConnected2Hetero

        public static boolean isConnected2Hetero​(StereoMolecule mol,
                                                 int[] arrAtomIndex)
        Parameters:
        mol -
        arrAtomIndex -
        Returns:
        true if one of the atoms from arrAtomIndex is connected to a hetero atom.
      • isRingInMolecule

        public static boolean isRingInMolecule​(StereoMolecule mol)
      • isRingExclusively

        public static boolean isRingExclusively​(StereoMolecule mol)
        Parameters:
        mol -
        Returns:
        true if all atoms are in a ring.
      • isCyanoN

        public static boolean isCyanoN​(StereoMolecule mol,
                                       int atom)
        Parameters:
        mol -
        atom -
        Returns:
        true for cyano and iso-cyano.
      • isThioEther

        public static boolean isThioEther​(StereoMolecule mol,
                                          int atom)
      • isWildcard

        public static boolean isWildcard​(StereoMolecule mol,
                                         int atom)
      • isSulfoxyGroup

        public static boolean isSulfoxyGroup​(StereoMolecule mol,
                                             int atom)
        Parameters:
        mol -
        atom -
        Returns:
        true if atom is S and at let one attached atom is O.
      • isIsolatedCarbon

        public static boolean isIsolatedCarbon​(StereoMolecule mol,
                                               int indexAtCentral,
                                               int[] arrIndexAt)
        Parameters:
        mol -
        indexAtCentral -
        arrIndexAt -
        Returns:
        true if no connected carbon atom is in arrIndexAt
      • extractAromaticRing

        public static int[] extractAromaticRing​(StereoMolecule mol,
                                                int[] arrIndexAt)
      • getNumCyanoGroups

        public static int getNumCyanoGroups​(StereoMolecule mol)
        Counts cyano and iso-cyano
        Parameters:
        mol -
        Returns:
      • getNumAlcoholicOxygen

        public static int getNumAlcoholicOxygen​(StereoMolecule mol)
      • getNumThioEther

        public static int getNumThioEther​(StereoMolecule mol)
      • getNumSulfOxyGroups

        public static int getNumSulfOxyGroups​(StereoMolecule mol)
      • getNumWildcards

        public static int getNumWildcards​(StereoMolecule mol)
      • isAlcoholicOxygen

        public static boolean isAlcoholicOxygen​(StereoMolecule mol,
                                                int atom)
      • isEtherOxygenAtAromatic

        public static boolean isEtherOxygenAtAromatic​(StereoMolecule mol,
                                                      int atom)
      • isCarboxyC

        public static boolean isCarboxyC​(StereoMolecule mol,
                                         int atom)
      • replaceAtoms

        public static int replaceAtoms​(ExtendedMolecule[] arr,
                                       int atnoOrig,
                                       int atnoRpl)
      • replaceAtoms

        public static int replaceAtoms​(ExtendedMolecule mol,
                                       int atnoOrig,
                                       int atnoRpl)
      • removeSubStructures

        public static final java.util.LinkedList<StereoMolecule> removeSubStructures​(java.util.List<StereoMolecule> liInput)
        Removes all molecules that are a substructure of one of the molecules in the input list.
        Parameters:
        liInput -
        Returns:
      • removeSubstructuresFromMolecule

        public static StereoMolecule removeSubstructuresFromMolecule​(StereoMolecule mol,
                                                                     java.util.List<StereoMolecule> liFragment)
        Deletes the substructures, if found, in the molecule. Starts with the first structure in the list. Helper arrays are ensured.
        Parameters:
        mol -
        liFragment -
        Returns:
      • setColorMolecule

        public static void setColorMolecule​(StereoMolecule mol,
                                            int[] arrIndexMatch)
      • setColorMoleculeFromBondIndex

        public static void setColorMoleculeFromBondIndex​(StereoMolecule mol,
                                                         int[] arrIndexBonds,
                                                         int color)
        Parameters:
        mol -
        arrIndexBonds -
        color - i.e. Molecule.cAtomColorBlue
      • setCoordinatesNull

        public static void setCoordinatesNull​(StereoMolecule mol)
      • getColorVectorSubstructure

        public static java.lang.String getColorVectorSubstructure​(StereoMolecule mol,
                                                                  StereoMolecule frag,
                                                                  int atomColor)
        Returns the colors vector for the substructure in mol.
        Parameters:
        mol -
        frag -
        atomColor - Molecule.cAtomColor
        Returns:
      • getAtomicNoRGroup

        public static int getAtomicNoRGroup​(int r)
        Starts with 1 and goes until 16
        Returns: