Chemical Data Processing Library C++ API - Version 1.4.0
Classes | Public Types | Public Member Functions | List of all members
CDPL::ConfGen::TorsionRule Class Reference

Data structure for the representation of single torsion library rules. More...

#include <TorsionRule.hpp>

Classes

class  AngleEntry
 One preferred torsion angle for a rule, characterized by its value, the two tolerance bands and a score. More...
 

Public Types

typedef AngleEntryList::iterator AngleEntryIterator
 A mutable iterator over the angle entries. More...
 
typedef AngleEntryList::const_iterator ConstAngleEntryIterator
 A constant iterator over the angle entries. More...
 

Public Member Functions

const std::string & getMatchPatternString () const
 Returns the SMARTS-like match pattern in textual form. More...
 
void setMatchPatternString (const std::string &ptn_str)
 Sets the SMARTS-like match pattern in textual form. More...
 
const Chem::MolecularGraph::SharedPointergetMatchPattern () const
 Returns the compiled match-pattern molecular graph. More...
 
void setMatchPattern (const Chem::MolecularGraph::SharedPointer &ptn)
 Sets the compiled match-pattern molecular graph. More...
 
void addAngle (const AngleEntry &ang_entry)
 Appends the angle entry ang_entry to the rule. More...
 
void addAngle (double angle, double tol1=0.0, double tol2=0.0, double score=0.0)
 Constructs and appends a new angle entry. More...
 
std::size_t getNumAngles () const
 Returns the number of stored angle entries. More...
 
const AngleEntrygetAngle (std::size_t idx) const
 Returns the angle entry at index idx. More...
 
void removeAngle (std::size_t idx)
 Removes the angle entry at index idx. More...
 
void removeAngle (const AngleEntryIterator &it)
 Removes the angle entry referenced by iterator it. More...
 
AngleEntryIterator getAnglesBegin ()
 Returns a mutable iterator pointing to the first angle entry. More...
 
AngleEntryIterator getAnglesEnd ()
 Returns a mutable iterator pointing one past the last angle entry. More...
 
ConstAngleEntryIterator getAnglesBegin () const
 Returns a constant iterator pointing to the first angle entry. More...
 
ConstAngleEntryIterator getAnglesEnd () const
 Returns a constant iterator pointing one past the last angle entry. More...
 
AngleEntryIterator begin ()
 Returns a mutable iterator pointing to the first angle entry (range-based for support). More...
 
AngleEntryIterator end ()
 Returns a mutable iterator pointing one past the last angle entry (range-based for support). More...
 
ConstAngleEntryIterator begin () const
 Returns a constant iterator pointing to the first angle entry (range-based for support). More...
 
ConstAngleEntryIterator end () const
 Returns a constant iterator pointing one past the last angle entry (range-based for support). More...
 
void swap (TorsionRule &rule)
 Swaps the contents of this rule with rule. More...
 
void clear ()
 Clears the match pattern and removes all angle entries. More...
 

Detailed Description

Data structure for the representation of single torsion library rules.

Eeach rule consists of a SMARTS-like atom-mapping pattern and a list of preferred torsion angles (each with tolerances and a score).

Member Typedef Documentation

◆ AngleEntryIterator

typedef AngleEntryList::iterator CDPL::ConfGen::TorsionRule::AngleEntryIterator

A mutable iterator over the angle entries.

◆ ConstAngleEntryIterator

typedef AngleEntryList::const_iterator CDPL::ConfGen::TorsionRule::ConstAngleEntryIterator

A constant iterator over the angle entries.

Member Function Documentation

◆ getMatchPatternString()

const std::string& CDPL::ConfGen::TorsionRule::getMatchPatternString ( ) const

Returns the SMARTS-like match pattern in textual form.

Returns
A const reference to the match-pattern string.

◆ setMatchPatternString()

void CDPL::ConfGen::TorsionRule::setMatchPatternString ( const std::string &  ptn_str)

Sets the SMARTS-like match pattern in textual form.

Parameters
ptn_strThe new match-pattern string.

◆ getMatchPattern()

const Chem::MolecularGraph::SharedPointer& CDPL::ConfGen::TorsionRule::getMatchPattern ( ) const

Returns the compiled match-pattern molecular graph.

Returns
A const reference to the compiled pattern shared pointer.

◆ setMatchPattern()

void CDPL::ConfGen::TorsionRule::setMatchPattern ( const Chem::MolecularGraph::SharedPointer ptn)

Sets the compiled match-pattern molecular graph.

Parameters
ptnThe new match pattern.

◆ addAngle() [1/2]

void CDPL::ConfGen::TorsionRule::addAngle ( const AngleEntry ang_entry)

Appends the angle entry ang_entry to the rule.

Parameters
ang_entryThe angle entry to append.

◆ addAngle() [2/2]

void CDPL::ConfGen::TorsionRule::addAngle ( double  angle,
double  tol1 = 0.0,
double  tol2 = 0.0,
double  score = 0.0 
)

Constructs and appends a new angle entry.

Parameters
angleThe angle value in degrees.
tol1The first (preferred) tolerance band.
tol2The second (relaxed) tolerance band.
scoreThe score.

◆ getNumAngles()

std::size_t CDPL::ConfGen::TorsionRule::getNumAngles ( ) const

Returns the number of stored angle entries.

Returns
The angle-entry count.

◆ getAngle()

const AngleEntry& CDPL::ConfGen::TorsionRule::getAngle ( std::size_t  idx) const

Returns the angle entry at index idx.

Parameters
idxThe zero-based angle-entry index.
Returns
A const reference to the angle entry.
Exceptions
Base::IndexErrorif the number of angle entries is zero or idx is not in the range [0, getNumAngles() - 1].

◆ removeAngle() [1/2]

void CDPL::ConfGen::TorsionRule::removeAngle ( std::size_t  idx)

Removes the angle entry at index idx.

Parameters
idxThe zero-based angle-entry index.
Exceptions
Base::IndexErrorif the number of angle entries is zero or idx is not in the range [0, getNumAngles() - 1].

◆ removeAngle() [2/2]

void CDPL::ConfGen::TorsionRule::removeAngle ( const AngleEntryIterator it)

Removes the angle entry referenced by iterator it.

Parameters
itThe iterator pointing to the angle entry.
Exceptions
Base::RangeErrorif the number of angle entries is zero or it is not in the range [getAnglesBegin(), getAnglesEnd() - 1].

◆ getAnglesBegin() [1/2]

AngleEntryIterator CDPL::ConfGen::TorsionRule::getAnglesBegin ( )

Returns a mutable iterator pointing to the first angle entry.

Returns
A mutable iterator pointing to the first angle entry.

◆ getAnglesEnd() [1/2]

AngleEntryIterator CDPL::ConfGen::TorsionRule::getAnglesEnd ( )

Returns a mutable iterator pointing one past the last angle entry.

Returns
A mutable iterator pointing one past the last angle entry.

◆ getAnglesBegin() [2/2]

ConstAngleEntryIterator CDPL::ConfGen::TorsionRule::getAnglesBegin ( ) const

Returns a constant iterator pointing to the first angle entry.

Returns
A constant iterator pointing to the first angle entry.

◆ getAnglesEnd() [2/2]

ConstAngleEntryIterator CDPL::ConfGen::TorsionRule::getAnglesEnd ( ) const

Returns a constant iterator pointing one past the last angle entry.

Returns
A constant iterator pointing one past the last angle entry.

◆ begin() [1/2]

AngleEntryIterator CDPL::ConfGen::TorsionRule::begin ( )

Returns a mutable iterator pointing to the first angle entry (range-based for support).

Returns
A mutable iterator pointing to the first angle entry.

◆ end() [1/2]

AngleEntryIterator CDPL::ConfGen::TorsionRule::end ( )

Returns a mutable iterator pointing one past the last angle entry (range-based for support).

Returns
A mutable iterator pointing one past the last angle entry.

◆ begin() [2/2]

ConstAngleEntryIterator CDPL::ConfGen::TorsionRule::begin ( ) const

Returns a constant iterator pointing to the first angle entry (range-based for support).

Returns
A constant iterator pointing to the first angle entry.

◆ end() [2/2]

ConstAngleEntryIterator CDPL::ConfGen::TorsionRule::end ( ) const

Returns a constant iterator pointing one past the last angle entry (range-based for support).

Returns
A constant iterator pointing one past the last angle entry.

◆ swap()

void CDPL::ConfGen::TorsionRule::swap ( TorsionRule rule)

Swaps the contents of this rule with rule.

Parameters
ruleThe other torsion rule.

◆ clear()

void CDPL::ConfGen::TorsionRule::clear ( )

Clears the match pattern and removes all angle entries.


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