Open Babel
3.0
|
#include <openbabel/stereo/tetrahedral.h>
Classes | |
struct | Config |
Public Member Functions | |
OBTetrahedralStereo (OBMol *mol) | |
virtual | ~OBTetrahedralStereo () |
OBGenericData * | Clone (OBBase *mol) const |
void | SetAttribute (const std::string &v) |
void | SetOrigin (const DataOrigin s) |
virtual const std::string & | GetAttribute () const |
unsigned int | GetDataType () const |
virtual const std::string & | GetValue () const |
virtual DataOrigin | GetOrigin () const |
Tetrahedral stereochemistry | |
OBStereo::Type | GetType () const |
bool | IsValid () const |
void | SetConfig (const Config &config) |
Config | GetConfig (OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) const |
Config | GetConfig (unsigned long from_or_towards, OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) const |
bool | operator== (const OBTetrahedralStereo &other) const |
bool | operator!= (const OBTetrahedralStereo &other) const |
Geniric (for all OBStereo::Type) stereochemistry | |
OBMol * | GetMolecule () const |
void | SetSpecified (bool specified) |
bool | IsSpecified () const |
Static Public Member Functions | |
template<typename ConfigType > | |
static ConfigType | ToConfig (const ConfigType &cfg, unsigned long from_or_towards, OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) |
template<typename ConfigType > | |
static void | ChangeWinding (ConfigType &cfg) |
template<typename ConfigType > | |
static void | ChangeView (ConfigType &cfg) |
template<typename ConfigType > | |
static void | Invert (ConfigType &cfg) |
Protected Attributes | |
std::string | _attr |
unsigned int | _type |
DataOrigin | _source |
Class for handling and storing tetrahedral atom stereochemistry.
The OBTetrahedralStereo class is used to represent tetrahedral atom stereo chemistry. Before continuing reading, it is recommeded to read the OBTetraNonPlanar documentation first. Since this class inherits OBTetraNonPlanerStereo it should be clear that the class stores the spacial arrangement of 4 non-planer atoms. However, for the tetrahedral case, one additional OBStereo::Ref is needed: the atom id for the center atom.
The stereochemistry is set, retrieved and internally stored using the OBTetrahedralStereo::Config struct. OBTetrahedralStereo functions as a wrapper around the Config struct and provides functions to get a copy of the Config struct converted to any view direction or atom and winding (OBTetrahedralStereo::GetConfig).
Like all stereo classes, errors, warnings or info is reported using OBMessageHandler.
OBTetrahedralStereo | ( | OBMol * | mol | ) |
Constructor.
|
virtual |
Destructor.
|
inlinevirtual |
bool IsValid | ( | ) | const |
Referenced by OpenBabel::CanonicalLabels().
void SetConfig | ( | const Config & | config | ) |
Set the configuration using a Config struct.
Referenced by OpenBabel::CanonicalLabels(), OBMol::CopySubstructure(), and OBMol::operator+=().
Config GetConfig | ( | OBStereo::Winding | winding = OBStereo::Clockwise , |
OBStereo::View | view = OBStereo::ViewFrom |
||
) | const |
Get the configuration as Config struct.
Referenced by OpenBabel::CanonicalLabels(), OBMol::CopySubstructure(), OBBuilder::CorrectStereoAtoms(), OpenBabel::DeleteStereoOnAtom(), OpenBabel::findMetalloceneBonds(), OBSmartsMatcher::match(), and OBMol::operator+=().
Config GetConfig | ( | unsigned long | from_or_towards, |
OBStereo::Winding | winding = OBStereo::Clockwise , |
||
OBStereo::View | view = OBStereo::ViewFrom |
||
) | const |
Get the configuration as Config struct viewing from/towards the specified id.
bool operator== | ( | const OBTetrahedralStereo & | other | ) | const |
Compare the stereochemistry stored in the Config struct with the stereochemistry specified in the Config struct from other
.
Equal to operator. Comparing OBTetrahedralStereo::Config structs is done using the information stored in the struct's data members (i.e. view
, winding
, from/towards
and refs
).
There are a number of cases resuling in false being returned:
When either Config struct is unspecified (i.e. the stereochemistry implied is accidental), true is returned.
It doesn't matter if the two Config structs use the same view, same from/towards Ref or the same winding. All needed conversions will be carried out automatically (see OBTetraNonPlanerStereo::ToConfig). These conversions ensure the spacial orientation of the 4 groups remains unchanged.
Another key feature is the ability to comapre Config structs regardless of implicit (OBStereo::ImplicitRef) or explicit hydrogens. This is best illustrated with some examples. In these examples the same ref has already been selected as from/towards atom and both use the same winding and view direction. We will focus on how the three remaining refs are interpreted.
234 == 234 // true 2H4 == 234 // 3 is missing, must be the implicit --> 234 == 234 // true 2H4 == 243 // same as above, but now 234 == 243 // false 234 == H34 // 2 is missing, must be implicit --> 234 == 234 // true
By comparing the second and third example above, it can be clearly seen that the value of 1 Ref can actually be ignored. It's position in the sequence (or the winding) is defined by the two explicit Ref values.
|
inline |
Not equal to operator. This is the inverse of the Equal to operator==.
|
virtual |
Reimplemented from OBGenericData.
|
inlinestaticinherited |
Convert a ConfigType
struct from any View/Winding to the desired representation.
This is a template method which works on ConfigType structs from OBTetraNonPlanar subclasses. The subclasses can decide what data member are needed to store the stereogenic unit (i.e. 1 atom for tetrahedral, 3 for allene like, ...) and still use this generic method to handle the real stereochemistry.
A ConfigType struct should at least have the following data members:
cfg | A ConfigType struct from a OBTetraNonPlanar subclass. |
from_or_towards | The desired from/towards reference id (see view ) |
winding | The desired winding. |
view | The desired viewing direction. |
Referenced by OBTetrahedralConfig::operator==().
|
inlinestaticinherited |
Change the winding of the ConfigType struct while maintaining the stereochemistry.
|
inlinestaticinherited |
Change the view of the ConfigType struct while maintaining the stereochemistry.
|
inlinestaticinherited |
Invert the stereochemistry of the ConfigType struct.
|
inlineinherited |
Get the molecule. This can be used by subclasses when more information is needed (e.g. OBCisTransStereo::GetCisRef, ...).
|
inlineinherited |
Set whether the stereochemistry is specified. Comparing a specified OBStereoBase derived class (or it's Config struct) with an unspecified one, always returns true.
|
inlineinherited |
|
inlineinherited |
Set the attribute (key), which can be used to retrieve this data.
Referenced by OBGastChrg::AssignPartialCharges(), OpenBabel::ComparePairSecond(), OBMol::DoTransformations(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
|
inlineinherited |
Set the origin of this data, which can be used to filter the data.
Referenced by OBGastChrg::AssignPartialCharges(), OpenBabel::ComparePairSecond(), OBMol::DoTransformations(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
|
inlinevirtualinherited |
Referenced by OpenBabel::extract_thermochemistry(), and OBMoleculeFormat::MakeCombinedMolecule().
|
inlineinherited |
|
inlinevirtualinherited |
Base class returns a default value (the attribute type) but should never be called.
Reimplemented in OBPairData, and OBCommentData.
Referenced by OBDepict::AddAtomLabels(), OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().
|
inlinevirtualinherited |
|
protectedinherited |
attribute tag (e.g., "UnitCell", "Comment" or "Author")
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
|
protectedinherited |
attribute type – declared for each subclass
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
|
protectedinherited |
source of data for accounting
Referenced by OBConformerData::operator=(), OBSymmetryData::operator=(), OBTorsionData::operator=(), and OBAngleData::operator=().