RDKit: RDKit::SubstanceGroup Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
RDKit::SubstanceGroup Class Reference

The class for representing SubstanceGroups. More...

`#include <SubstanceGroup.h>`

Inheritance diagram for RDKit::SubstanceGroup:

## Classes
struct | AttachPoint
struct | CState

## Public Types
enum class | BondType { XBOND , CBOND }
| Bond type (see V3000 spec) More...
typedef std::array< RDGeom::Point3D, 3 > | Bracket

## Public Member Functions
| SubstanceGroup ()=delete
| No default constructor.
| SubstanceGroup (ROMol *owning_mol, const std::string &type)
| SubstanceGroup (const SubstanceGroup &other)=default
SubstanceGroup & | operator= (const SubstanceGroup &other)=default
| SubstanceGroup (SubstanceGroup &&other) noexcept
SubstanceGroup & | operator= (SubstanceGroup &&other) noexcept
| ~SubstanceGroup ()=default
| Destructor.
bool | hasOwningMol () const
| returns whether or not this belongs to a molecule
ROMol & | getOwningMol () const
| Get the molecule that owns this instance.
bool | getIsValid () const
void | setIsValid (bool isValid)
| set whether or not this group is valid; invalid groups must be ignored.
unsigned int | getIndexInMol () const
void | addAtomWithIdx (unsigned int idx)
void | addParentAtomWithIdx (unsigned int idx)
void | addBondWithIdx (unsigned int idx)
void | addAtomWithBookmark (int mark)
void | addParentAtomWithBookmark (int mark)
void | addBondWithBookmark (int mark)
void | removeAtomWithIdx (unsigned int idx)
void | removeParentAtomWithIdx (unsigned int idx)
void | removeBondWithIdx (unsigned int idx)
void | addBracket (const Bracket &bracket)
void | addCState (unsigned int bondIdx, const RDGeom::Point3D &vector)
void | addAttachPoint (unsigned int aIdx, int lvIdx, const std::string &idStr)
BondType | getBondType (unsigned int bondIdx) const
const std::vector< unsigned int > & | getAtoms () const
const std::vector< unsigned int > & | getParentAtoms () const
const std::vector< unsigned int > & | getBonds () const
void | setAtoms (std::vector< unsigned int > atoms)
void | setParentAtoms (std::vector< unsigned int > patoms)
void | setBonds (std::vector< unsigned int > bonds)
const std::vector< Bracket > & | getBrackets () const
const std::vector< CState > & | getCStates () const
const std::vector< AttachPoint > & | getAttachPoints () const
std::vector< Bracket > & | getBrackets ()
std::vector< CState > & | getCStates ()
std::vector< AttachPoint > & | getAttachPoints ()
void | clearBrackets ()
void | clearCStates ()
void | clearAttachPoints ()
bool | adjustToRemovedAtom (unsigned int atomIdx)
bool | includesAtom (unsigned int atomIdx) const
bool | adjustToRemovedBond (unsigned int bondIdx)
bool | includesBond (unsigned int bondIdx) const
void | setOwningMol (ROMol *mol)
bool | operator== (const SubstanceGroup &other) const
Public Member Functions inherited from RDKit::RDProps
| RDProps ()
| RDProps (const RDProps &rhs)
RDProps & | operator= (const RDProps &rhs)
| RDProps (RDProps &&o) noexcept=default
RDProps & | operator= (RDProps &&rhs) noexcept=default
void | clear ()
const Dict & | getDict () const
| gets the underlying Dictionary
Dict & | getDict ()
STR_VECT | getPropList (bool includePrivate=true, bool includeComputed=true) const
| returns a list with the names of our `properties`
template<typename T>
void | setProp (const std::string &key, T val, bool computed=false) const
| sets a `property` value
template<typename T>
void | getProp (const std::string &key, T &res) const
| allows retrieval of a particular property value
template<typename T>
T | getProp (const std::string &key) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
bool | getPropIfPresent (const std::string &key, T &res) const
bool | hasProp (const std::string &key) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void | clearProp (const std::string &key) const
| clears the value of a `property`
void | clearComputedProps () const
| clears all of our `computed` `properties`
void | updateProps (const RDProps &source, bool preserveExisting=false)
| update the properties from another

## Additional Inherited Members
Protected Attributes inherited from RDKit::RDProps
Dict | d_props

## Detailed Description

The class for representing SubstanceGroups.

Notes:

- These are inspired by the SGroups in the MDL formats
- Implementation is based on 2010 MDL SD specification: http://infochim.u-strasbg.fr/recherche/Download/Fragmentor/MDL_SDF.pdf
- See SGroups.md for further, more comprehensive notes.

Definition at line 54 of file SubstanceGroup.h.

## Member Typedef Documentation

## ◆ Bracket

typedef std::array<RDGeom::Point3D, 3> RDKit::SubstanceGroup::Bracket

Definition at line 62 of file SubstanceGroup.h.

## Member Enumeration Documentation

## ◆ BondType

enum class RDKit::SubstanceGroup::BondType
| strong

Bond type (see V3000 spec)

Enumerator
XBOND |
CBOND |

Definition at line 57 of file SubstanceGroup.h.

## Constructor & Destructor Documentation

## ◆ SubstanceGroup() [1/4]

RDKit::SubstanceGroup::SubstanceGroup | ( |  | ) |
| delete

No default constructor.

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

## ◆ SubstanceGroup() [2/4]

RDKit::SubstanceGroup::SubstanceGroup | ( | ROMol * | owning_mol,
|  | const std::string & | type )

Main Constructor. Ownership is only set on this side of the relationship: mol->addSubstanceGroup(sgroup) still needs to be called to get ownership on the other side.

## ◆ SubstanceGroup() [3/4]

RDKit::SubstanceGroup::SubstanceGroup | ( | const SubstanceGroup & | other | ) |
| default

References SubstanceGroup().

## ◆ SubstanceGroup() [4/4]

RDKit::SubstanceGroup::SubstanceGroup | ( | SubstanceGroup && | other | ) |
| inlinenoexcept

Definition at line 101 of file SubstanceGroup.h.

References RDKit::RDProps::RDProps(), and SubstanceGroup().

## ◆ ~SubstanceGroup()

RDKit::SubstanceGroup::~SubstanceGroup | ( |  | ) |
| default

Destructor.

## Member Function Documentation

## ◆ addAtomWithBookmark()

void RDKit::SubstanceGroup::addAtomWithBookmark | ( | int | mark | ) |

## ◆ addAtomWithIdx()

void RDKit::SubstanceGroup::addAtomWithIdx | ( | unsigned int | idx | ) |

## ◆ addAttachPoint()

void RDKit::SubstanceGroup::addAttachPoint | ( | unsigned int | aIdx,
|  | int | lvIdx,
|  | const std::string & | idStr )

## ◆ addBondWithBookmark()

void RDKit::SubstanceGroup::addBondWithBookmark | ( | int | mark | ) |

## ◆ addBondWithIdx()

void RDKit::SubstanceGroup::addBondWithIdx | ( | unsigned int | idx | ) |

## ◆ addBracket()

void RDKit::SubstanceGroup::addBracket | ( | const Bracket & | bracket | ) |

## ◆ addCState()

void RDKit::SubstanceGroup::addCState | ( | unsigned int | bondIdx,
|  | const RDGeom::Point3D & | vector )

## ◆ addParentAtomWithBookmark()

void RDKit::SubstanceGroup::addParentAtomWithBookmark | ( | int | mark | ) |

## ◆ addParentAtomWithIdx()

void RDKit::SubstanceGroup::addParentAtomWithIdx | ( | unsigned int | idx | ) |

## ◆ adjustToRemovedAtom()

bool RDKit::SubstanceGroup::adjustToRemovedAtom | ( | unsigned int | atomIdx | ) |

adjusts our atom IDs to reflect that an atom has been removed from the parent molecule decrements all atom IDs that are higher than `atomIdx` raises a `SubstanceGroupException` if `atomIdx` is actually part of this substance group

Returns
  whether or not anything was changed

## ◆ adjustToRemovedBond()

bool RDKit::SubstanceGroup::adjustToRemovedBond | ( | unsigned int | bondIdx | ) |

adjusts our bond IDs to reflect that a bond has been removed from the parent molecule decrements all bond IDs that are higher than `bondIdx` raises a `SubstanceGroupException` if `bondIdx` is actually part of this substance group

Returns
  whether or not anything was changed

## ◆ clearAttachPoints()

void RDKit::SubstanceGroup::clearAttachPoints | ( |  | ) |
| inline

Definition at line 187 of file SubstanceGroup.h.

## ◆ clearBrackets()

void RDKit::SubstanceGroup::clearBrackets | ( |  | ) |
| inline

Definition at line 185 of file SubstanceGroup.h.

## ◆ clearCStates()

void RDKit::SubstanceGroup::clearCStates | ( |  | ) |
| inline

Definition at line 186 of file SubstanceGroup.h.

## ◆ getAtoms()

const std::vector< unsigned int > & RDKit::SubstanceGroup::getAtoms | ( |  | ) | const
| inline

Definition at line 169 of file SubstanceGroup.h.

## ◆ getAttachPoints() [1/2]

std::vector< AttachPoint > & RDKit::SubstanceGroup::getAttachPoints | ( |  | ) |
| inline

Definition at line 183 of file SubstanceGroup.h.

## ◆ getAttachPoints() [2/2]

const std::vector< AttachPoint > & RDKit::SubstanceGroup::getAttachPoints | ( |  | ) | const
| inline

Definition at line 179 of file SubstanceGroup.h.

## ◆ getBonds()

const std::vector< unsigned int > & RDKit::SubstanceGroup::getBonds | ( |  | ) | const
| inline

Definition at line 171 of file SubstanceGroup.h.

## ◆ getBondType()

BondType RDKit::SubstanceGroup::getBondType | ( | unsigned int | bondIdx | ) | const

## ◆ getBrackets() [1/2]

std::vector< Bracket > & RDKit::SubstanceGroup::getBrackets | ( |  | ) |
| inline

Definition at line 181 of file SubstanceGroup.h.

## ◆ getBrackets() [2/2]

const std::vector< Bracket > & RDKit::SubstanceGroup::getBrackets | ( |  | ) | const
| inline

Definition at line 177 of file SubstanceGroup.h.

## ◆ getCStates() [1/2]

std::vector< CState > & RDKit::SubstanceGroup::getCStates | ( |  | ) |
| inline

Definition at line 182 of file SubstanceGroup.h.

## ◆ getCStates() [2/2]

const std::vector< CState > & RDKit::SubstanceGroup::getCStates | ( |  | ) | const
| inline

Definition at line 178 of file SubstanceGroup.h.

## ◆ getIndexInMol()

unsigned int RDKit::SubstanceGroup::getIndexInMol | ( |  | ) | const

get the index of this sgroup in dp_mol's sgroups vector (do not mistake this by the ID!)

## ◆ getIsValid()

bool RDKit::SubstanceGroup::getIsValid | ( |  | ) | const
| inline

returns whether or not this group is valid; invalid groups must be ignored.

Definition at line 140 of file SubstanceGroup.h.

## ◆ getOwningMol()

ROMol & RDKit::SubstanceGroup::getOwningMol | ( |  | ) | const
| inline

Get the molecule that owns this instance.

Definition at line 133 of file SubstanceGroup.h.

References PRECONDITION.

## ◆ getParentAtoms()

const std::vector< unsigned int > & RDKit::SubstanceGroup::getParentAtoms | ( |  | ) | const
| inline

Definition at line 170 of file SubstanceGroup.h.

## ◆ hasOwningMol()

bool RDKit::SubstanceGroup::hasOwningMol | ( |  | ) | const
| inline

returns whether or not this belongs to a molecule

Definition at line 130 of file SubstanceGroup.h.

## ◆ includesAtom()

bool RDKit::SubstanceGroup::includesAtom | ( | unsigned int | atomIdx | ) | const

Returns
  whether or not anything the specified atom is part of the definition of this substance group

## ◆ includesBond()

bool RDKit::SubstanceGroup::includesBond | ( | unsigned int | bondIdx | ) | const

Returns
  whether or not anything the specified bond is part of the definition of this substance group

## ◆ operator=() [1/2]

SubstanceGroup & RDKit::SubstanceGroup::operator= | ( | const SubstanceGroup & | other | ) |
| default

References SubstanceGroup().

## ◆ operator=() [2/2]

SubstanceGroup & RDKit::SubstanceGroup::operator= | ( | SubstanceGroup && | other | ) |
| inlinenoexcept

Definition at line 111 of file SubstanceGroup.h.

References RDKit::RDProps::operator=(), and SubstanceGroup().

## ◆ operator==()

bool RDKit::SubstanceGroup::operator== | ( | const SubstanceGroup & | other | ) | const
| inline

Definition at line 219 of file SubstanceGroup.h.

References SubstanceGroup().

## ◆ removeAtomWithIdx()

void RDKit::SubstanceGroup::removeAtomWithIdx | ( | unsigned int | idx | ) |

## ◆ removeBondWithIdx()

void RDKit::SubstanceGroup::removeBondWithIdx | ( | unsigned int | idx | ) |

## ◆ removeParentAtomWithIdx()

void RDKit::SubstanceGroup::removeParentAtomWithIdx | ( | unsigned int | idx | ) |

## ◆ setAtoms()

void RDKit::SubstanceGroup::setAtoms | ( | std::vector< unsigned int > | atoms | ) |

## ◆ setBonds()

void RDKit::SubstanceGroup::setBonds | ( | std::vector< unsigned int > | bonds | ) |

## ◆ setIsValid()

void RDKit::SubstanceGroup::setIsValid | ( | bool | isValid | ) |
| inline

set whether or not this group is valid; invalid groups must be ignored.

Definition at line 143 of file SubstanceGroup.h.

## ◆ setOwningMol()

void RDKit::SubstanceGroup::setOwningMol | ( | ROMol * | mol | ) |

Set owning molecule This only updates atoms and bonds; parent sgroup has to be updated independently, since parent might not exist at the time this is called.

## ◆ setParentAtoms()

void RDKit::SubstanceGroup::setParentAtoms | ( | std::vector< unsigned int > | patoms | ) |

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

- SubstanceGroup.h