Package com.actelion.research.chem
Class ExtendedMoleculeFunctions
- java.lang.Object
-
- com.actelion.research.chem.ExtendedMoleculeFunctions
-
public class ExtendedMoleculeFunctions extends java.lang.Object
ExtendedMoleculeFunctionsCopyright: 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 Summary
Fields Modifier and Type Field Description static int[]
arrRGroupsAtomicNo
static java.lang.String[]
arrRGroupsSymbol
static int
COLOR_FOR_CENTER_SELECTION
static int
NUMBER_ELEMENTS
-
Constructor Summary
Constructors Constructor Description ExtendedMoleculeFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
analyzeMolecule(StereoMolecule mol)
static boolean
atomAtomSubStrucMatch(StereoMolecule molecule, int at, StereoMolecule fragment)
static boolean
checkBiggestFragmentForUnwanted(StereoMolecule mol, java.util.List<java.lang.Integer> liAtomicNo)
static boolean
containsAtLeastOneAtomicNumbersFromHashSet(ExtendedMolecule mol, java.util.HashSet<java.lang.Integer> hsAtomicNo)
static boolean
containsHeteroAtom(ExtendedMolecule mol, int[] arrIndexAt)
static boolean
containsSolelyAtomicNumbersFromHashSet(ExtendedMolecule mol, java.util.HashSet<java.lang.Integer> hsAtomicNo)
static boolean
deleteBond(ExtendedMolecule mol, int atm1, int atm2)
static int[]
extractAromaticRing(StereoMolecule mol, int[] arrIndexAt)
static int
getAtomicNoRGroup(int r)
Starts with 1 and goes until 16static StereoMolecule
getBiggestFragment(StereoMolecule mol)
static java.lang.String
getBiggestFragmentIDCode(java.lang.String idCode)
static int
getBondNo(ExtendedMolecule mol, int atm1, int atm2)
static int
getBondOrder(ExtendedMolecule mol, int atm1, int atm2)
static int
getBondParity(ExtendedMolecule mol, int atm1, int atm2)
static int
getBondType(ExtendedMolecule mol, int atm1, int atm2)
static java.lang.String
getcAtomColor2String(int cAtomColor)
static java.lang.String
getColorRecord(Molecule mol, java.util.Collection<java.lang.Integer> liIndexAtom, int cAtomColor)
static java.lang.String
getColorVal2String(Molecule mol, int indexAtom)
static java.lang.String
getColorVectorSubstructure(StereoMolecule mol, StereoMolecule frag, int atomColor)
Returns the colors vector for the substructure in mol.static java.util.Comparator<StereoMolecule>
getComparatorAtomsBonds()
static StereoMolecule
getConverted2CarbonSkeleton(StereoMolecule m)
Replaces all hetero-atoms, except hydrogen, with carbon.static double[][]
getDistanceArray(ExtendedMolecule mol)
static int
getNumAcidicOxygen(StereoMolecule mol)
static int
getNumAlcoholicOxygen(StereoMolecule mol)
static int
getNumAliphaticRingAtoms(ExtendedMolecule mol, int atomicNoQuery)
static int
getNumAmide(StereoMolecule mol)
static int
getNumAromaticAtoms(ExtendedMolecule mol)
static int
getNumArylAmine(StereoMolecule mol)
static int
getNumBasicNitrogen(StereoMolecule mol)
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.static int
getNumCarbonAtoms(ExtendedMolecule mol)
static int
getNumCarboxy(StereoMolecule mol)
static int
getNumCyanoGroups(StereoMolecule mol)
Counts cyano and iso-cyanostatic int
getNumHeavyAtoms(ExtendedMolecule mol)
static int
getNumHeteroAromaticAtoms(ExtendedMolecule mol)
static int
getNumHeteroAtoms(ExtendedMolecule mol)
static int
getNumIsopropyl(ExtendedMolecule mol)
static int
getNumNitroGroupN(StereoMolecule mol)
static int
getNumQueryAtoms(ExtendedMolecule mol, int[] arrAtomicNoQuery)
static int
getNumSubstructure(StereoMolecule mol, java.lang.String idcodeFragment)
static int
getNumSulfOxyGroups(StereoMolecule mol)
static int
getNumThioEther(StereoMolecule mol)
static int
getNumWildcards(StereoMolecule mol)
static float
getSimilarity(StereoMolecule m1, StereoMolecule m2, DescriptorHandler dh)
static int
getTopologicalDistance(ExtendedMolecule mol, int at1, int at2)
static int[][]
getTopologicalDistanceMatrix(StereoMolecule mol)
static boolean
isAcceptor(StereoMolecule mol, int atom)
static boolean
isAlcoholicOxygen(StereoMolecule mol, int atom)
static boolean
isAliphaticAtom(StereoMolecule mol, int atm)
static boolean
isCarbonConnected2Hetero(StereoMolecule mol, int atomIndex)
static boolean
isCarbonOnlyConnected2Hetero(StereoMolecule mol)
static boolean
isCarbonTwoValencesMinimum(StereoMolecule mol)
static boolean
isCarboxyC(StereoMolecule mol, int atom)
static boolean
isConnected2Hetero(StereoMolecule mol, int[] arrAtomIndex)
static boolean
isCyanoN(StereoMolecule mol, int atom)
static boolean
isDonor(StereoMolecule mol, int atom)
static boolean
isEtherOxygenAtAromatic(StereoMolecule mol, int atom)
static boolean
isHetero(ExtendedMolecule mol, int indexAtom)
static boolean
isIsolatedCarbon(StereoMolecule mol, int indexAtCentral, int[] arrIndexAt)
static boolean
isRingExclusively(StereoMolecule mol)
static boolean
isRingInMolecule(StereoMolecule mol)
static boolean
isSulfoxyGroup(StereoMolecule mol, int atom)
static boolean
isThioEther(StereoMolecule mol, int atom)
static boolean
isWildcard(StereoMolecule mol, int atom)
static void
makeSkeleton(StereoMolecule mol)
static StereoMolecule
removeSubstructureFromMolecule(StereoMolecule mol, StereoMolecule frag)
static 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.static StereoMolecule
removeSubstructuresFromMolecule(StereoMolecule mol, java.util.List<StereoMolecule> liFragment)
Deletes the substructures, if found, in the molecule.static StereoMolecule
removeWildcards(StereoMolecule mol)
static int
replaceAtoms(ExtendedMolecule[] arr, int atnoOrig, int atnoRpl)
static int
replaceAtoms(ExtendedMolecule mol, int atnoOrig, int atnoRpl)
static void
setColorMCS2Molecule(StereoMolecule mol, StereoMolecule molMCS)
static void
setColorMolecule(StereoMolecule mol, int[] arrIndexMatch)
static void
setColorMoleculeFromBondIndex(StereoMolecule mol, int[] arrIndexBonds, int color)
static void
setCoordinatesNull(StereoMolecule mol)
-
-
-
Field Detail
-
NUMBER_ELEMENTS
public static final int NUMBER_ELEMENTS
- See Also:
- Constant Field Values
-
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
-
-
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)
-
getNumAmide
public static int getNumAmide(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)
-
getNumIsopropyl
public static int getNumIsopropyl(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)
-
getBiggestFragment
public static StereoMolecule getBiggestFragment(StereoMolecule mol)
-
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 moleculefragment
- 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:
-
removeSubstructureFromMolecule
public static StereoMolecule removeSubstructureFromMolecule(StereoMolecule mol, StereoMolecule frag)
-
removeWildcards
public static StereoMolecule removeWildcards(StereoMolecule mol)
-
setColorMCS2Molecule
public static void setColorMCS2Molecule(StereoMolecule mol, StereoMolecule molMCS)
-
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:
-
getSimilarity
public static float getSimilarity(StereoMolecule m1, StereoMolecule m2, DescriptorHandler dh)
-
getAtomicNoRGroup
public static int getAtomicNoRGroup(int r)
Starts with 1 and goes until 16- Returns:
-
-