Class StructureCalculator
- java.lang.Object
-
- com.actelion.research.chem.descriptor.flexophore.calculator.StructureCalculator
-
public class StructureCalculator extends java.lang.ObjectUtility function based on the molecule's connections (groups, rings,...)
-
-
Constructor Summary
Constructors Constructor Description StructureCalculator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaddHydrogens(Molecule3D mol)Add the missing hydrogens for the ligandstatic booleanaddHydrogens(Molecule3D mol, boolean alsoRigidAtoms)Adds the missing hydrogens (no optimization)static booleanaddHydrogensAroundLigand(Molecule3D mol, double radius)static intconnected(Molecule3D mol, int a, int atomicNo, int bondOrder)Returns the rotatable bonds (sorted).static voidcopyAtoms(Molecule3D mol, Molecule3D res, java.util.List<java.lang.Integer> atomsToBeAdded)static Molecule3Dcrop(Molecule3D mol, Coordinates center, double radius)static Molecule3DcropLigand(Molecule3D mol, double radius)static booleandeleteHydrogens(Molecule3D mol)static intdfs(Molecule3D lig, int start, java.util.Set<java.lang.Integer> seen)static intdfs(Molecule3D lig, int start, java.util.Set<java.lang.Integer> seen, int depth, boolean takeRingsAsWhole)static <T extends Molecule3D>
TextractFragment(Molecule3D mol, T res, int[] atoms)Extract the Ligand from mol and copy it into resstatic <T extends Molecule3D>
TextractFragment(Molecule3D mol, T res, java.util.List<java.lang.Integer> atoms)static java.util.List<Molecule3D>extractFragments(Molecule3D mol)Return all connex components with more than 5 atomsstatic Molecule3DextractLigand(Molecule3D mol)Extract the Ligand from mol and copy it into resstatic java.util.List<Molecule3D>extractLigands(Molecule3D mol)Return all ligands with more than 5 atomsstatic voidflagBackbone(Molecule3D mol)Return a List of int[] representing all the atom-atom pairs having an intermolecular interactions (distance close to sum of VDW)static longgetAtomHashkey(Molecule3D mol, int a)Return a long representing the atom and its neighboursstatic int[]getAtomsOnPath(Molecule3D mol, int a1, int a2)Finds on all atoms going on a path from a1 to a2.static int[]getAtomToGroups(Molecule3D mol)static int[]getAtomToGroups(Molecule3D mol, java.util.List<java.lang.Integer> seeds)For each molecule inmolone group is created.static java.util.List<java.lang.Integer>getBackbone(Molecule3D lig, int a)static boolean[]getBackbones(Molecule3D molecule)static boolean[]getBackbones(Molecule3D molecule, int minChain)Gets the backbonestatic Coordinates[]getBounds(Molecule3D mol)static CoordinatesgetCenter(Molecule3D mol)static java.util.List<java.util.List<java.lang.Integer>>getConnexComponents(Molecule3D mol)Returns a List of all Connex Components of the graph (List of List of Integer)static double[][]getDistanceMatrix(Molecule3D m1, Molecule3D m2)static intgetExplicitHydrogens(Molecule3D mol, int atm)static java.util.List<int[]>getFragmentMatches(Molecule3D fragment, Molecule3D mol)Find all fragment occurences in mol (only the movable atoms are considered).static int[]getHDonorsAcceptors(ExtendedMolecule m)Returns a array of 2 elements [number of donors, number of acceptors]static intgetImplicitHydrogens(Molecule3D mol, int atm)Return the number of implicit hydrogens, ie.static java.util.List<int[]>getInterMolecularInteractions(Molecule3D mol)Return a List of int[] representing all the atom-atom pairs having an intermolecular interactions (distance close to sum of VDW)static Coordinates[]getLigandBounds(Molecule3D mol)static CoordinatesgetLigandCenter(Molecule3D mol)static doublegetLigandRMSD(Molecule3D mol1, Molecule3D mol2)Gets the root mean square deviation between 2 positions.static java.util.List<java.lang.Integer>getLongestChain(Molecule3D mol, int atm)Return the longest molecular chain starting at atmstatic intgetMaxFreeValence(Molecule3D mol, int atm)static intgetMaxValence(int atomicNo)static intgetMolecularPathCount(Molecule3D mol, int length)Returns the number of paths of the given length (gives an idea of the number of branches)static int[][]getNumberOfAtomsBetweenBonds(Molecule3D mol, int maxAtoms, int[][] dist)Computes a matrix of distances between all the bonds in the graph.static int[][]getNumberOfBondsBetweenAtoms(Molecule3D mol, int maxBonds, int[][] dist)Computes a matrix of distances between all the atoms in the graph.static int[]getOverlap(Molecule3D m1, Molecule3D m2)static java.util.List<java.lang.Integer>[]getRings(Molecule3D mol, java.util.List<int[]> allRings)static java.util.List<java.lang.Integer>[]getRingsAccurate(Molecule3D mol, java.util.List<int[]> allRings)Find the smallest covering set of rings for the Molecule.static java.util.List<java.lang.Integer>[]getRingsFast(Molecule3D mol, java.util.List<int[]> allRings)Find the list of rings for the Molecule.static intgetStructureCenter(Molecule3D lig, int[] rotatables, int[][] dists)static intgetStructureCenter(Molecule3D lig, int a, int[] rotatables, int[][] dists)The Structure Center Atom is defined as the atom with the biggest no of rotatables bonds and the closest to the centerstatic intgetValence(Molecule3D mol, int atm)static voidinsertLigand(Molecule3D mol, Molecule3D lig, Coordinates center)static booleanisAcceptor(Molecule3D m, int a)static booleanisDonor(Molecule3D m, int a)static voidmain(java.lang.String[] args)static intmakeProteinFlexible(Molecule3D mol, Coordinates center, double radius, boolean keepBackboneRigid)static voidmakeProteinRigid(Molecule3D mol)static booleanmarkLigand(Molecule3D mol)Find the most likely ligand (in term of size, rings, polar atoms) and mark itstatic intmarkLigand(Molecule3D mol, int n)Marks a numbered ligandstatic voidmarkLigands(Molecule3D mol)Find the most likely ligands (in term of size)static voidremoveLigand(Molecule3D mol)static booleanremoveLonePairs(Molecule3D mol)static voidremoveWater(Molecule3D mol)static voidremoveWater(Molecule3D mol, boolean removeAlsoImportant)static voidremoveWaterSalts(Molecule3D mol)static voidreplaceLigand(Molecule3D mol, Molecule3D lig)static voidreplaceLigand(Molecule3D mol, Molecule3D lig, Coordinates center)Replaces the preoptimized ligand in molstatic voidrotateBond(Molecule3D mol, int a2, int a3, double angle)Make sure the parity of mol match the one from ref, otherwise fix it.static voidrotateLigand(Molecule3D mol, double angle, Coordinates normal, Coordinates center)static voidtranslateLigand(Molecule3D mol, Coordinates v)static voidvibrateLigand(Molecule3D mol, double radius)
-
-
-
Method Detail
-
getConnexComponents
public static java.util.List<java.util.List<java.lang.Integer>> getConnexComponents(Molecule3D mol)
Returns a List of all Connex Components of the graph (List of List of Integer)Example: The following molecule: -- 3 1 -- 2 5 -- 6 7 -- 4 will return [[1,2,3,4],[5,6],[7]]Complexity: O(nAtoms) Memory: O(nAtoms)
-
getAtomToGroups
public static int[] getAtomToGroups(Molecule3D mol)
-
getAtomToGroups
public static int[] getAtomToGroups(Molecule3D mol, java.util.List<java.lang.Integer> seeds)
For each molecule inmolone group is created. The group index starts with 1. The size of the array returned is equal to the number of atoms.- Parameters:
mol-seeds-- Returns:
- a int[] array such as array[atom] = groupNo >=1
-
getLongestChain
public static java.util.List<java.lang.Integer> getLongestChain(Molecule3D mol, int atm)
Return the longest molecular chain starting at atm- Parameters:
mol-atm-- Returns:
- a List of Integer
-
getBackbones
public static boolean[] getBackbones(Molecule3D molecule)
-
getBackbones
public static boolean[] getBackbones(Molecule3D molecule, int minChain)
Gets the backbone- Parameters:
molecule-- Returns:
- an array of boolean
-
getNumberOfBondsBetweenAtoms
public static int[][] getNumberOfBondsBetweenAtoms(Molecule3D mol, int maxBonds, int[][] dist)
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
-
getNumberOfAtomsBetweenBonds
public static int[][] getNumberOfAtomsBetweenBonds(Molecule3D mol, int maxAtoms, int[][] dist)
Computes a matrix of distances between all the bonds in the graph. Complexity: O(m*n*maxBonds) m = number of bonds, n = number of atoms- Parameters:
mol-maxAtoms-- Returns:
- an array B[i][j] = nAtoms if i and j are connected by less than maxAtoms or -1 otherwise
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
getMaxValence
public static int getMaxValence(int atomicNo)
- Parameters:
atomicNo-- Returns:
-
getImplicitHydrogens
public static int getImplicitHydrogens(Molecule3D mol, int atm)
Return the number of implicit hydrogens, ie. the number of hydrogens to add to fullfill the valence requirements (<0 if there are too many)- Parameters:
mol-atm-- Returns:
-
getMaxFreeValence
public static int getMaxFreeValence(Molecule3D mol, int atm)
-
extractFragments
public static java.util.List<Molecule3D> extractFragments(Molecule3D mol)
Return all connex components with more than 5 atoms- Parameters:
mol-- Returns:
-
extractLigands
public static java.util.List<Molecule3D> extractLigands(Molecule3D mol)
Return all ligands with more than 5 atoms- Parameters:
mol-- Returns:
-
extractFragment
public static <T extends Molecule3D> T extractFragment(Molecule3D mol, T res, java.util.List<java.lang.Integer> atoms)
-
extractFragment
public static <T extends Molecule3D> T extractFragment(Molecule3D mol, T res, int[] atoms)
Extract the Ligand from mol and copy it into res- Parameters:
mol-res-- Returns:
-
getRings
public static java.util.List<java.lang.Integer>[] getRings(Molecule3D mol, java.util.List<int[]> allRings)
-
getRingsAccurate
public static java.util.List<java.lang.Integer>[] getRingsAccurate(Molecule3D mol, java.util.List<int[]> allRings)
Find the smallest covering set of rings for the Molecule. This function considers the smallest subset of covering rings of any size. The complexity of this function is O(natoms * avgRingSize^nImbricatedRings) The memory required is O(nAtoms * nBonds)!!!!- Parameters:
mol-allRings- - a List ringNo -> atom No in the ring as int[] (output)- Returns:
- a List[] atom -> List of rings the atom belongs to
-
getRingsFast
public static java.util.List<java.lang.Integer>[] getRingsFast(Molecule3D mol, java.util.List<int[]> allRings)
Find the list of rings for the Molecule. This function considers all rings of size <=7 Complexity O(nAtoms) for the common structures O(nAtoms^nRings) at worse Memory O(nBonds)- Parameters:
mol-allRings- - a List ringNo -> atom No in the ring as int[]- Returns:
- a List[] atom -> List of rings the atom belongs to
-
getInterMolecularInteractions
public static java.util.List<int[]> getInterMolecularInteractions(Molecule3D mol)
Return a List of int[] representing all the atom-atom pairs having an intermolecular interactions (distance close to sum of VDW)- Parameters:
mol-- Returns:
-
getAtomsOnPath
public static int[] getAtomsOnPath(Molecule3D mol, int a1, int a2)
Finds on all atoms going on a path from a1 to a2. If a1 and a2 are in a small ring (<6), all atoms in the rings will be considered Complexity: O(m) m=allBonds- Parameters:
mol-a1-a2-- Returns:
-
getValence
public static int getValence(Molecule3D mol, int atm)
-
getExplicitHydrogens
public static final int getExplicitHydrogens(Molecule3D mol, int atm)
-
getStructureCenter
public static int getStructureCenter(Molecule3D lig, int[] rotatables, int[][] dists)
-
getStructureCenter
public static int getStructureCenter(Molecule3D lig, int a, int[] rotatables, int[][] dists)
The Structure Center Atom is defined as the atom with the biggest no of rotatables bonds and the closest to the center- Parameters:
lig-- Returns:
-
getBackbone
public static java.util.List<java.lang.Integer> getBackbone(Molecule3D lig, int a)
-
dfs
public static int dfs(Molecule3D lig, int start, java.util.Set<java.lang.Integer> seen)
-
dfs
public static int dfs(Molecule3D lig, int start, java.util.Set<java.lang.Integer> seen, int depth, boolean takeRingsAsWhole)
-
extractLigand
public static Molecule3D extractLigand(Molecule3D mol)
Extract the Ligand from mol and copy it into res- Parameters:
mol-- Returns:
-
insertLigand
public static void insertLigand(Molecule3D mol, Molecule3D lig, Coordinates center)
-
replaceLigand
public static void replaceLigand(Molecule3D mol, Molecule3D lig)
-
replaceLigand
public static void replaceLigand(Molecule3D mol, Molecule3D lig, Coordinates center)
Replaces the preoptimized ligand in mol- Parameters:
mol-lig-
-
deleteHydrogens
public static boolean deleteHydrogens(Molecule3D mol)
-
addHydrogens
public static boolean addHydrogens(Molecule3D mol)
Add the missing hydrogens for the ligand- Parameters:
mol-- Returns:
-
addHydrogens
public static boolean addHydrogens(Molecule3D mol, boolean alsoRigidAtoms)
Adds the missing hydrogens (no optimization)- Parameters:
mol-- Returns:
-
addHydrogensAroundLigand
public static boolean addHydrogensAroundLigand(Molecule3D mol, double radius)
-
copyAtoms
public static void copyAtoms(Molecule3D mol, Molecule3D res, java.util.List<java.lang.Integer> atomsToBeAdded)
-
removeWater
public static void removeWater(Molecule3D mol)
-
removeWater
public static void removeWater(Molecule3D mol, boolean removeAlsoImportant)
-
removeWaterSalts
public static void removeWaterSalts(Molecule3D mol)
-
removeLigand
public static void removeLigand(Molecule3D mol)
-
crop
public static Molecule3D crop(Molecule3D mol, Coordinates center, double radius)
-
cropLigand
public static Molecule3D cropLigand(Molecule3D mol, double radius)
-
markLigand
public static int markLigand(Molecule3D mol, int n)
Marks a numbered ligand- Parameters:
mol-n- >=0
-
markLigands
public static void markLigands(Molecule3D mol)
Find the most likely ligands (in term of size)
-
markLigand
public static boolean markLigand(Molecule3D mol)
Find the most likely ligand (in term of size, rings, polar atoms) and mark it- Parameters:
mol-
-
getCenter
public static Coordinates getCenter(Molecule3D mol)
-
getLigandCenter
public static Coordinates getLigandCenter(Molecule3D mol)
-
getLigandBounds
public static Coordinates[] getLigandBounds(Molecule3D mol)
-
getBounds
public static Coordinates[] getBounds(Molecule3D mol)
-
getLigandRMSD
public static double getLigandRMSD(Molecule3D mol1, Molecule3D mol2)
Gets the root mean square deviation between 2 positions. Only atomicNo>1 are considered- Parameters:
mol1-mol2-- Returns:
-
translateLigand
public static void translateLigand(Molecule3D mol, Coordinates v)
-
rotateLigand
public static void rotateLigand(Molecule3D mol, double angle, Coordinates normal, Coordinates center)
-
vibrateLigand
public static void vibrateLigand(Molecule3D mol, double radius)
- Parameters:
mol-radius- maximum moving range in Angstrom.
-
getAtomHashkey
public static long getAtomHashkey(Molecule3D mol, int a)
Return a long representing the atom and its neighbours- Parameters:
mol-a-- Returns:
-
makeProteinFlexible
public static int makeProteinFlexible(Molecule3D mol, Coordinates center, double radius, boolean keepBackboneRigid)
-
makeProteinRigid
public static void makeProteinRigid(Molecule3D mol)
-
getHDonorsAcceptors
public static int[] getHDonorsAcceptors(ExtendedMolecule m)
Returns a array of 2 elements [number of donors, number of acceptors]- Parameters:
m-- Returns:
-
isDonor
public static boolean isDonor(Molecule3D m, int a)
-
isAcceptor
public static boolean isAcceptor(Molecule3D m, int a)
-
flagBackbone
public static void flagBackbone(Molecule3D mol)
Return a List of int[] representing all the atom-atom pairs having an intermolecular interactions (distance close to sum of VDW)
-
connected
public static int connected(Molecule3D mol, int a, int atomicNo, int bondOrder)
Returns the rotatable bonds (sorted). A rotatable bond is defined here as a simple bond that is not inside a ring (and not connected to only hydrogen).- Parameters:
mol-- Returns:
-
rotateBond
public static void rotateBond(Molecule3D mol, int a2, int a3, double angle)
Make sure the parity of mol match the one from ref, otherwise fix it.- Parameters:
mol-
-
removeLonePairs
public static boolean removeLonePairs(Molecule3D mol)
-
getDistanceMatrix
public static final double[][] getDistanceMatrix(Molecule3D m1, Molecule3D m2)
-
getOverlap
public static final int[] getOverlap(Molecule3D m1, Molecule3D m2)
- Parameters:
m1-m2-- Returns:
- an int[][] 0-> number of closer atom matching, 2->number of atom clashes
-
getMolecularPathCount
public static int getMolecularPathCount(Molecule3D mol, int length)
Returns the number of paths of the given length (gives an idea of the number of branches)- Parameters:
mol-length-- Returns:
-
getFragmentMatches
public static java.util.List<int[]> getFragmentMatches(Molecule3D fragment, Molecule3D mol)
Find all fragment occurences in mol (only the movable atoms are considered). Return a Listof occurences list.get(n)[fragmentAtom] points to the n occurence of fragments and is equal to the matching atomIndex in mol - Parameters:
fragment-mol-- Returns:
-
-