Package com.actelion.research.chem.conf
Class Conformer
- java.lang.Object
-
- com.actelion.research.chem.conf.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 Summary
Constructors Constructor Description Conformer(Conformer c)
Creates a new conformer as an exact copy of the given one.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.Conformer(StereoMolecule mol)
Creates a Conformer, i.e.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateTorsion(int[] atom)
Calculates a signed torsion as an exterior spherical angle from a valid 4-atom strand.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.int
compareTo(Conformer c)
void
copyFrom(Conformer conformer)
Copies the conformer's atom coordinates to this Conformer.void
copyFrom(StereoMolecule mol)
Copies the molecule's atom coordinates to this Conformer.void
copyTo(StereoMolecule mol)
Copies this conformer's atom coordinates to mol.int
deleteAtoms(boolean[] isToBeDeleted)
Removes atoms Coordinates objects from those atoms that are marked in the given array.boolean
equals(Conformer c)
int
getBondTorsion(int bond)
Returns the current bond torsion angle in degrees, it is was set before.Coordinates[]
getCoordinates()
Coordinates
getCoordinates(int atom)
double
getEnergy()
StereoMolecule
getMolecule()
java.lang.String
getName()
int
getSize()
double
getX(int atom)
double
getY(int atom)
double
getZ(int atom)
void
setBondTorsion(int bond, short torsion)
Sets the current bond torsion to be retrieved later.void
setCoordinates(int atom, Coordinates coords)
Copies x,y,z from coords into this atom's coordinatesvoid
setCoordinatesReplace(int atom, Coordinates coords)
Replaces the atom's Coordinates object by the given onevoid
setEnergy(double energy)
void
setName(java.lang.String name)
void
setX(int atom, double x)
void
setY(int atom, double y)
void
setZ(int atom, double z)
StereoMolecule
toMolecule()
Copies this Conformer's atom coordinates to the associated molecule.StereoMolecule
toMolecule(StereoMolecule mol)
Copies this Conformer's atom coordinates to the given molecule.Conformer
translate(double dx, double dy, double dz)
Translate this conformer's coordinates by adding the dx,dy,dz shifts to all atom coordinates.
-
-
-
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)
-
-