Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::Molecule Class Reference

Molecule : class for complex scatterer descriptions using cartesian coordinates with bond length/angle restraints, and moves either of individual atoms or using torsion bonds. More...

Inheritance diagram for ObjCryst::Molecule:

Inheritance graph
[legend]
Collaboration diagram for ObjCryst::Molecule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Molecule (Crystal &cryst, const string &name="")
 Constructor.

 Molecule (const Molecule &old)
 Copy constructor.

 ~Molecule ()
 Destructor.

virtual MoleculeCreateCopy () const
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...).

virtual void Print () const
 Print some info about the scatterer (ideally this should be one line...).

virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML.

virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream.

virtual void BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false)
 This should be called by any optimization class at the begining of an optimization.

virtual void RandomizeConfiguration ()
 Randomize Configuration (before a global optimization).

virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type)
 Make a random move of the current configuration.

virtual REAL GetLogLikelihood () const
 Get -log(likelihood) of the current configuration for the object.

virtual void TagNewBestConfig () const
 During a global optimization, tells the object that the current config is the latest "best" config.

virtual int GetNbComponent () const
 Number of components in the scatterer (eg number of point scatterers).

virtual const ScatteringComponentListGetScatteringComponentList () const
 Get the list of all scattering components for this scatterer.

virtual string GetComponentName (const int i) const
 Name for the i-th component of this scatterer.

virtual ostream & POVRayDescription (ostream &os, const CrystalPOVRayOptions &options) const
virtual void GLInitDisplayList (const bool onlyIndependentAtoms=false, const REAL xMin=-.1, const REAL xMax=1.1, const REAL yMin=-.1, const REAL yMax=1.1, const REAL zMin=-.1, const REAL zMax=1.1, const bool displayEnantiomer=false, const bool displayNames=false) const
void AddAtom (const REAL x, const REAL y, const REAL z, const ScatteringPower *pPow, const string &name, const bool updateDisplay=true)
 Add an atom.

vector< MolAtom * >::iterator RemoveAtom (MolAtom &)
 Remove an atom.

void AddBond (MolAtom &atom1, MolAtom &atom2, const REAL length, const REAL sigma, const REAL delta, const REAL bondOrder=1., const bool updateDisplay=true)
 Add a bond.

vector< MolBond * >::iterator RemoveBond (const MolBond &)
 Remove a bond.

vector< MolBond * >::const_iterator FindBond (const MolAtom &, const MolAtom &) const
 Searches whether a bond between two atoms already exists.

vector< MolBond * >::iterator FindBond (const MolAtom &, const MolAtom &)
 Searches whether a bond between two atoms already exists.

void AddBondAngle (MolAtom &atom1, MolAtom &atom2, MolAtom &atom3, const REAL angle, const REAL sigma, const REAL delta, const bool updateDisplay=true)
 Add a bond angle restraint.

vector< MolBondAngle
* >::iterator 
RemoveBondAngle (const MolBondAngle &)
 Remove a BondAngle.

vector< MolBondAngle
* >::const_iterator 
FindBondAngle (const MolAtom &at1, const MolAtom &at0, const MolAtom &at2) const
 Searches whether a bond between three atoms already exists, searching for either (at1,at2,at3) and (at3,at2,at1), as these are equivalent.

void AddDihedralAngle (MolAtom &atom1, MolAtom &atom2, MolAtom &atom3, MolAtom &atom4, const REAL angle, const REAL sigma, const REAL delta, const bool updateDisplay=true)
 Add a dihedral angle restraint.

vector< MolDihedralAngle
* >::iterator 
RemoveDihedralAngle (const MolDihedralAngle &)
 Remove a dihedral angle.

vector< MolDihedralAngle
* >::const_iterator 
FindDihedralAngle (const MolAtom &at1, const MolAtom &at2, const MolAtom &at3, const MolAtom &at4) const
 Searches whether a dihedral between four atoms already exists, searching for either (at1,at2,at3,at4) and (at4,at3,at2,at1), as these are equivalent.

void AddRigidGroup (const RigidGroup &, const bool updateDisplay=true)
 Add a rigid group of atoms.

std::vector< RigidGroup
* >::iterator 
RemoveRigidGroup (const RigidGroup &group, const bool updateDisplay=true)
 Remove a rigid group of atoms.

MolAtomGetAtom (unsigned int i)
const MolAtomGetAtom (unsigned int i) const
MolAtomGetAtom (const string &name)
const MolAtomGetAtom (const string &name) const
vector< MolAtom * >::reverse_iterator FindAtom (const string &name)
 Search a MolAtom from its name.

vector< MolAtom * >::const_reverse_iterator FindAtom (const string &name) const
 Search a MolAtom from its name.

void OptimizeConformation (const long nbTrial=10000, const REAL stopCost=0.)
 Minimize configuration from internal restraints (bond lengths, angles and dihedral angles).

const vector< MolAtom * > & GetAtomList () const
const vector< MolBond * > & GetBondList () const
const vector< MolBondAngle * > & GetBondAngleList () const
const vector< MolDihedralAngle * > & GetDihedralAngleList () const
vector< MolAtom * > & GetAtomList ()
vector< MolBond * > & GetBondList ()
vector< MolBondAngle * > & GetBondAngleList ()
vector< MolDihedralAngle * > & GetDihedralAngleList ()
list< StretchModeBondLength > & GetStretchModeBondLengthList ()
list< StretchModeBondAngle > & GetStretchModeBondAngleList ()
list< StretchModeTorsion > & GetStretchModeTorsionList ()
const list< StretchModeBondLength > & GetStretchModeBondLengthList () const
const list< StretchModeBondAngle > & GetStretchModeBondAngleList () const
const list< StretchModeTorsion > & GetStretchModeTorsionList () const
const std::vector< RigidGroup * > & GetRigidGroupList () const
 List of rigid group of atoms.

std::vector< RigidGroup * > & GetRigidGroupList ()
 List of rigid group of atoms.

void RotateAtomGroup (const MolAtom &at1, const MolAtom &at2, const set< MolAtom * > &atoms, const REAL angle, const bool keepCenter=true)
 Rotate a group of atoms around an axis defined by two atoms.

void RotateAtomGroup (const MolAtom &at, const REAL vx, const REAL vy, const REAL vz, const set< MolAtom * > &atoms, const REAL angle, const bool keepCenter=true)
 Rotate a group of atoms around an axis defined by one atom and a vector.

void TranslateAtomGroup (const set< MolAtom * > &atoms, const REAL dx, const REAL dy, const REAL dz, const bool keepCenter=true)
 Translate a group of atoms in a given direction.

void RestraintStatus (ostream &os) const
 Print the status of all restraints (bond length, angles...).

const map< MolAtom *, set<
MolAtom * > > & 
GetConnectivityTable ()
 Get the connectivity table.

RefinableObjClockGetBondListClock ()
 get the clock associated to the list of bonds

const RefinableObjClockGetBondListClock () const
 get the clock associated to the list of bonds

RefinableObjClockGetAtomPositionClock ()
 Get the clock associated to the atomic positions.

const RefinableObjClockGetAtomPositionClock () const
 Get the clock associated to the atomic positions.

RefinableObjClockGetRigidGroupClock ()
 Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified).

const RefinableObjClockGetRigidGroupClock () const
 Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified).

void RigidifyWithDihedralAngles ()
 Add dihedral angles so as to rigidify the Molecule.

REAL BondLengthRandomChange (const StretchModeBondLength &mode, const REAL amplitude, const bool respectRestraint=true)
 Stretch a bond, while respecting the Restraint (if any).

REAL BondAngleRandomChange (const StretchModeBondAngle &mode, const REAL amplitude, const bool respectRestraint=true)
 change a bond angle, while respecting the Restraint (if any).

REAL DihedralAngleRandomChange (const StretchModeTorsion &mode, const REAL amplitude, const bool respectRestraint=true)
 Change a dihedral angle, while respecting the Restraint (if any).

const MolAtomGetCenterAtom () const
 Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

void SetCenterAtom (const MolAtom &at)
 Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

const std::vector< MolZAtom > & AsZMatrix (const bool keeporder) const
 Molecule as Z-matrix.

virtual void InitRefParList ()
 Prepare refinable parameters for the scatterer object.

void BuildRingList ()
 Build the list of rings in the molecule.

void BuildConnectivityTable () const
 Build the Connectivity table.

void BuildRotorGroup ()
 Build the groups of atoms that will be rotated during global optimization.

void TuneGlobalOptimRotationAmplitude ()
 Tune the rotation amplitude for free torsions and for the overall Molecule Rotation.

void BuildFlipGroup ()
 Build the groups of atoms that can be flipped.

void BuildStretchModeBondLength ()
 Build the groups of atoms moved when stretching a bond length, while respecting the Molecule restraints.

void BuildStretchModeBondAngle ()
 Build the groups of atoms moved when changing a bond angle, while respecting the Molecule restraints.

void BuildStretchModeTorsion ()
 Build the groups of atoms moved when changing a dihedral angle, while respecting the Molecule restraints.

void BuildStretchModeTwist ()
 Build the groups of atoms used to twist internally the Molecule, e.g.

void BuildStretchModeGroups ()
 Separate StretchMode that break more than their assigned restraint from others.

void UpdateScattCompList () const
 Update the Molecule::mScattCompList from the cartesian coordinates of all atoms, and the orientation parameters.

void InitOptions ()
 Build options for this object.

void FlipAtomGroup (const FlipGroup &)
 Flip a group of atom. See Molecule::FlipGroup.


Public Attributes

ScatteringComponentList mScattCompList
 The list of scattering components.

vector< MolAtom * > mvpAtom
 The list of atoms.

vector< MolBond * > mvpBond
 The list of bonds.

vector< MolBondAngle * > mvpBondAngle
 The list of bond angles.

vector< MolDihedralAngle * > mvpDihedralAngle
 The list of dihedral angles.

map< MolAtom *, std::vector<
MolBond * > > 
mvAtomBond
 List of Bonds for each atom.

std::vector< RigidGroup * > mvRigidGroup
 Rigid groups of atoms.

list< MolRingmvRing
 The list of rings.

Quaternion mQuat
 The unit quaternion defining the orientation.

REAL mBaseRotationAmplitude
 Base Rotation amplitude (in radians) for the Molecule, so that the average atomic displacement is equal to 0.1 A.

RefinableObjClock mClockAtomList
RefinableObjClock mClockBondList
RefinableObjClock mClockBondAngleList
RefinableObjClock mClockDihedralAngleList
RefinableObjClock mClockRigidGroup
RefinableObjClock mClockAtomPosition
RefinableObjClock mClockAtomScattPow
RefinableObjClock mClockOrientation
RefinableObjClock mClockLogLikelihood
RefinableObjClock mClockConnectivityTable
RefinableObjClock mClockRingList
RefinableObjClock mClockRotorGroup
RefinableObjClock mClockFlipGroup
RefinableObjClock mClockStretchModeBondLength
RefinableObjClock mClockStretchModeBondAngle
RefinableObjClock mClockStretchModeTorsion
RefinableObjClock mClockStretchModeTwist
unsigned long mLocalParamSet
unsigned long mRandomConformChangeNbTest
unsigned long mRandomConformChangeNbAccept
REAL mRandomConformChangeTemp
REAL mLastLogLike
bool mIsSelfOptimizing
RefObjOpt mFlexModel
 OPtion for the different types of flexibility possible for this molecule: rigid body, free atoms + restraints, torsion angles...

RefObjOpt mAutoOptimizeConformation
 Option to automatically optimize the starting conformation, if the total restraint cost is too high.

RefObjOpt mOptimizeOrientation
 Option to optimize the Molecule's orientation.

RefObjOpt mMoleculeCenter
 Option to choose the center of rotation of the Molecule for the global orientation either as the geometrical center, or as a given atom.

const MolAtommpCenterAtom
 Atom chosen as center of rotation, if mRotationCenter is set to use an atom rather than the geometrical center.

map< MolAtom *, set< MolAtom * > > mConnectivityTable
 Connectivity table: for each atom, keep the list of atoms bonded to it.

list< RotorGroupmvRotorGroupTorsion
 List of RotorGroups corresponding to free torsion bonds.

list< RotorGroupmvRotorGroupTorsionSingleChain
 List of RotorGroups corresponding to free torsion bonds, but with only one chain of atoms listed.

list< RotorGroupmvRotorGroupInternal
 List of RotorGroups for internal rotations.

list< FlipGroupmvFlipGroup
 The list of FlipGroups.

list< StretchModeBondLengthmvStretchModeBondLength
 List of StretchModeBondLength.

list< StretchModeBondAnglemvStretchModeBondAngle
 List of StretchModeBondLength.

list< StretchModeTorsionmvStretchModeTorsion
 List of StretchModeBondLength.

list< StretchModeTwistmvStretchModeTwist
 List of StretchModeTwist.

std::list< StretchMode * > mvpStretchModeFree
 Groups of StretchMode not breaking any restraint (unless the one they are associated to).

std::list< StretchMode * > mvpStretchModeNotFree
 Groups of StretchMode breaking restraints (beyond the one they are associated to).

std::vector< MolZAtommAsZMatrix
 The Molecule, as a lightweight ZMatrix, for export purposes.

REAL mLogLikelihood
 The current log(likelihood).


Detailed Description

Molecule : class for complex scatterer descriptions using cartesian coordinates with bond length/angle restraints, and moves either of individual atoms or using torsion bonds.

This can also be used for non-organic compounds (polyhedras etc...)

Note:
the parametrization is very different from ZScatterer: we keep a list of x,y,z which do not use limits (they must not), but the coordinates must be restrained or constrained from the expected bond lengths, angles and dihedral angles. The list of parameters is re-created in BeginOptimization() (except for the global x y z parameters for the global position of the Molecule, in fractionnal coordinates).

: all atoms must be somehow connected


Constructor & Destructor Documentation

ObjCryst::Molecule::Molecule Crystal cryst,
const string &  name = ""
 

Constructor.

ObjCryst::Molecule::Molecule const Molecule old  ) 
 

Copy constructor.

ObjCryst::Molecule::~Molecule  ) 
 

Destructor.


Member Function Documentation

void ObjCryst::Molecule::AddAtom const REAL  x,
const REAL  y,
const REAL  z,
const ScatteringPower pPow,
const string &  name,
const bool  updateDisplay = true
 

Add an atom.

void ObjCryst::Molecule::AddBond MolAtom atom1,
MolAtom atom2,
const REAL  length,
const REAL  sigma,
const REAL  delta,
const REAL  bondOrder = 1.,
const bool  updateDisplay = true
 

Add a bond.

void ObjCryst::Molecule::AddBondAngle MolAtom atom1,
MolAtom atom2,
MolAtom atom3,
const REAL  angle,
const REAL  sigma,
const REAL  delta,
const bool  updateDisplay = true
 

Add a bond angle restraint.

void ObjCryst::Molecule::AddDihedralAngle MolAtom atom1,
MolAtom atom2,
MolAtom atom3,
MolAtom atom4,
const REAL  angle,
const REAL  sigma,
const REAL  delta,
const bool  updateDisplay = true
 

Add a dihedral angle restraint.

void ObjCryst::Molecule::AddRigidGroup const RigidGroup ,
const bool  updateDisplay = true
 

Add a rigid group of atoms.

See Molecule::mvRigidGroup

const std::vector<MolZAtom>& ObjCryst::Molecule::AsZMatrix const bool  keeporder  )  const
 

Molecule as Z-matrix.

Parameters:
keeporder: if true, the order of the atoms is exactly the same as in the Molecule.

virtual void ObjCryst::Molecule::BeginOptimization const bool  allowApproximations = false,
const bool  enableRestraints = false
[virtual]
 

This should be called by any optimization class at the begining of an optimization.

This will also check that everything is ready, eg call the RefinableObj::Prepare() function. This also affects all sub-objects.

Note:
this may be called several time for some objects which are used by several other objects.
Parameters:
allowApproximations: if true, then the object can use faster but less precise functions during the optimization. This is useful for global optimization not using derivatives.
enableRestraints: if true, then restrained parameters will be allowed to go beyond theur hard limits. This implies that the algorithm will take into account the cost (penalty) related to the restraints. Objects which do not use restraints will simply ignore this. WARNING: this parameter may be removed with the new likelihood scheme.

Reimplemented from ObjCryst::RefinableObj.

REAL ObjCryst::Molecule::BondAngleRandomChange const StretchModeBondAngle mode,
const REAL  amplitude,
const bool  respectRestraint = true
 

change a bond angle, while respecting the Restraint (if any).

Returns:
the actual change in bond angle.
Parameters:
 the desired angular change. This will be the actual change if there is no restraint or if the restraint is constant in this range.

REAL ObjCryst::Molecule::BondLengthRandomChange const StretchModeBondLength mode,
const REAL  amplitude,
const bool  respectRestraint = true
 

Stretch a bond, while respecting the Restraint (if any).

Returns:
the actual change in bond length.
Parameters:
 the desired change in bond length. This will be the actual change if there is no restraint or if the restraint is constant in this range.

void ObjCryst::Molecule::BuildConnectivityTable  )  const
 

Build the Connectivity table.

void ObjCryst::Molecule::BuildFlipGroup  ) 
 

Build the groups of atoms that can be flipped.

This is not const because we temporarily modify the molecule conformation to test which FlipGroups are forbidden by restraints (but it should be const).

void ObjCryst::Molecule::BuildRingList  ) 
 

Build the list of rings in the molecule.

The list is only rebuilt if the bond or atom list has changed,so it should be safe to call again this function.

Note:
So far this is a const method as the ring list just reflects the bond list and therefore is mutable (see Molecule::mvRing)... but maybe this could change...

void ObjCryst::Molecule::BuildRotorGroup  ) 
 

Build the groups of atoms that will be rotated during global optimization.

This is not const because we temporarily modify the molecule conformation to test which RotorGroups are forbidden by restraints (but it should be const).

void ObjCryst::Molecule::BuildStretchModeBondAngle  ) 
 

Build the groups of atoms moved when changing a bond angle, while respecting the Molecule restraints.

void ObjCryst::Molecule::BuildStretchModeBondLength  ) 
 

Build the groups of atoms moved when stretching a bond length, while respecting the Molecule restraints.

void ObjCryst::Molecule::BuildStretchModeGroups  ) 
 

Separate StretchMode that break more than their assigned restraint from others.

See Molecule::mvpStretchModeFree and Molecule::mvpStretchModeNotFree

void ObjCryst::Molecule::BuildStretchModeTorsion  ) 
 

Build the groups of atoms moved when changing a dihedral angle, while respecting the Molecule restraints.

void ObjCryst::Molecule::BuildStretchModeTwist  ) 
 

Build the groups of atoms used to twist internally the Molecule, e.g.

by rotating one chain of atoms between 2 given atoms.

virtual Molecule* ObjCryst::Molecule::CreateCopy  )  const [virtual]
 

For internal use only.

so-called Virtual copy constructor, needed to make copies of arrays of Scatterers

Implements ObjCryst::Scatterer.

REAL ObjCryst::Molecule::DihedralAngleRandomChange const StretchModeTorsion mode,
const REAL  amplitude,
const bool  respectRestraint = true
 

Change a dihedral angle, while respecting the Restraint (if any).

Returns:
the actual change in bond angle.
Parameters:
 the desired angular change. This will be the actual change if there is no restraint or if the restraint is constant in this range.

vector<MolAtom*>::const_reverse_iterator ObjCryst::Molecule::FindAtom const string &  name  )  const
 

Search a MolAtom from its name.

Search begins at the end, and the first match is returned. returns mvAtom.rend() if no atom matches

vector<MolAtom*>::reverse_iterator ObjCryst::Molecule::FindAtom const string &  name  ) 
 

Search a MolAtom from its name.

Search begins at the end, and the first match is returned. returns mvAtom.rend() if no atom matches

vector<MolBond*>::iterator ObjCryst::Molecule::FindBond const MolAtom ,
const MolAtom
 

Searches whether a bond between two atoms already exists.

If no bond is found, returns Molecule::mvpAtom.end().

vector<MolBond*>::const_iterator ObjCryst::Molecule::FindBond const MolAtom ,
const MolAtom
const
 

Searches whether a bond between two atoms already exists.

If no bond is found, returns Molecule::mvpAtom.end().

vector<MolBondAngle*>::const_iterator ObjCryst::Molecule::FindBondAngle const MolAtom at1,
const MolAtom at0,
const MolAtom at2
const
 

Searches whether a bond between three atoms already exists, searching for either (at1,at2,at3) and (at3,at2,at1), as these are equivalent.

If no bond angle is found, returns Molecule::mvpBondAngle.end().

vector<MolDihedralAngle*>::const_iterator ObjCryst::Molecule::FindDihedralAngle const MolAtom at1,
const MolAtom at2,
const MolAtom at3,
const MolAtom at4
const
 

Searches whether a dihedral between four atoms already exists, searching for either (at1,at2,at3,at4) and (at4,at3,at2,at1), as these are equivalent.

If no dihedral angle is found, returns Molecule::mvpDihedralAngle.end().

void ObjCryst::Molecule::FlipAtomGroup const FlipGroup  ) 
 

Flip a group of atom. See Molecule::FlipGroup.

const MolAtom& ObjCryst::Molecule::GetAtom const string &  name  )  const
 

MolAtom& ObjCryst::Molecule::GetAtom const string &  name  ) 
 

const MolAtom& ObjCryst::Molecule::GetAtom unsigned int  i  )  const
 

MolAtom& ObjCryst::Molecule::GetAtom unsigned int  i  ) 
 

vector<MolAtom*>& ObjCryst::Molecule::GetAtomList  ) 
 

const vector<MolAtom*>& ObjCryst::Molecule::GetAtomList  )  const
 

const RefinableObjClock& ObjCryst::Molecule::GetAtomPositionClock  )  const
 

Get the clock associated to the atomic positions.

RefinableObjClock& ObjCryst::Molecule::GetAtomPositionClock  ) 
 

Get the clock associated to the atomic positions.

vector<MolBondAngle*>& ObjCryst::Molecule::GetBondAngleList  ) 
 

const vector<MolBondAngle*>& ObjCryst::Molecule::GetBondAngleList  )  const
 

vector<MolBond*>& ObjCryst::Molecule::GetBondList  ) 
 

const vector<MolBond*>& ObjCryst::Molecule::GetBondList  )  const
 

const RefinableObjClock& ObjCryst::Molecule::GetBondListClock  )  const
 

get the clock associated to the list of bonds

RefinableObjClock& ObjCryst::Molecule::GetBondListClock  ) 
 

get the clock associated to the list of bonds

const MolAtom* ObjCryst::Molecule::GetCenterAtom  )  const
 

Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

virtual const string& ObjCryst::Molecule::GetClassName  )  const [virtual]
 

Name for this class ("RefinableObj", "Crystal",...).

This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry

Reimplemented from ObjCryst::Scatterer.

virtual string ObjCryst::Molecule::GetComponentName const int  i  )  const [virtual]
 

Name for the i-th component of this scatterer.

If the component is an Atom, Then the name is that of the atom. Else, it is the name of the scatterer plus the component number in the scatterer plus the name of the ScatteringPower.

Note:
It would be better to return a reference, but we don't want to keep a name for all components... Weeelll, needs some more thinking... see what performance hit results (if any).
Bug:
does not take into account dummy atoms !!

Implements ObjCryst::Scatterer.

const map<MolAtom *,set<MolAtom *> >& ObjCryst::Molecule::GetConnectivityTable  ) 
 

Get the connectivity table.

vector<MolDihedralAngle*>& ObjCryst::Molecule::GetDihedralAngleList  ) 
 

const vector<MolDihedralAngle*>& ObjCryst::Molecule::GetDihedralAngleList  )  const
 

virtual REAL ObjCryst::Molecule::GetLogLikelihood  )  const [virtual]
 

Get -log(likelihood) of the current configuration for the object.

By default (no likelihood evaluation available), this is equal to 0.

This call should not be recursive, it is the task of the algorithm to get the sum of likelihoods for all objects invlolved.

Note:
contrary to the old "Cost Function" approach, with log(Likelihood) there is no 'choice' of cost function, so that it is the task of the object to give the optimized likelihood (possibly with user options).
Warning:
: this is in under heavy development, so expect changes...

Reimplemented from ObjCryst::RefinableObj.

virtual int ObjCryst::Molecule::GetNbComponent  )  const [virtual]
 

Number of components in the scatterer (eg number of point scatterers).

Implements ObjCryst::Scatterer.

const RefinableObjClock& ObjCryst::Molecule::GetRigidGroupClock  )  const
 

Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified).

RefinableObjClock& ObjCryst::Molecule::GetRigidGroupClock  ) 
 

Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified).

std::vector<RigidGroup *>& ObjCryst::Molecule::GetRigidGroupList  ) 
 

List of rigid group of atoms.

See Molecule::mvRigidGroup

const std::vector<RigidGroup *>& ObjCryst::Molecule::GetRigidGroupList  )  const
 

List of rigid group of atoms.

See Molecule::mvRigidGroup

virtual const ScatteringComponentList& ObjCryst::Molecule::GetScatteringComponentList  )  const [virtual]
 

Get the list of all scattering components for this scatterer.

This is the most important function of this class, giving the list of scattering positions along with the associated ScatteringPower.

Implements ObjCryst::Scatterer.

const list<StretchModeBondAngle>& ObjCryst::Molecule::GetStretchModeBondAngleList  )  const
 

list<StretchModeBondAngle>& ObjCryst::Molecule::GetStretchModeBondAngleList  ) 
 

const list<StretchModeBondLength>& ObjCryst::Molecule::GetStretchModeBondLengthList  )  const
 

list<StretchModeBondLength>& ObjCryst::Molecule::GetStretchModeBondLengthList  ) 
 

const list<StretchModeTorsion>& ObjCryst::Molecule::GetStretchModeTorsionList  )  const
 

list<StretchModeTorsion>& ObjCryst::Molecule::GetStretchModeTorsionList  ) 
 

virtual void ObjCryst::Molecule::GLInitDisplayList const bool  onlyIndependentAtoms = false,
const REAL  xMin = -.1,
const REAL  xMax = 1.1,
const REAL  yMin = -.1,
const REAL  yMax = 1.1,
const REAL  zMin = -.1,
const REAL  zMax = 1.1,
const bool  displayEnantiomer = false,
const bool  displayNames = false
const [virtual]
 

For internal use only.

Create an OpenGL Display List of the scatterer. This should only be called by a Crystal object.

Parameters:
noSymmetrics: if false (the default), then all symmetrics are shown in the 3D display, within the limits defined by the min/max parameters \ param xMin,xMax,yMin,yMax,zMin,zMax: in fractionnal coordinates, the region in which we want scaterrer to be displayed. The test is made on the center of the scatterer (eg a ZScatterer (molecule) will not be 'cut' on the border).
displayNames: if true, only the names of the scatterers will be displayed, at the position of the scatterers (to actually see them, they will have to be translated with respect to the drawing of the scatterers).

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Molecule::GlobalOptRandomMove const REAL  mutationAmplitude,
const RefParType type
[virtual]
 

Make a random move of the current configuration.

This is for global optimization algorithms. the moves for each parameter are less than their global optimization step, multiplied by the mutation amplitude.

Warning:
: this makes a random move for the parameter declared for this object, and it is the duty of the object to decide whether the included objects should be moved and how. (eg an algorithm should only call for a move with the top object, and this object decides how he and his sub-objects moves). By default (RefinableObj implementation) all included objects are moved recursively.
RefinableObj::
Parameters:
mutationAmplitude: multiplier for the maximum move amplitude, for all parameters
type: restrain the change exclusively to parameters of a given type (same type or descendant from this RefParType).

Reimplemented from ObjCryst::RefinableObj.

void ObjCryst::Molecule::InitOptions  ) 
 

Build options for this object.

virtual void ObjCryst::Molecule::InitRefParList  )  [virtual]
 

Prepare refinable parameters for the scatterer object.

Implements ObjCryst::Scatterer.

void ObjCryst::Molecule::OptimizeConformation const long  nbTrial = 10000,
const REAL  stopCost = 0.
 

Minimize configuration from internal restraints (bond lengths, angles and dihedral angles).

Useful when adding manually atoms to get an initial reasonable configuration.

virtual ostream& ObjCryst::Molecule::POVRayDescription ostream &  os,
const CrystalPOVRayOptions options
const [virtual]
 

For internal use only.

Output a description of the scatterer for POVRay. This should only be called by the Crystal Object to which belongs this scatterer.

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Molecule::Print  )  const [virtual]
 

Print some info about the scatterer (ideally this should be one line...).

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Molecule::RandomizeConfiguration  )  [virtual]
 

Randomize Configuration (before a global optimization).

This Affects only parameters which are limited and not fixed. The randomization also affects all sub-objects (recursive).

Reimplemented from ObjCryst::RefinableObj.

vector<MolAtom*>::iterator ObjCryst::Molecule::RemoveAtom MolAtom  ) 
 

Remove an atom.

Returns the iterator to the next atom in the list.

This also removes all corresponding bonds, bond angles, etc...

vector<MolBond*>::iterator ObjCryst::Molecule::RemoveBond const MolBond  ) 
 

Remove a bond.

Returns the iterator to the next bond in the list.

vector<MolBondAngle*>::iterator ObjCryst::Molecule::RemoveBondAngle const MolBondAngle  ) 
 

Remove a BondAngle.

vector<MolDihedralAngle*>::iterator ObjCryst::Molecule::RemoveDihedralAngle const MolDihedralAngle  ) 
 

Remove a dihedral angle.

std::vector<RigidGroup*>::iterator ObjCryst::Molecule::RemoveRigidGroup const RigidGroup group,
const bool  updateDisplay = true
 

Remove a rigid group of atoms.

See Molecule::mvRigidGroup

void ObjCryst::Molecule::RestraintStatus ostream &  os  )  const
 

Print the status of all restraints (bond length, angles...).

void ObjCryst::Molecule::RigidifyWithDihedralAngles  ) 
 

Add dihedral angles so as to rigidify the Molecule.

In practice, for every sequence of atoms A-B-C-D, add the dihedral angle defined by these 4 atoms, unless either ABC or BCD are aligned (angle below 10°).

No duplicate dihedral angle is generated.

void ObjCryst::Molecule::RotateAtomGroup const MolAtom at,
const REAL  vx,
const REAL  vy,
const REAL  vz,
const set< MolAtom * > &  atoms,
const REAL  angle,
const bool  keepCenter = true
 

Rotate a group of atoms around an axis defined by one atom and a vector.

Parameters:
keepCenter: if true, the coordinates of the molecule are modified so that only the rotated atoms are moved.

void ObjCryst::Molecule::RotateAtomGroup const MolAtom at1,
const MolAtom at2,
const set< MolAtom * > &  atoms,
const REAL  angle,
const bool  keepCenter = true
 

Rotate a group of atoms around an axis defined by two atoms.

Parameters:
keepCenter: if true, the coordinates of the molecule are modified so that only the rotated atoms are moved.

void ObjCryst::Molecule::SetCenterAtom const MolAtom at  ) 
 

Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

virtual void ObjCryst::Molecule::TagNewBestConfig  )  const [virtual]
 

During a global optimization, tells the object that the current config is the latest "best" config.

This can be used by the object to make more intellingent random moves (use with caution: highly experimental !).

Reimplemented from ObjCryst::RefinableObj.

void ObjCryst::Molecule::TranslateAtomGroup const set< MolAtom * > &  atoms,
const REAL  dx,
const REAL  dy,
const REAL  dz,
const bool  keepCenter = true
 

Translate a group of atoms in a given direction.

Parameters:
keepCenter: if true, the coordinates of the molecule are modified so that only the translated atoms are moved.

void ObjCryst::Molecule::TuneGlobalOptimRotationAmplitude  ) 
 

Tune the rotation amplitude for free torsions and for the overall Molecule Rotation.

This should be done after Molecule::BuildRotorGroup();

void ObjCryst::Molecule::UpdateScattCompList  )  const
 

Update the Molecule::mScattCompList from the cartesian coordinates of all atoms, and the orientation parameters.

virtual void ObjCryst::Molecule::XMLInput istream &  is,
const XMLCrystTag tag
[virtual]
 

Input From stream.

Todo:
Add an bool XMLInputTag(is,tag) function to recognize all the tags from the stream. So that each inherited class can use the XMLInputTag function from its parent (ie take advantage of inheritance). The children class would first try to interpret the tag, then if unsuccessful would pass it to its parent (thus allowing overloading), etc...

Reimplemented from ObjCryst::RefinableObj.

virtual void ObjCryst::Molecule::XMLOutput ostream &  os,
int  indent = 0
const [virtual]
 

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Reimplemented from ObjCryst::RefinableObj.


Member Data Documentation

std::vector<MolZAtom> ObjCryst::Molecule::mAsZMatrix [mutable]
 

The Molecule, as a lightweight ZMatrix, for export purposes.

RefObjOpt ObjCryst::Molecule::mAutoOptimizeConformation
 

Option to automatically optimize the starting conformation, if the total restraint cost is too high.

This is done in BeginOptimization().

This is enabled by default, and should be disabled by people who already supply a good starting conformation for their molecule.

REAL ObjCryst::Molecule::mBaseRotationAmplitude
 

Base Rotation amplitude (in radians) for the Molecule, so that the average atomic displacement is equal to 0.1 A.

Default=0.02*pi

RefinableObjClock ObjCryst::Molecule::mClockAtomList
 

RefinableObjClock ObjCryst::Molecule::mClockAtomPosition
 

RefinableObjClock ObjCryst::Molecule::mClockAtomScattPow
 

RefinableObjClock ObjCryst::Molecule::mClockBondAngleList
 

RefinableObjClock ObjCryst::Molecule::mClockBondList
 

RefinableObjClock ObjCryst::Molecule::mClockConnectivityTable [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockDihedralAngleList
 

RefinableObjClock ObjCryst::Molecule::mClockFlipGroup [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockLogLikelihood [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockOrientation
 

RefinableObjClock ObjCryst::Molecule::mClockRigidGroup
 

RefinableObjClock ObjCryst::Molecule::mClockRingList [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockRotorGroup [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockStretchModeBondAngle [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockStretchModeBondLength [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockStretchModeTorsion [mutable]
 

RefinableObjClock ObjCryst::Molecule::mClockStretchModeTwist [mutable]
 

map<MolAtom *,set<MolAtom *> > ObjCryst::Molecule::mConnectivityTable [mutable]
 

Connectivity table: for each atom, keep the list of atoms bonded to it.

All atoms are referenced from their index.

RefObjOpt ObjCryst::Molecule::mFlexModel
 

OPtion for the different types of flexibility possible for this molecule: rigid body, free atoms + restraints, torsion angles...

Warning:
still EXPERIMENTAL !

bool ObjCryst::Molecule::mIsSelfOptimizing
 

REAL ObjCryst::Molecule::mLastLogLike
 

unsigned long ObjCryst::Molecule::mLocalParamSet
 

REAL ObjCryst::Molecule::mLogLikelihood [mutable]
 

The current log(likelihood).

RefObjOpt ObjCryst::Molecule::mMoleculeCenter
 

Option to choose the center of rotation of the Molecule for the global orientation either as the geometrical center, or as a given atom.

RefObjOpt ObjCryst::Molecule::mOptimizeOrientation
 

Option to optimize the Molecule's orientation.

Useful to completely fix the Molecule.

const MolAtom* ObjCryst::Molecule::mpCenterAtom
 

Atom chosen as center of rotation, if mRotationCenter is set to use an atom rather than the geometrical center.

Quaternion ObjCryst::Molecule::mQuat
 

The unit quaternion defining the orientation.

unsigned long ObjCryst::Molecule::mRandomConformChangeNbAccept [mutable]
 

unsigned long ObjCryst::Molecule::mRandomConformChangeNbTest [mutable]
 

REAL ObjCryst::Molecule::mRandomConformChangeTemp [mutable]
 

ScatteringComponentList ObjCryst::Molecule::mScattCompList [mutable]
 

The list of scattering components.

this is mutable since it only reflects the list of atoms.

map<MolAtom* , std::vector<MolBond*> > ObjCryst::Molecule::mvAtomBond
 

List of Bonds for each atom.

This duplicates the information in Molecule::mvBond

list<FlipGroup> ObjCryst::Molecule::mvFlipGroup [mutable]
 

The list of FlipGroups.

vector<MolAtom*> ObjCryst::Molecule::mvpAtom
 

The list of atoms.

vector<MolBond*> ObjCryst::Molecule::mvpBond
 

The list of bonds.

vector<MolBondAngle*> ObjCryst::Molecule::mvpBondAngle
 

The list of bond angles.

vector<MolDihedralAngle*> ObjCryst::Molecule::mvpDihedralAngle
 

The list of dihedral angles.

std::list<StretchMode*> ObjCryst::Molecule::mvpStretchModeFree [mutable]
 

Groups of StretchMode not breaking any restraint (unless the one they are associated to).

std::list<StretchMode*> ObjCryst::Molecule::mvpStretchModeNotFree [mutable]
 

Groups of StretchMode breaking restraints (beyond the one they are associated to).

std::vector<RigidGroup*> ObjCryst::Molecule::mvRigidGroup
 

Rigid groups of atoms.

This group will be kept strictly rigid, preventing the use of any stretch mode altering their relative position. The entire group of atoms can however be rotated or translated.

list<MolRing> ObjCryst::Molecule::mvRing [mutable]
 

The list of rings.

Note:
this only reflects the bond list, so it is mutable.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupInternal [mutable]
 

List of RotorGroups for internal rotations.

This lists groups of atoms that can be rotated between two given atoms. This is useful to alter the conformation of large rings, where no free torsion bonds exists, and also for long flexible chains.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupTorsion [mutable]
 

List of RotorGroups corresponding to free torsion bonds.

In this list are list of atoms on one side of a bond, that can be rotated freely around this bond. Each bond is listed only once, with the side which has the smallest number of atoms.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupTorsionSingleChain [mutable]
 

List of RotorGroups corresponding to free torsion bonds, but with only one chain of atoms listed.

The difference with Molecule::mRotorGroupTorsion is that if the bond is A-B, with atom A linked with atoms A1,A2,A3, in this list only one chain (starting either from A1, A2 or A3) will be rotated, instead of the 3 chains. This is useful when searching for the absolute configuration of atoms.

list<StretchModeBondAngle> ObjCryst::Molecule::mvStretchModeBondAngle [mutable]
 

List of StretchModeBondLength.

list<StretchModeBondLength> ObjCryst::Molecule::mvStretchModeBondLength [mutable]
 

List of StretchModeBondLength.

list<StretchModeTorsion> ObjCryst::Molecule::mvStretchModeTorsion [mutable]
 

List of StretchModeBondLength.

list<StretchModeTwist> ObjCryst::Molecule::mvStretchModeTwist [mutable]
 

List of StretchModeTwist.


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:04:16 2006 for ObjCryst++ by doxygen 1.3.6