Package com.actelion.research.chem
Class ExtendedMoleculeFunctions
- java.lang.Object
-
- com.actelion.research.chem.ExtendedMoleculeFunctions
-
public class ExtendedMoleculeFunctions extends java.lang.ObjectExtendedMoleculeFunctionsCopyright: 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[]arrRGroupsAtomicNostatic java.lang.String[]arrRGroupsSymbolstatic intCOLOR_FOR_CENTER_SELECTIONstatic intNUMBER_ELEMENTS
-
Constructor Summary
Constructors Constructor Description ExtendedMoleculeFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidanalyzeMolecule(StereoMolecule mol)static booleanatomAtomSubStrucMatch(StereoMolecule molecule, int at, StereoMolecule fragment)static booleancheckBiggestFragmentForUnwanted(StereoMolecule mol, java.util.List<java.lang.Integer> liAtomicNo)static booleancontainsAtLeastOneAtomicNumbersFromHashSet(ExtendedMolecule mol, java.util.HashSet<java.lang.Integer> hsAtomicNo)static booleancontainsHeteroAtom(ExtendedMolecule mol, int[] arrIndexAt)static booleancontainsSolelyAtomicNumbersFromHashSet(ExtendedMolecule mol, java.util.HashSet<java.lang.Integer> hsAtomicNo)static booleandeleteBond(ExtendedMolecule mol, int atm1, int atm2)static int[]extractAromaticRing(StereoMolecule mol, int[] arrIndexAt)static intgetAtomicNoRGroup(int r)Starts with 1 and goes until 16static StereoMoleculegetBiggestFragment(StereoMolecule mol)static java.lang.StringgetBiggestFragmentIDCode(java.lang.String idCode)static intgetBondNo(ExtendedMolecule mol, int atm1, int atm2)static intgetBondOrder(ExtendedMolecule mol, int atm1, int atm2)static intgetBondParity(ExtendedMolecule mol, int atm1, int atm2)static intgetBondType(ExtendedMolecule mol, int atm1, int atm2)static java.lang.StringgetcAtomColor2String(int cAtomColor)static java.lang.StringgetColorRecord(Molecule mol, java.util.Collection<java.lang.Integer> liIndexAtom, int cAtomColor)static java.lang.StringgetColorVal2String(Molecule mol, int indexAtom)static java.lang.StringgetColorVectorSubstructure(StereoMolecule mol, StereoMolecule frag, int atomColor)Returns the colors vector for the substructure in mol.static java.util.Comparator<StereoMolecule>getComparatorAtomsBonds()static StereoMoleculegetConverted2CarbonSkeleton(StereoMolecule m)Replaces all hetero-atoms, except hydrogen, with carbon.static double[][]getDistanceArray(ExtendedMolecule mol)static intgetNumAcidicOxygen(StereoMolecule mol)static intgetNumAlcoholicOxygen(StereoMolecule mol)static intgetNumAliphaticRingAtoms(ExtendedMolecule mol, int atomicNoQuery)static intgetNumAmide(StereoMolecule mol)static intgetNumAromaticAtoms(ExtendedMolecule mol)static intgetNumArylAmine(StereoMolecule mol)static intgetNumBasicNitrogen(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 intgetNumCarbonAtoms(ExtendedMolecule mol)static intgetNumCarboxy(StereoMolecule mol)static intgetNumCyanoGroups(StereoMolecule mol)Counts cyano and iso-cyanostatic intgetNumHeavyAtoms(ExtendedMolecule mol)static intgetNumHeteroAromaticAtoms(ExtendedMolecule mol)static intgetNumHeteroAtoms(ExtendedMolecule mol)static intgetNumIsopropyl(ExtendedMolecule mol)static intgetNumNitroGroupN(StereoMolecule mol)static intgetNumQueryAtoms(ExtendedMolecule mol, int[] arrAtomicNoQuery)static intgetNumSubstructure(StereoMolecule mol, java.lang.String idcodeFragment)static intgetNumSulfOxyGroups(StereoMolecule mol)static intgetNumThioEther(StereoMolecule mol)static intgetNumWildcards(StereoMolecule mol)static floatgetSimilarity(StereoMolecule m1, StereoMolecule m2, DescriptorHandler dh)static intgetTopologicalDistance(ExtendedMolecule mol, int at1, int at2)static int[][]getTopologicalDistanceMatrix(StereoMolecule mol)static booleanisAcceptor(StereoMolecule mol, int atom)static booleanisAlcoholicOxygen(StereoMolecule mol, int atom)static booleanisAliphaticAtom(StereoMolecule mol, int atm)static booleanisCarbonConnected2Hetero(StereoMolecule mol, int atomIndex)static booleanisCarbonOnlyConnected2Hetero(StereoMolecule mol)static booleanisCarbonTwoValencesMinimum(StereoMolecule mol)static booleanisCarboxyC(StereoMolecule mol, int atom)static booleanisConnected2Hetero(StereoMolecule mol, int[] arrAtomIndex)static booleanisCyanoN(StereoMolecule mol, int atom)static booleanisDonor(StereoMolecule mol, int atom)static booleanisEtherOxygenAtAromatic(StereoMolecule mol, int atom)static booleanisHetero(ExtendedMolecule mol, int indexAtom)static booleanisIsolatedCarbon(StereoMolecule mol, int indexAtCentral, int[] arrIndexAt)static booleanisRingExclusively(StereoMolecule mol)static booleanisRingInMolecule(StereoMolecule mol)static booleanisSulfoxyGroup(StereoMolecule mol, int atom)static booleanisThioEther(StereoMolecule mol, int atom)static booleanisWildcard(StereoMolecule mol, int atom)static voidmakeSkeleton(StereoMolecule mol)static StereoMoleculeremoveSubstructureFromMolecule(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 StereoMoleculeremoveSubstructuresFromMolecule(StereoMolecule mol, java.util.List<StereoMolecule> liFragment)Deletes the substructures, if found, in the molecule.static StereoMoleculeremoveWildcards(StereoMolecule mol)static intreplaceAtoms(ExtendedMolecule[] arr, int atnoOrig, int atnoRpl)static intreplaceAtoms(ExtendedMolecule mol, int atnoOrig, int atnoRpl)static voidsetColorMCS2Molecule(StereoMolecule mol, StereoMolecule molMCS)static voidsetColorMolecule(StereoMolecule mol, int[] arrIndexMatch)static voidsetColorMoleculeFromBondIndex(StereoMolecule mol, int[] arrIndexBonds, int color)static voidsetCoordinatesNull(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:
-
-