Loading...
Searching...
No Matches
OBTetraNonPlanarStereo Class Referenceabstract
Stereochemistry

`#include <openbabel/stereo/tetranonplanar.h>`

Inheritance diagram for OBTetraNonPlanarStereo:
[legend]

## Public Member Functions

| OBTetraNonPlanarStereo (OBMol *mol)
virtual | ~OBTetraNonPlanarStereo ()
virtual OBGenericData * | Clone (OBBase *) 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
Geniric (for all OBStereo::Type) stereochemistry
OBMol * | GetMolecule () const
virtual OBStereo::Type | GetType () const =0
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

## Detailed Description

Base class for handling and storing non-planar stereochemistry with 4 reference atom ids.

# Combinations

The four reference ids can be treated like a sequence of 4 numbers. Each element can only occur once. This means there are 4! = 24 combinations.

These are the 24 possible combinations or permutations.

1234 2134 3124 4123
1243 2143 3142 4132
1324 2314 3214 4213
1342 2341 3241 4231
1423 2413 3412 4312
1432 2431 3421 4321

However, when dealing with tetrahedral stereochemistry, it is often easier to visualize by viewing from/towards one of the reference atoms to/from the center atom. This reduces the 24 possible combinations to 3! = 6.

123 321
231 213
312 132

These can be devided in 2 groups: clockwise or anti-clockwise

clockwise: 123, 231, 312
anti-clockwise: 321, 213, 132

Since subclass ConfigType structs accept refs viewing from/towards any atom, it is needed to have some rules for converting.

A single permutation of two consecutive elements in a sequence of 3 changes the winding. All permutations can be expressed as a combination of consecutive permutations. The number of consecutive permutations can be calculated from the difference in inversions (NumInversions()).

If we exchange the from atom with another atom in the sequence, the oddness of the difference in inversions between the 2 sequences is calculated. If this is even, no extra permutation is needed. If this is odd, an extra permutation is needed.

Switching between viewing from and viewing towards reverses the winding.

Like all stereo classes, errors, warnings or info is reported using OBMessageHandler.

Since
  version 2.3

## Constructor & Destructor Documentation

## OBTetraNonPlanarStereo()

OBTetraNonPlanarStereo | ( | OBMol * | mol | ) |

Constructor

Parameters

  mol | The molecule.

## ~OBTetraNonPlanarStereo()

virtual ~OBTetraNonPlanarStereo | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## ToConfig()

template<typename ConfigType>

ConfigType ToConfig | ( | const ConfigType & | cfg,
|  | unsigned long | from_or_towards,
|  | OBStereo::Winding | winding = OBStereo::Clockwise,
|  | OBStereo::View | view = OBStereo::ViewFrom )

inline static

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:

class SomeNonPlanarStereo : public TetraNonPlanarStereo
{
public:
struct Config
{
// constructor(s) are recommended!
// subclass specific stereogenic unit
...
union {
unsigned long from;
unsigned long towards;
};
OBStereo::Refs refs;
OBStereo::Winding winding;
OBStereo::View view;
};
};
OpenBabel::OBStereo::Refs
std::vector< Ref > Refs
Definition stereo.h:156
OpenBabel::OBStereo::Winding
Winding
Definition stereo.h:130
OpenBabel::OBStereo::View
View
Definition stereo.h:120

Parameters

  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.

Returns
  The ConfigType struct with desired from/towards, winding and view.

Referenced by OBTetrahedralConfig::operator==().

## ChangeWinding()

template<typename ConfigType>

void ChangeWinding | ( | ConfigType & | cfg | ) |

inline static

Change the winding of the ConfigType struct while maintaining the stereochemistry.

## ChangeView()

template<typename ConfigType>

void ChangeView | ( | ConfigType & | cfg | ) |

inline static

Change the view of the ConfigType struct while maintaining the stereochemistry.

## Invert()

template<typename ConfigType>

void Invert | ( | ConfigType & | cfg | ) |

inline static

Invert the stereochemistry of the ConfigType struct.

## GetMolecule()

OBMol * GetMolecule | ( |  | ) | const

inline inherited

Get the molecule. This can be used by subclasses when more information is needed (e.g. OBCisTransStereo::GetCisRef, ...).

## GetType()

virtual OBStereo::Type GetType | ( |  | ) | const

pure virtual inherited

Reimplemented by subclasses to return the type defined in OBStereo::Type.

Implemented in OBCisTransStereo, OBSquarePlanarStereo, and OBTetrahedralStereo.

Referenced by OBMol::CopySubstructure().

## SetSpecified()

void SetSpecified | ( | bool | specified | ) |

inline inherited

Set whether the stereochemistry is specified. Comparing a specified OBStereoBase derived class (or it's Config struct) with an unspecified one, always returns true.

## IsSpecified()

bool IsSpecified | ( |  | ) | const

inline inherited

Returns
  True if the stereochemistry is specified.

## Clone()

virtual OBGenericData * Clone | ( | OBBase * |  | ) | const

inline virtual inherited

Reimplemented in AliasData, OBAngleData, OBCisTransStereo, OBCommentData, OBConformerData, OBDOSData, OBElectronicTransitionData, OBExternalBondData, OBMatrixData, OBNasaThermoData, OBOrbitalData, OBPairData, OBPairTemplate< ValueT >, OBPairTemplate< bool >, OBPairTemplate< double >, OBPairTemplate< int >, OBRateData, OBRingData, OBRotamerList, OBRotationData, OBSerialNums, OBSetData, OBSquarePlanarStereo, OBSymmetryData, OBTetrahedralStereo, OBTorsionData, OBUnitCell, OBVectorData, OBVibrationData, and OBVirtualBond.

Referenced by OBBase::CloneData(), OBAtom::Duplicate(), OBMoleculeFormat::MakeCombinedMolecule(), and OBMol::operator=().

## SetAttribute()

void SetAttribute | ( | const std::string & | v | ) |

inline inherited

Set the attribute (key), which can be used to retrieve this data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), AliasData::Expand(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## SetOrigin()

void SetOrigin | ( | const DataOrigin | s | ) |

inline inherited

Set the origin of this data, which can be used to filter the data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## GetAttribute()

virtual const std::string & GetAttribute | ( |  | ) | const

inline virtual inherited

Returns
  The attribute (key), which can be used to retrieve this data

Referenced by OBMoleculeFormat::MakeCombinedMolecule().

## GetDataType()

unsigned int GetDataType | ( |  | ) | const

inline inherited

Returns
  the data type for this object as defined in OBGenericDataType

## GetValue()

virtual const std::string & GetValue | ( |  | ) | const

inline virtual inherited

Base class returns a default value (the attribute type) but should never be called.

Reimplemented in OBCommentData, and OBPairData.

Referenced by OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().

## GetOrigin()

virtual DataOrigin GetOrigin | ( |  | ) | const

inline virtual inherited

## Member Data Documentation

## _attr

std::string _attr

protected inherited

attribute tag (e.g., "UnitCell", "Comment" or "Author")

Referenced by OBRotamerList::Clone(), GetAttribute(), GetValue(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), OBSymmetryData::OBSymmetryData(), and SetAttribute().

## _type

unsigned int _type

protected inherited

attribute type – declared for each subclass

Referenced by OBRotamerList::Clone(), GetDataType(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), and OBSymmetryData::OBSymmetryData().

## _source

DataOrigin _source

protected inherited

source of data for accounting

Referenced by GetOrigin(), OBGenericData(), OBSymmetryData::OBSymmetryData(), OBAngleData::operator=(), OBConformerData::operator=(), OBSymmetryData::operator=(), OBTorsionData::operator=(), and SetOrigin().

The documentation for this class was generated from the following file:

- tetranonplanar.h