Class AtomTools


  • public class AtomTools
    extends Object
    A set of static utility classes for geometric calculations on Atoms.
    Author:
    Peter Murray-Rust
    Source code:
    main
    Created on:
    2003-06-14
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double TETRAHEDRAL_ANGLE  
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomTools()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void add3DCoordinates1​(IAtomContainer atomContainer)
      Generate coordinates for all atoms which are singly bonded and have no coordinates.
      static javax.vecmath.Point3d[] calculate3DCoordinates0​(javax.vecmath.Point3d aPoint, int nwanted, double length)
      Calculates substituent points.
      static 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.
      static 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.
      static javax.vecmath.Point3d calculate3DCoordinates3​(javax.vecmath.Point3d focus, javax.vecmath.Point3d aNbor, javax.vecmath.Point3d bNbor, javax.vecmath.Point3d cNbor, double length)
      Calculate new point X in a B-A(-D)-C system.
      static javax.vecmath.Point3d[] calculate3DCoordinatesForLigands​(IAtomContainer atomContainer, IAtom refAtom, int nwanted, double length, double angle)
      Adds 3D coordinates for singly-bonded ligands of a reference atom (A).
      static javax.vecmath.Point3d rescaleBondLength​(IAtom atom1, IAtom atom2, javax.vecmath.Point3d point2)
      Rescales Point2 so that length 1-2 is sum of covalent radii.
    • Field Detail

      • TETRAHEDRAL_ANGLE

        public static final double TETRAHEDRAL_ANGLE
    • Constructor Detail

      • AtomTools

        public AtomTools()
    • Method Detail

      • add3DCoordinates1

        public static void add3DCoordinates1​(IAtomContainer atomContainer)
        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 if available. Angles are tetrahedral or trigonal
        Parameters:
        atomContainer - the set of atoms involved
        Keywords:
        coordinate calculation, 3D model
      • rescaleBondLength

        public static 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 coords for atom 2
      • calculate3DCoordinatesForLigands

        public static javax.vecmath.Point3d[] calculate3DCoordinatesForLigands​(IAtomContainer atomContainer,
                                                                               IAtom refAtom,
                                                                               int nwanted,
                                                                               double length,
                                                                               double angle)
        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:
        atomContainer - describing the ligands of refAtom. It could be the whole molecule, or could be a selected subset of ligands
        refAtom - (A) to which new ligands coordinates could be added
        length - A-X length
        angle - B-A-X angle (used in certain cases)
        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)
        Keywords:
        coordinate generation
      • calculate3DCoordinates0

        public static 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 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 static 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
        Returns:
        Point3d[] nwanted points (or zero if failed)
      • calculate3DCoordinates2

        public static 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 form 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 static javax.vecmath.Point3d calculate3DCoordinates3​(javax.vecmath.Point3d focus,
                                                                    javax.vecmath.Point3d aNbor,
                                                                    javax.vecmath.Point3d bNbor,
                                                                    javax.vecmath.Point3d cNbor,
                                                                    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:
        focus - to which substituents are added
        aNbor - first ligand of A
        bNbor - second ligand of A
        cNbor - third ligand of A
        length - A-X length
        Returns:
        Point3d nwanted points (or null if failed (coplanar))