Class Molecule3DFunctions
- java.lang.Object
-
- com.actelion.research.chem.descriptor.flexophore.Molecule3DFunctions
-
public class Molecule3DFunctions extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intFLAG_AROMATIC_ATOMstatic intFLAG_CENTER_ATOMstatic java.lang.StringLEADING_SPACE_DESCRIPTION
-
Constructor Summary
Constructors Constructor Description Molecule3DFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Molecule3Dadd(Molecule3D mol1, Molecule3D mol2)static voidaddMissingHydrogens(Molecule3D molecule3D)static voidaddRNDCoordinates(Molecule3D mol, double maxNoise)static intcalcTerminalAlkylGroupsCenter(Molecule3D mol)Generates a center atom for each atom of a terminal alkyl group -CC, -C(C)C and -C(C)(C)C.static voidcalculateCoordinatesIterative(Molecule3D mol, double[][] arrDist)static voidcopy(Molecule3D molSource, Molecule3D molDestination)static Molecule3DdistortCoordinates(Molecule3D molecule3D, double maxLengthDistortion)Changes the coordinates with a random value.static int[]findTerminalMethylAtCarb(Molecule3D mol)static voidflagCarbon(Molecule3D mol)static voidflagSubstructure(Molecule3D molecule3D, java.lang.String idCodeQ1, int[] arrIndexAts2Flag)static voidflagUnflaggedWithFlagCenter(Molecule3D mol)static voidformatAtomDescriptionsForViewer(Molecule3D mol)static voidformatAtomDescriptionsForViewer(Molecule3D mol, boolean showIndex)static java.util.List<java.lang.Integer>getAcidicProtons(Molecule3D mol)Protons attached to an O.static double[][]getAdjacencyMatrix(Molecule3D mol)static Molecule3DgetCentered(Molecule3D ff)static Molecule3DgetCentered(Molecule3D molecule3D, java.util.List<java.lang.Integer> liAtomIndexCenter)static CoordinatesgetCenterGravity(Molecule3D mol)static CoordinatesgetCenterGravity(Molecule3D mol, int[] indices)static int[][]getConnectionTable(Molecule3D mol)static java.util.List<java.lang.Integer>getDeprotonableAtoms(Molecule3D mol)Donor atoms.static Molecule3DgetDeprotonated(Molecule3D molecule3D, int indexAtomReactiveCenter)Deprotonates and decreases charge by 1.static double[][]getDistanceArray(Molecule3D mol)static doublegetDistanceFromCoord(Molecule3D mol, int atom1, int atom2)static java.util.List<java.util.List<java.lang.Integer>>getLayersFromBroadFirstSearch(Molecule3D molecule3D, int indexAtomStart)Returns the atom indices as layers of the start atom.static java.util.List<java.lang.Integer>getLongestChain(Molecule3D ff)static java.util.List<java.lang.Integer>getLongestChain(Molecule3D molecule3D, int indexAtomStart)static Molecule3DgetNeutralized(Molecule3D molecule3D, int indexAtomReactiveCenter)Protonates or deprotonates the specified atom, if necessary and possible, to neutralize a charge.static int[]getPath(Molecule3D ff, int indexAt1, int indexAt2)static java.util.List<java.lang.Integer>getPheriphericPoints(int[][] arrTopoDist)Gets the points with the maximum sum of squared topological distances to all atoms.static java.util.List<java.lang.Integer>getProtonableAtoms(Molecule3D mol)static Molecule3DgetProtonated(Molecule3D molecule3D, int indexAtomReactiveCenter)Protonates and increases charge by 1.static doublegetStericHindrance(Molecule3D molecule3D, java.util.List<java.lang.Integer> liIndexAtoms)Calculates a value for the steric hindrance of the atoms from liIndexAtoms to all other atoms.static java.util.List<java.lang.Integer>getTopologicalCenter(int[][] arrTopoDist)Topological centaer atoms are the atoms with the lowest squared sum of topological distances to all atoms.static java.util.List<java.lang.Integer>getTopologicalCenter(int[][] arrTopoDist, ListWithIntVec ilIndexAtoms)static int[][]getTopologicalDistanceMatrix(Molecule3D mol)static javax.swing.tree.DefaultMutableTreeNodegetTreeFromBroadFirstSearch(Molecule3D molecule3D, int indexAtomStart)User object in DefaultMutableTreeNode is the index of the atom.static javax.swing.tree.DefaultMutableTreeNodegetTreeFromComplete(Molecule3D molecule3D, int indexAtomStart)Get all possible paths.static booleanhas2DCoordinates(Molecule3D mol)static booleanhas3DCoordinates(Molecule3D mol)static booleanhasChargedAtom(Molecule3D ff)static booleanisAliphaticAtom(Molecule3D mol, int atm)static booleanisConnectedAtoms(Molecule3D ff, java.util.List<java.lang.Integer> liIndexAtoms, int atm2)static booleanisParametrized(Molecule3D mol)static booleanisProtonableNitrogen(Molecule3D mol, int indexAtom)static booleanisPyramedal(Molecule3D molecule3D)static booleanisTripleBond(Molecule3D molecule3D)static Molecule3DrandomizeAtoms(Molecule3D molecule3D)static Molecule3DremoveAllAtomsWithoutNeighbours(Molecule3D ffMol)static voidremoveAtoms(Molecule3D mol, java.util.List<java.lang.Integer> liIndices2Delete)static voidremoveAtomsIfCarbon(Molecule3D mol, java.util.List<java.lang.Integer> liIndices2Delete)static voidremoveCarbon(Molecule3D mol)Removes all Carbon atoms, except the FLAG_CENTER_ATOM is set.static voidremoveElectronPairs(Molecule3D mol)static voidremoveElement(Molecule3D mol, int atomicNo)static voidremoveFlaggedAtoms(Molecule3D mol)static voidremoveHydrogensAndElectronPairs(Molecule3D mol)static voidremoveNonAromaticC(Molecule3D mol)static voidreplaceAtoms(Molecule3D ffMol, java.lang.String idcode2Replace, java.lang.String idcodeNewSubstructure, int[][] arrMapAtoms)09.03.2020 For what is that good?static java.lang.StringtoString(Molecule3D mol)static voidwriteCharge2Label(Molecule3D molecule3D)
-
-
-
Field Detail
-
LEADING_SPACE_DESCRIPTION
public static final java.lang.String LEADING_SPACE_DESCRIPTION
- See Also:
- Constant Field Values
-
FLAG_CENTER_ATOM
public static final int FLAG_CENTER_ATOM
- See Also:
- Constant Field Values
-
FLAG_AROMATIC_ATOM
public static final int FLAG_AROMATIC_ATOM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAdjacencyMatrix
public static double[][] getAdjacencyMatrix(Molecule3D mol)
-
getAcidicProtons
public static java.util.List<java.lang.Integer> getAcidicProtons(Molecule3D mol)
Protons attached to an O.- Parameters:
mol-- Returns:
-
getDeprotonableAtoms
public static java.util.List<java.lang.Integer> getDeprotonableAtoms(Molecule3D mol)
Donor atoms. Oxygen with a connected hydrogen.- Parameters:
mol-- Returns:
-
getProtonableAtoms
public static java.util.List<java.lang.Integer> getProtonableAtoms(Molecule3D mol)
-
isProtonableNitrogen
public static boolean isProtonableNitrogen(Molecule3D mol, int indexAtom)
-
has2DCoordinates
public static boolean has2DCoordinates(Molecule3D mol)
-
has3DCoordinates
public static boolean has3DCoordinates(Molecule3D mol)
-
hasChargedAtom
public static boolean hasChargedAtom(Molecule3D ff)
-
getStericHindrance
public static double getStericHindrance(Molecule3D molecule3D, java.util.List<java.lang.Integer> liIndexAtoms)
Calculates a value for the steric hindrance of the atoms from liIndexAtoms to all other atoms.- Parameters:
molecule3D-liIndexAtoms-- Returns:
-
add
public static Molecule3D add(Molecule3D mol1, Molecule3D mol2)
-
isPyramedal
public static boolean isPyramedal(Molecule3D molecule3D)
-
isTripleBond
public static boolean isTripleBond(Molecule3D molecule3D)
-
addMissingHydrogens
public static void addMissingHydrogens(Molecule3D molecule3D)
-
writeCharge2Label
public static void writeCharge2Label(Molecule3D molecule3D)
-
flagSubstructure
public static void flagSubstructure(Molecule3D molecule3D, java.lang.String idCodeQ1, int[] arrIndexAts2Flag)
- Parameters:
molecule3D- MoleculeidCodeQ1- The idcode for the substructure (ode fragment)arrIndexAts2Flag- the index for atoms in the idCode1q. The corresponding atoms in the molecule will be deleted.
-
getNeutralized
public static Molecule3D getNeutralized(Molecule3D molecule3D, int indexAtomReactiveCenter)
Protonates or deprotonates the specified atom, if necessary and possible, to neutralize a charge.- Parameters:
molecule3D-- Returns:
-
copy
public static void copy(Molecule3D molSource, Molecule3D molDestination)
-
distortCoordinates
public static Molecule3D distortCoordinates(Molecule3D molecule3D, double maxLengthDistortion)
Changes the coordinates with a random value. Gaussian distribution.- Parameters:
molecule3D-maxLengthDistortion- if 0 just a copy of ff will be returned.- Returns:
-
addRNDCoordinates
public static void addRNDCoordinates(Molecule3D mol, double maxNoise)
-
calculateCoordinatesIterative
public static void calculateCoordinatesIterative(Molecule3D mol, double[][] arrDist)
-
getDistanceFromCoord
public static double getDistanceFromCoord(Molecule3D mol, int atom1, int atom2)
-
getDistanceArray
public static double[][] getDistanceArray(Molecule3D mol)
-
isParametrized
public static boolean isParametrized(Molecule3D mol)
-
isConnectedAtoms
public static boolean isConnectedAtoms(Molecule3D ff, java.util.List<java.lang.Integer> liIndexAtoms, int atm2)
-
isAliphaticAtom
public static boolean isAliphaticAtom(Molecule3D 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.
-
removeElectronPairs
public static void removeElectronPairs(Molecule3D mol)
-
removeHydrogensAndElectronPairs
public static void removeHydrogensAndElectronPairs(Molecule3D mol)
-
removeElement
public static void removeElement(Molecule3D mol, int atomicNo)
-
removeNonAromaticC
public static void removeNonAromaticC(Molecule3D mol)
-
removeCarbon
public static void removeCarbon(Molecule3D mol)
Removes all Carbon atoms, except the FLAG_CENTER_ATOM is set.- Parameters:
mol- Molecule
-
flagCarbon
public static void flagCarbon(Molecule3D mol)
-
flagUnflaggedWithFlagCenter
public static void flagUnflaggedWithFlagCenter(Molecule3D mol)
-
getConnectionTable
public static int[][] getConnectionTable(Molecule3D mol)
-
removeAtomsIfCarbon
public static final void removeAtomsIfCarbon(Molecule3D mol, java.util.List<java.lang.Integer> liIndices2Delete)
- Parameters:
mol- the atoms in this molecule will be deleteted.liIndices2Delete- list with Integer as indices for the atoms we will delete.
-
removeAllAtomsWithoutNeighbours
public static final Molecule3D removeAllAtomsWithoutNeighbours(Molecule3D ffMol)
-
removeAtoms
public static final void removeAtoms(Molecule3D mol, java.util.List<java.lang.Integer> liIndices2Delete)
-
removeFlaggedAtoms
public static final void removeFlaggedAtoms(Molecule3D mol)
-
replaceAtoms
public static final void replaceAtoms(Molecule3D ffMol, java.lang.String idcode2Replace, java.lang.String idcodeNewSubstructure, int[][] arrMapAtoms)
09.03.2020 For what is that good?- Parameters:
ffMol-idcode2Replace-idcodeNewSubstructure-arrMapAtoms-
-
formatAtomDescriptionsForViewer
public static final void formatAtomDescriptionsForViewer(Molecule3D mol, boolean showIndex)
-
formatAtomDescriptionsForViewer
public static final void formatAtomDescriptionsForViewer(Molecule3D mol)
-
calcTerminalAlkylGroupsCenter
public static final int calcTerminalAlkylGroupsCenter(Molecule3D mol)
Generates a center atom for each atom of a terminal alkyl group -CC, -C(C)C and -C(C)(C)C. The interaction type is the core atom of the substituents. All center atoms have identical coordinates. The original index of each considered atom is written to Molecule3D.INFO_ATOMGROUP.- Parameters:
mol- Molecule, the atoms used for calculating the center are flagged with FLAG1- Returns:
- number of terminal alkyl groups (Ethyl, Propyl, Butyl).
-
findTerminalMethylAtCarb
public static final int[] findTerminalMethylAtCarb(Molecule3D mol)
- Parameters:
mol-- Returns:
- indices for all terminal methyl CH3 groups which are connected to a carbon.
-
getCenterGravity
public static final Coordinates getCenterGravity(Molecule3D mol)
-
getCenterGravity
public static final Coordinates getCenterGravity(Molecule3D mol, int[] indices)
-
getCentered
public static final Molecule3D getCentered(Molecule3D ff)
-
getCentered
public static final Molecule3D getCentered(Molecule3D molecule3D, java.util.List<java.lang.Integer> liAtomIndexCenter)
-
getTopologicalCenter
public static final java.util.List<java.lang.Integer> getTopologicalCenter(int[][] arrTopoDist)
Topological centaer atoms are the atoms with the lowest squared sum of topological distances to all atoms.- Returns:
-
getTopologicalCenter
public static final java.util.List<java.lang.Integer> getTopologicalCenter(int[][] arrTopoDist, ListWithIntVec ilIndexAtoms)
-
getPheriphericPoints
public static final java.util.List<java.lang.Integer> getPheriphericPoints(int[][] arrTopoDist)
Gets the points with the maximum sum of squared topological distances to all atoms.- Parameters:
arrTopoDist-- Returns:
-
getTopologicalDistanceMatrix
public static final int[][] getTopologicalDistanceMatrix(Molecule3D mol)
-
getLongestChain
public static final java.util.List<java.lang.Integer> getLongestChain(Molecule3D ff)
-
getTreeFromBroadFirstSearch
public static final javax.swing.tree.DefaultMutableTreeNode getTreeFromBroadFirstSearch(Molecule3D molecule3D, int indexAtomStart)
User object in DefaultMutableTreeNode is the index of the atom. Root contains indexAtomStart.- Parameters:
molecule3D-indexAtomStart-- Returns:
-
getTreeFromComplete
public static final javax.swing.tree.DefaultMutableTreeNode getTreeFromComplete(Molecule3D molecule3D, int indexAtomStart)
Get all possible paths. Only crossing is not allowed.- Parameters:
molecule3D-indexAtomStart-- Returns:
-
getPath
public static final int[] getPath(Molecule3D ff, int indexAt1, int indexAt2)
-
getLayersFromBroadFirstSearch
public static final java.util.List<java.util.List<java.lang.Integer>> getLayersFromBroadFirstSearch(Molecule3D molecule3D, int indexAtomStart)
Returns the atom indices as layers of the start atom. First layer is indexAtomStart.- Parameters:
molecule3D-indexAtomStart-- Returns:
-
getLongestChain
public static final java.util.List<java.lang.Integer> getLongestChain(Molecule3D molecule3D, int indexAtomStart)
-
toString
public static final java.lang.String toString(Molecule3D mol)
-
getDeprotonated
public static Molecule3D getDeprotonated(Molecule3D molecule3D, int indexAtomReactiveCenter)
Deprotonates and decreases charge by 1.- Parameters:
molecule3D-indexAtomReactiveCenter-- Returns:
- null if no hydrogen is attached to indexAtomReactiveCenter.
-
getProtonated
public static Molecule3D getProtonated(Molecule3D molecule3D, int indexAtomReactiveCenter)
Protonates and increases charge by 1.- Parameters:
molecule3D-- Returns:
-
randomizeAtoms
public static Molecule3D randomizeAtoms(Molecule3D molecule3D)
-
-