Loading...
Searching...
No Matches
OBSquarePlanarStereo Class Reference
Stereochemistry

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

Inheritance diagram for OBSquarePlanarStereo:
[legend]

## Classes

struct | Config

## Public Member Functions

| OBSquarePlanarStereo (OBMol *mol)
virtual | ~OBSquarePlanarStereo ()
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
SquarePlanar stereochemistry
OBStereo::Type | GetType () const
bool | IsValid () const
void | SetConfig (const Config &config)
Config | GetConfig (OBStereo::Shape shape=OBStereo::ShapeU) const
Config | GetConfig (unsigned long start, OBStereo::Shape shape=OBStereo::ShapeU) const
bool | operator== (const OBSquarePlanarStereo &other) const
bool | operator!= (const OBSquarePlanarStereo &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 start, OBStereo::Shape shape=OBStereo::ShapeU)

## Protected Attributes

std::string | _attr
unsigned int | _type
DataOrigin | _source

## Query methods to compare stereochemistry.

bool | IsTrans (unsigned long id1, unsigned long id2) const
bool | IsCis (unsigned long id1, unsigned long id2) const
unsigned long | GetTransRef (unsigned long id) const
std::vector< unsigned long > | GetCisRefs (unsigned long id) const

## Detailed Description

Class for handling and storing square planar stereochemistry.

The OBSquarePlanarStereo class is used to represent square planar stereochemistry. Like all OBTetraPlanarStereo subclasses, it uses the OBStereo::Shape parameters to set/get the reference ids.

This class works with reference ids only, it never uses the molecule to get more information. Like all stereo classes, errors, warnings or info is reported using OBMessageHandler.

## Constructor & Destructor Documentation

## OBSquarePlanarStereo()

OBSquarePlanarStereo | ( | OBMol * | mol | ) |

Constructor.

Referenced by operator!=(), and operator==().

## ~OBSquarePlanarStereo()

virtual ~OBSquarePlanarStereo | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## GetType()

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

inline virtual

Get the OBStereo::Type for this object.

Returns
  OBStereo::SquarePlanar

Implements OBStereoBase.

## IsValid()

bool IsValid | ( |  | ) | const

Returns
  True if this object is valid. This object is valid if all (center and and 4 reference) atom ids are set.

## SetConfig()

void SetConfig | ( | const Config & | config | ) |

Set the configuration using a Config struct.

## GetConfig() [1/2]

Config GetConfig | ( | OBStereo::Shape | shape = OBStereo::ShapeU | ) | const

Get the configuration as Config struct.

## GetConfig() [2/2]

Config GetConfig | ( | unsigned long | start,
|  | OBStereo::Shape | shape = OBStereo::ShapeU ) const

Get the configuration as Config struct and ensure refs[0] is equal to `start`.

## operator==()

bool operator== | ( | const OBSquarePlanarStereo & | other | ) | const

Compare the stereochemistry stored in the Config struct with the stereochemistry specified in the Config struct from `other`.

Equal to operator. Comparing OBSquarePlanarStereo::Config structs is done using the information stored in the struct's data members (i.e. center, refs and shape).

There are a number of cases resuling in false being returned:

- `center` atom ids don't match
- One of the Refs lists does not contain 4 elements.
- 2 or more OBStereo::ImplicitRef values in a single Config struct
- (The two `refs` don't share a single common element)

In the simplest case where both `refs` contain exactly the same elements (OBStereo::ContainsSameRefs()), coould include OBStereo::ImplicitRef), both Config struct are normalized to OBStereo::ShapeU starting with the same element. After this normalization, there are two possible orientations to overlay the shape on the double bond. From the illustration below, it can be seen only `refs`[2] has to be checked in order to conclude both Config structs have the same stereochemistry.

     1   4    1      4    1------4
      \ /     |      |           |
       C      |      |           |
      / \     |      |           |
     2   3    2------3    2------3

              1 2 3 4     1 2 3 4
              |   |       |   |      <- in any case, refs[0] & refs[2] remain unchanged
              1 2 3 4     1 4 3 2

When comparing a Config struct with explicit hydrogen(s) to one with implicit hydrogen(s), both `refs` are also normalized to OBStereo::ShapeU starting with the same common element. This shared element cannot be OBStereo::ImplicitRef. Depending on the position of the OBStereo::ImplicitRef element(s) in the `refs`, 3 cases are possible:

     refs[2] != OBStereo::ImplicitId:

       (analog to the case above where they contained the same elements )

       1 2 3 4
       |   |      <- refs[0] & refs[2] remain unchanged
       1 H 3 H

     else:

       1 2 3 4
       |     |    <- refs[0] & refs[3] remain unchanged
       1 H H 4

       1 2 3 4
       | |        <- refs[0] & refs[1] remain unchanged
       1 2 H H

In each case, the orientation of the U shape is also defined since there can be only one OBStereo::ImplicitRef for each side of the double bond.

Returns
  True if both Config structs represent the stereochemistry.

## operator!=()

bool operator!= | ( | const OBSquarePlanarStereo & | other | ) | const

inline

Not equal to operator. This is the inverse of the Equal to operator==.

Returns
  True if the two Config structs represent a different stereochemistry.

## Clone()

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

virtual

Reimplemented from OBGenericData.

## IsTrans()

bool IsTrans | ( | unsigned long | id1,
|  | unsigned long | id2 ) const

Returns
  True if the two reference ids are placed trans configuration.

## IsCis()

bool IsCis | ( | unsigned long | id1,
|  | unsigned long | id2 ) const

Returns
  True if the two reference ids are placed in a cis configuration.

## GetTransRef()

unsigned long GetTransRef | ( | unsigned long | id | ) | const

Get the reference id trans from reference `id`.

## GetCisRefs()

std::vector< unsigned long > GetCisRefs | ( | unsigned long | id | ) | const

Get the reference id cis from reference `id`.

## ToConfig()

template<typename ConfigType>

ConfigType ToConfig | ( | const ConfigType & | cfg,
|  | unsigned long | start,
|  | OBStereo::Shape | shape = OBStereo::ShapeU )

inline static inherited

Referenced by OBCisTransConfig::operator==(), and OBSquarePlanarConfig::operator==().

## GetMolecule()

OBMol * GetMolecule | ( |  | ) | const

inline inherited

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

## 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.

## 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:

- squareplanar.h