Class AtomTetrahedralLigandPlacer3D
- java.lang.Object
-
- org.openscience.cdk.modeling.builder3d.AtomTetrahedralLigandPlacer3D
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_BOND_LENGTH_H
static double
TETRAHEDRAL_ANGLE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
Generate coordinates for all atoms which are singly bonded and have no coordinates.javax.vecmath.Point3d[]
calculate3DCoordinates0(javax.vecmath.Point3d aPoint, int nwanted, double length)
Calculates substituent points.javax.vecmath.Point3d[]
calculate3DCoordinates1(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, int nwanted, double length, double angle)
Calculate new point(s) X in a B-A system to form B-A-X.javax.vecmath.Point3d[]
calculate3DCoordinates2(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, int nwanted, double length, double angle)
Calculate new point(s) X in a B-A-C system, it forms a B-A(-C)-X system.javax.vecmath.Point3d
calculate3DCoordinates3(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, javax.vecmath.Point3d dPoint, double length)
Calculate new point X in a B-A(-D)-C system.javax.vecmath.Point3d
calculate3DCoordinatesSP2_1(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, double length, double angle)
Calculate new point in B-A-C system.javax.vecmath.Point3d[]
calculate3DCoordinatesSP2_2(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, double length, double angle)
Calculate two new points in B-A system.javax.vecmath.Point3d[]
get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, int nwanted, double length, double angle)
Adds 3D coordinates for singly-bonded ligands of a reference atom (A).javax.vecmath.Point3d[]
get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, double length, double angle)
Main method for the calculation of the ligand coordinates for sp2 atoms.javax.vecmath.Point3d[]
get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, int nwanted, double length, double angle)
Main method for the calculation of the ligand coordinates for sp3 atoms.javax.vecmath.Point3d
get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle)
double
getAngleValue(String id1, String id2, String id3)
Gets the angleKey attribute of the AtomPlacer3D object.IAtomContainer
getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
Gets all placed neighbouring atoms of a atom.IAtom
getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac)
Returns a placed neighbouring atom of a central atom atomA, which is not atomB.double
getSpatproduct(javax.vecmath.Vector3d a, javax.vecmath.Vector3d b, javax.vecmath.Vector3d c)
Gets the spatproduct of three vectors.double
getTorsionAngle(javax.vecmath.Point3d a, javax.vecmath.Point3d b, javax.vecmath.Point3d c, javax.vecmath.Point3d d)
Calculates the torsionAngle of a-b-c-d.IAtomContainer
getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
Gets the unsetAtomsInAtomContainer attribute of the AtomTetrahedralLigandPlacer3D object.boolean
hasUnsetNeighbour(IAtom atom, IAtomContainer ac)
int
makeStereocenter(javax.vecmath.Point3d atomA, IBond ax, javax.vecmath.Point3d atomB, javax.vecmath.Point3d atomC, javax.vecmath.Point3d[] branchPoints)
set Atoms in respect to stereoinformation.javax.vecmath.Point3d
rescaleBondLength(IAtom atom1, IAtom atom2, javax.vecmath.Point3d point2)
Rescales Point2 so that length 1-2 is sum of covalent radii.static javax.vecmath.Vector3d
rotate(javax.vecmath.Vector3d vector, javax.vecmath.Vector3d axis, double angle)
Rotates a vector around an axis.void
setParameterSet(Map moleculeParameter)
Constructor for the setParameterSet object.
-
-
-
Field Detail
-
DEFAULT_BOND_LENGTH_H
public static final double DEFAULT_BOND_LENGTH_H
- See Also:
- Constant Field Values
-
TETRAHEDRAL_ANGLE
public static final double TETRAHEDRAL_ANGLE
-
-
Method Detail
-
setParameterSet
public void setParameterSet(Map moleculeParameter)
Constructor for the setParameterSet object.- Parameters:
moleculeParameter
- Description of the Parameter
-
add3DCoordinatesForSinglyBondedLigands
public void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer) throws CDKException
Generate coordinates for all atoms which are singly bonded and have no coordinates. This is useful when hydrogens are present but have no coordinates. It knows about C, O, N, S only and will give tetrahedral or trigonal geometry elsewhere. Bond lengths are computed from covalent radii or taken out of a parameter set if available. Angles are tetrahedral or trigonal- Parameters:
atomContainer
- the set of atoms involved- Throws:
CDKException
- Keywords:
- coordinate calculation, 3D model
-
rescaleBondLength
public javax.vecmath.Point3d rescaleBondLength(IAtom atom1, IAtom atom2, javax.vecmath.Point3d point2)
Rescales Point2 so that length 1-2 is sum of covalent radii. If covalent radii cannot be found, use bond length of 1.0- Parameters:
atom1
- stationary atomatom2
- movable atompoint2
- coordinates for atom 2- Returns:
- new coordinates for atom 2
-
get3DCoordinatesForLigands
public javax.vecmath.Point3d[] get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, int nwanted, double length, double angle) throws CDKException
Adds 3D coordinates for singly-bonded ligands of a reference atom (A). Initially designed for hydrogens. The ligands of refAtom are identified and those with 3D coordinates used to generate the new points. (This allows structures with partially known 3D coordinates to be used, as when groups are added.) "Bent" and "non-planar" groups can be formed by taking a subset of the calculated points. Thus R-NH2 could use 2 of the 3 points calculated from (1,iii) nomenclature: A is point to which new ones are "attached". A may have ligands B, C... B may have ligands J, K.. points X1, X2... are returned The cases (see individual routines, which use idealised geometry by default): (0) zero ligands of refAtom. The resultant points are randomly oriented: (i) 1 points required; +x,0,0 (ii) 2 points: use +x,0,0 and -x,0,0 (iii) 3 points: equilateral triangle in xy plane (iv) 4 points x,x,x, x,-x,-x, -x,x,-x, -x,-x,x (1a) 1 ligand(B) of refAtom which itself has a ligand (J) (i) 1 points required; vector along AB vector (ii) 2 points: 2 vectors in ABJ plane, staggered and eclipsed wrt J (iii) 3 points: 1 staggered wrt J, the others +- gauche wrt J (1b) 1 ligand(B) of refAtom which has no other ligands. A random J is generated and (1a) applied (2) 2 ligands(B, C) of refAtom A (i) 1 points required; vector in ABC plane bisecting AB, AC. If ABC is linear, no points (ii) 2 points: 2 vectors at angle ang, whose resultant is 2i (3) 3 ligands(B, C, D) of refAtom A (i) 1 points required; if A, B, C, D coplanar, no points. else vector is resultant of BA, CA, DA fails if atom itself has no coordinates or >4 ligands- Parameters:
refAtom
- (A) to which new ligands coordinates could be addedlength
- A-X lengthangle
- B-A-X angle (used in certain cases)nwanted
- Description of the ParameternoCoords
- Description of the ParameterwithCoords
- Description of the ParameteratomC
- Description of the Parameter- Returns:
- Point3D[] points calculated. If request could not be fulfilled (e.g. too many atoms, or strange geometry, returns empty array (zero length, not null)
- Throws:
CDKException
- Keywords:
- coordinate generation
-
get3DCoordinatesForSPLigands
public javax.vecmath.Point3d get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle)
-
get3DCoordinatesForSP2Ligands
public javax.vecmath.Point3d[] get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, double length, double angle)
Main method for the calculation of the ligand coordinates for sp2 atoms. Decides if one or two coordinates should be created- Parameters:
refAtom
- central atom (Atom)noCoords
- Description of the ParameterwithCoords
- Description of the ParameteratomC
- Description of the Parameterlength
- Description of the Parameterangle
- Description of the Parameter- Returns:
- coordinates as Points3d []
-
get3DCoordinatesForSP3Ligands
public javax.vecmath.Point3d[] get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords, IAtom atomC, int nwanted, double length, double angle)
Main method for the calculation of the ligand coordinates for sp3 atoms. Decides how many coordinates should be created- Parameters:
refAtom
- central atom (Atom)nwanted
- how many ligands should be createdlength
- bond lengthangle
- angle in a B-A-(X) system; a=central atom; x=ligand with unknown coordinatesnoCoords
- Description of the ParameterwithCoords
- Description of the ParameteratomC
- Description of the Parameter- Returns:
- Description of the Return Value
-
calculate3DCoordinates0
public javax.vecmath.Point3d[] calculate3DCoordinates0(javax.vecmath.Point3d aPoint, int nwanted, double length)
Calculates substituent points. Calculate substituent points for (0) zero ligands of aPoint. The resultant points are randomly oriented: (i) 1 points required; +x,0,0 (ii) 2 points: use +x,0,0 and -x,0,0 (iii) 3 points: equilateral triangle in the xy plane (iv) 4 points x,x,x, x,-x,-x, -x,x,-x, -x,-x,x where 3x**2 = bond length- Parameters:
aPoint
- to which substituents are addednwanted
- number of points to calculate (1-4)length
- from aPoint- Returns:
- Point3d[] nwanted points (or zero if failed)
-
calculate3DCoordinates1
public javax.vecmath.Point3d[] calculate3DCoordinates1(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, int nwanted, double length, double angle)
Calculate new point(s) X in a B-A system to form B-A-X. Use C as reference for * staggering about the B-A bond (1a) 1 ligand(B) of refAtom (A) which itself has a ligand (C) (i) 1 points required; vector along AB vector (ii) 2 points: 2 vectors in ABC plane, staggered and eclipsed wrt C (iii) 3 points: 1 staggered wrt C, the others +- gauche wrt C If C is null, a random non-colinear C is generated- Parameters:
aPoint
- to which substituents are addednwanted
- number of points to calculate (1-3)length
- A-X lengthangle
- B-A-X anglebPoint
- Description of the ParametercPoint
- Description of the Parameter- Returns:
- Point3d[] nwanted points (or zero if failed)
-
calculate3DCoordinates2
public javax.vecmath.Point3d[] calculate3DCoordinates2(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, int nwanted, double length, double angle)
Calculate new point(s) X in a B-A-C system, it forms a B-A(-C)-X system. (2) 2 ligands(B, C) of refAtom A (i) 1 points required; vector in ABC plane bisecting AB, AC. If ABC is linear, no points (ii) 2 points: 2 points X1, X2, X1-A-X2 = angle about 2i vector- Parameters:
aPoint
- to which substituents are addedbPoint
- first ligand of AcPoint
- second ligand of Anwanted
- number of points to calculate (1-2)length
- A-X lengthangle
- B-A-X angle- Returns:
- Point3d[] nwanted points (or zero if failed)
-
calculate3DCoordinates3
public javax.vecmath.Point3d calculate3DCoordinates3(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, javax.vecmath.Point3d dPoint, double length)
Calculate new point X in a B-A(-D)-C system. It forms a B-A(-D)(-C)-X system. (3) 3 ligands(B, C, D) of refAtom A (i) 1 points required; if A, B, C, D coplanar, no points. else vector is resultant of BA, CA, DA- Parameters:
aPoint
- to which substituents are addedbPoint
- first ligand of AcPoint
- second ligand of AdPoint
- third ligand of Alength
- A-X length- Returns:
- Point3d nwanted points (or null if failed (coplanar))
-
calculate3DCoordinatesSP2_1
public javax.vecmath.Point3d calculate3DCoordinatesSP2_1(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, double length, double angle)
Calculate new point in B-A-C system. It forms B-A(-X)-C system, where A is sp2- Parameters:
aPoint
- central point A (Point3d)bPoint
- B (Point3d)cPoint
- C (Point3d)length
- bond lengthangle
- angle between B(C)-A-X- Returns:
- new Point (Point3d)
-
calculate3DCoordinatesSP2_2
public javax.vecmath.Point3d[] calculate3DCoordinatesSP2_2(javax.vecmath.Point3d aPoint, javax.vecmath.Point3d bPoint, javax.vecmath.Point3d cPoint, double length, double angle)
Calculate two new points in B-A system. It forms B-A(-X)(-X) system, where A is sp2- Parameters:
aPoint
- central point A (Point3d)bPoint
- B (Point3d)cPoint
- C (Point3d)length
- bond lengthangle
- angle between B(C)-A-X- Returns:
- new Points (Point3d [])
-
rotate
public static javax.vecmath.Vector3d rotate(javax.vecmath.Vector3d vector, javax.vecmath.Vector3d axis, double angle)
Rotates a vector around an axis.- Parameters:
vector
- vector to be rotated around axisaxis
- axis of rotationangle
- angle to vector rotate around- Returns:
- rotated vector author: egonw
-
getAngleValue
public double getAngleValue(String id1, String id2, String id3)
Gets the angleKey attribute of the AtomPlacer3D object.- Parameters:
id1
- Description of the Parameterid2
- Description of the Parameterid3
- Description of the Parameter- Returns:
- The angleKey value
-
makeStereocenter
public int makeStereocenter(javax.vecmath.Point3d atomA, IBond ax, javax.vecmath.Point3d atomB, javax.vecmath.Point3d atomC, javax.vecmath.Point3d[] branchPoints)
set Atoms in respect to stereoinformation. take placed neighbours to stereocenter create a x b if right handed system (spatproduct >0) if unplaced is not up (relative to stereocenter) n=b x a Determine angle between n and possible ligand place points if angle smaller than 90 degrees take this branch point- Parameters:
atomA
- placed Atom - stereocenterax
- bond between stereocenter and unplaced atomatomB
- neighbour of atomA (in plane created by atomA, atomB and atomC)atomC
- neighbour of atomAbranchPoints
- the two possible placement points for unplaced atom (up and down)- Returns:
- int value of branch point position
-
getSpatproduct
public double getSpatproduct(javax.vecmath.Vector3d a, javax.vecmath.Vector3d b, javax.vecmath.Vector3d c)
Gets the spatproduct of three vectors.- Parameters:
a
- vector ab
- vector bc
- vector c- Returns:
- double value of the spatproduct
-
getTorsionAngle
public double getTorsionAngle(javax.vecmath.Point3d a, javax.vecmath.Point3d b, javax.vecmath.Point3d c, javax.vecmath.Point3d d)
Calculates the torsionAngle of a-b-c-d.- Parameters:
a
- Point3db
- Point3dc
- Point3dd
- Point3d- Returns:
- The torsionAngle value
-
getPlacedAtomsInAtomContainer
public IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
Gets all placed neighbouring atoms of a atom.- Parameters:
atom
- central atom (Atom)ac
- the molecule- Returns:
- all connected and placed atoms to the central atom ((AtomContainer)
-
getUnsetAtomsInAtomContainer
public IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
Gets the unsetAtomsInAtomContainer attribute of the AtomTetrahedralLigandPlacer3D object.- Parameters:
atom
- Description of the Parameterac
- Description of the Parameter- Returns:
- The unsetAtomsInAtomContainer value
-
hasUnsetNeighbour
public boolean hasUnsetNeighbour(IAtom atom, IAtomContainer ac)
-
getPlacedHeavyAtomInAtomContainer
public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac)
Returns a placed neighbouring atom of a central atom atomA, which is not atomB.- Parameters:
atomA
- central atom (Atom)atomB
- atom connected to atomA (Atom)ac
- molecule- Returns:
- returns a connected atom (Atom)
-
-