Class Conformer

  • All Implemented Interfaces:
    java.lang.Comparable<Conformer>
    Direct Known Subclasses:
    SelfOrganizedConformer

    public class Conformer
    extends java.lang.Object
    implements java.lang.Comparable<Conformer>
    • Constructor Detail

      • Conformer

        public Conformer​(StereoMolecule mol)
        Creates a Conformer, i.e. basically a new set of atom coordinates for the given Molecule. The conformer is initialized with an exact copy of the molecules internal coordinates.
        Parameters:
        mol -
      • Conformer

        public Conformer​(Conformer c)
        Creates a new conformer as an exact copy of the given one.
        Parameters:
        c -
      • Conformer

        public Conformer​(Conformer c,
                         StereoMolecule mol)
        Use at own risk!! Initializes the conformer as a copy of c but replaces the StereoMolecule by the supplied molecule.
        Parameters:
        c -
        mol -
    • Method Detail

      • center

        public Conformer center()
        Translate this conformer's coordinates such that its center of gravity is moved to P(0,0,0) assuming all atoms have the same mass.
        Returns:
        this conformer with centered coordinates
      • translate

        public Conformer translate​(double dx,
                                   double dy,
                                   double dz)
        Translate this conformer's coordinates by adding the dx,dy,dz shifts to all atom coordinates.
        Returns:
        this conformer with translated coordinates
      • getSize

        public int getSize()
      • getX

        public double getX​(int atom)
      • getY

        public double getY​(int atom)
      • getZ

        public double getZ​(int atom)
      • getCoordinates

        public Coordinates[] getCoordinates()
      • getCoordinates

        public Coordinates getCoordinates​(int atom)
      • setCoordinates

        public void setCoordinates​(int atom,
                                   Coordinates coords)
        Copies x,y,z from coords into this atom's coordinates
        Parameters:
        atom -
        coords -
      • setCoordinatesReplace

        public void setCoordinatesReplace​(int atom,
                                          Coordinates coords)
        Replaces the atom's Coordinates object by the given one
        Parameters:
        atom -
        coords -
      • setX

        public void setX​(int atom,
                         double x)
      • setY

        public void setY​(int atom,
                         double y)
      • setZ

        public void setZ​(int atom,
                         double z)
      • deleteAtoms

        public int deleteAtoms​(boolean[] isToBeDeleted)
        Removes atoms Coordinates objects from those atoms that are marked in the given array. Make sure to also remove those atoms from the underlying Molecule.
        Parameters:
        isToBeDeleted -
        Returns:
      • calculateTorsion

        public double calculateTorsion​(int[] atom)
        Calculates a signed torsion as an exterior spherical angle from a valid 4-atom strand. Looking along the central bond, the torsion angle is 0.0, if the projection of front and rear bonds point in the same direction. If the front bond is rotated in the clockwise direction, the angle increases, i.e. has a positive value. http://en.wikipedia.org/wiki/Dihedral_angle
        Parameters:
        atom - 4 valid atom indices defining a connected atom sequence
        Returns:
        torsion in the range: -pi <= torsion <= pi
      • getBondTorsion

        public int getBondTorsion​(int bond)
        Returns the current bond torsion angle in degrees, it is was set before.
        Parameters:
        bond -
        Returns:
        -1 or previously set torsion angle in the range 0 ... 359
      • setBondTorsion

        public void setBondTorsion​(int bond,
                                   short torsion)
        Sets the current bond torsion to be retrieved later.
        Parameters:
        bond -
        torsion - in degrees
      • getMolecule

        public StereoMolecule getMolecule()
        Returns:
        reference to the original molecule
      • copyFrom

        public void copyFrom​(StereoMolecule mol)
        Copies the molecule's atom coordinates to this Conformer.
        Parameters:
        mol - molecule identical to the original molecule passed in the Constructor
      • copyTo

        public void copyTo​(StereoMolecule mol)
        Copies this conformer's atom coordinates to mol.
        Parameters:
        mol - molecule identical to the original molecule passed in the Constructor
      • copyFrom

        public void copyFrom​(Conformer conformer)
        Copies the conformer's atom coordinates to this Conformer.
        Parameters:
        conformer - other conformer of the molecule passed in the Constructor
      • toMolecule

        public StereoMolecule toMolecule()
        Copies this Conformer's atom coordinates to the associated molecule.
        Returns:
        this conformer's associated StereoMolecule with updated coordinates
      • toMolecule

        public StereoMolecule toMolecule​(StereoMolecule mol)
        Copies this Conformer's atom coordinates to the given molecule. If no molecule is given, then a compact copy of this conformer's molecule is created and returned with this conformer's coordinates.
        Parameters:
        mol - null or original molecule passed in the Constructor or identical copy
        Returns:
        this conformer as StereoMolecule
      • getEnergy

        public double getEnergy()
      • setEnergy

        public void setEnergy​(double energy)
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • equals

        public boolean equals​(Conformer c)
      • compareTo

        public int compareTo​(Conformer c)
        Specified by:
        compareTo in interface java.lang.Comparable<Conformer>