Class AtomTetrahedralLigandPlacer3D

java.lang.Object
org.openscience.cdk.modeling.builder3d.AtomTetrahedralLigandPlacer3D

public class AtomTetrahedralLigandPlacer3D extends Object
A set of static utility classes for geometric calculations on Atoms.
Author:
Peter Murray-Rust,chhoppe,egonw
Source code:
main
Belongs to CDK module:
builder3d
Created on:
2003-??-??
  • Field Details

    • DEFAULT_BOND_LENGTH_H

      public static final double DEFAULT_BOND_LENGTH_H
      See Also:
    • TETRAHEDRAL_ANGLE

      public static final double TETRAHEDRAL_ANGLE
  • Method Details

    • 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 atom
      atom2 - movable atom
      point2 - 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 added
      length - A-X length
      angle - B-A-X angle (used in certain cases)
      nwanted - Description of the Parameter
      noCoords - Description of the Parameter
      withCoords - Description of the Parameter
      atomC - 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 Parameter
      withCoords - Description of the Parameter
      atomC - Description of the Parameter
      length - Description of the Parameter
      angle - 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 created
      length - bond length
      angle - angle in a B-A-(X) system; a=central atom; x=ligand with unknown coordinates
      noCoords - Description of the Parameter
      withCoords - Description of the Parameter
      atomC - 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 added
      nwanted - 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 added
      nwanted - number of points to calculate (1-3)
      length - A-X length
      angle - B-A-X angle
      bPoint - Description of the Parameter
      cPoint - 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 added
      bPoint - first ligand of A
      cPoint - second ligand of A
      nwanted - number of points to calculate (1-2)
      length - A-X length
      angle - 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 added
      bPoint - first ligand of A
      cPoint - second ligand of A
      dPoint - third ligand of A
      length - 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 length
      angle - 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 length
      angle - 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 axis
      axis - axis of rotation
      angle - 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 Parameter
      id2 - Description of the Parameter
      id3 - 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 - stereocenter
      ax - bond between stereocenter and unplaced atom
      atomB - neighbour of atomA (in plane created by atomA, atomB and atomC)
      atomC - neighbour of atomA
      branchPoints - 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 a
      b - vector b
      c - 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 - Point3d
      b - Point3d
      c - Point3d
      d - 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 Parameter
      ac - 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)