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

Driver for the systematic enumeration of conformers obtained by rotating around rotatable bonds of a molecular graph, using preferred torsion angles taken from configured ConfGen::TorsionLibrary instances. More...

#include <TorsionDriver.hpp>

Public Types

typedef boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerDataConstConformerIterator
 A constant iterator over the generated conformers. More...
 
typedef boost::indirect_iterator< ConformerDataArray::const_iterator, ConformerDataConformerIterator
 A mutable iterator over the generated conformers. More...
 

Public Member Functions

 TorsionDriver ()
 Constructs the TorsionDriver instance. More...
 
 TorsionDriver (const TorsionDriver &)=delete
 
 ~TorsionDriver ()
 Destructor. More...
 
TorsionDriveroperator= (const TorsionDriver &)=delete
 
const TorsionDriverSettingsgetSettings () const
 Returns the current driver settings. More...
 
TorsionDriverSettingsgetSettings ()
 Returns the current driver settings (mutable). More...
 
void clearTorsionLibraries ()
 Removes all configured torsion libraries. More...
 
void addTorsionLibrary (const TorsionLibrary::SharedPointer &lib)
 Adds lib to the list of torsion libraries consulted during torsion driving. More...
 
void setAbortCallback (const CallbackFunction &func)
 Sets the callback invoked periodically to allow the generation to be aborted by the user. More...
 
const CallbackFunctiongetAbortCallback () const
 Returns the currently configured abort-check callback. More...
 
void setTimeoutCallback (const CallbackFunction &func)
 Sets the callback invoked periodically to check whether the configured timeout has elapsed. More...
 
const CallbackFunctiongetTimeoutCallback () const
 Returns the currently configured timeout-check callback. More...
 
void setLogMessageCallback (const LogMessageCallbackFunction &func)
 Sets the callback receiving log messages emitted by the driver. More...
 
const LogMessageCallbackFunctiongetLogMessageCallback () const
 Returns the currently configured log-message callback. More...
 
unsigned int setup (const Chem::MolecularGraph &molgraph)
 Sets up the driver for molgraph with the default rotatable bond perception. More...
 
unsigned int setup (const Chem::MolecularGraph &molgraph, const Util::BitSet &bond_mask)
 Sets up the driver for molgraph using only the bonds whose corresponding bit is set in bond_mask as rotatable. More...
 
void clearInputCoordinates ()
 Removes all stored input coordinates. More...
 
void clearInputCoordinates (std::size_t frag_idx)
 Removes all input coordinates of the fragment at index frag_idx. More...
 
void addInputCoordinates (const Math::Vector3DArray &coords)
 Adds coords as a new starting conformation that the driver will torsion-drive. More...
 
void addInputCoordinates (const Math::Vector3DArray &coords, std::size_t frag_idx)
 Adds coords as a new starting conformation restricted to the fragment at index frag_idx. More...
 
void addInputCoordinates (const ConformerData &conf_data, std::size_t frag_idx)
 Adds the conformer data conf_data as a new starting conformation restricted to the fragment at index frag_idx. More...
 
void addInputCoordinates (const ConformerData::SharedPointer &conf_data, std::size_t frag_idx)
 Adds the conformer data shared pointer conf_data as a new starting conformation restricted to the fragment at index frag_idx. More...
 
std::size_t getNumFragments () const
 Returns the number of fragments produced by the rotatable bond decomposition. More...
 
const Chem::FragmentgetFragment (std::size_t idx) const
 Returns the fragment at index idx. More...
 
unsigned int generateConformers ()
 Runs the torsion-driving conformer enumeration. More...
 
std::size_t getNumConformers () const
 Returns the number of generated conformers. More...
 
const ConformerDatagetConformer (std::size_t idx) const
 Returns the conformer at index idx. More...
 
ConformerDatagetConformer (std::size_t idx)
 Returns the conformer at index idx. More...
 
ConstConformerIterator getConformersBegin () const
 Returns a constant iterator pointing to the first conformer. More...
 
ConstConformerIterator getConformersEnd () const
 Returns a constant iterator pointing one past the last conformer. More...
 
ConformerIterator getConformersBegin ()
 Returns a mutable iterator pointing to the first conformer. More...
 
ConformerIterator getConformersEnd ()
 Returns a mutable iterator pointing one past the last conformer. More...
 
ConstConformerIterator begin () const
 Returns a constant iterator pointing to the first conformer (range-based for support). More...
 
ConstConformerIterator end () const
 Returns a constant iterator pointing one past the last conformer (range-based for support). More...
 
ConformerIterator begin ()
 Returns a mutable iterator pointing to the first conformer (range-based for support). More...
 
ConformerIterator end ()
 Returns a mutable iterator pointing one past the last conformer (range-based for support). More...
 

Detailed Description

Driver for the systematic enumeration of conformers obtained by rotating around rotatable bonds of a molecular graph, using preferred torsion angles taken from configured ConfGen::TorsionLibrary instances.

Member Typedef Documentation

◆ ConstConformerIterator

typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> CDPL::ConfGen::TorsionDriver::ConstConformerIterator

A constant iterator over the generated conformers.

◆ ConformerIterator

typedef boost::indirect_iterator<ConformerDataArray::const_iterator, ConformerData> CDPL::ConfGen::TorsionDriver::ConformerIterator

A mutable iterator over the generated conformers.

Constructor & Destructor Documentation

◆ TorsionDriver() [1/2]

CDPL::ConfGen::TorsionDriver::TorsionDriver ( )

Constructs the TorsionDriver instance.

◆ TorsionDriver() [2/2]

CDPL::ConfGen::TorsionDriver::TorsionDriver ( const TorsionDriver )
delete

◆ ~TorsionDriver()

CDPL::ConfGen::TorsionDriver::~TorsionDriver ( )

Destructor.

Member Function Documentation

◆ operator=()

TorsionDriver& CDPL::ConfGen::TorsionDriver::operator= ( const TorsionDriver )
delete

◆ getSettings() [1/2]

const TorsionDriverSettings& CDPL::ConfGen::TorsionDriver::getSettings ( ) const

Returns the current driver settings.

Returns
A const reference to the settings.

◆ getSettings() [2/2]

TorsionDriverSettings& CDPL::ConfGen::TorsionDriver::getSettings ( )

Returns the current driver settings (mutable).

Returns
A reference to the settings.

◆ clearTorsionLibraries()

void CDPL::ConfGen::TorsionDriver::clearTorsionLibraries ( )

Removes all configured torsion libraries.

◆ addTorsionLibrary()

void CDPL::ConfGen::TorsionDriver::addTorsionLibrary ( const TorsionLibrary::SharedPointer lib)

Adds lib to the list of torsion libraries consulted during torsion driving.

Parameters
libThe torsion library to add.

◆ setAbortCallback()

void CDPL::ConfGen::TorsionDriver::setAbortCallback ( const CallbackFunction func)

Sets the callback invoked periodically to allow the generation to be aborted by the user.

Parameters
funcThe abort-check callback.

◆ getAbortCallback()

const CallbackFunction& CDPL::ConfGen::TorsionDriver::getAbortCallback ( ) const

Returns the currently configured abort-check callback.

Returns
A const reference to the abort-check callback.

◆ setTimeoutCallback()

void CDPL::ConfGen::TorsionDriver::setTimeoutCallback ( const CallbackFunction func)

Sets the callback invoked periodically to check whether the configured timeout has elapsed.

Parameters
funcThe timeout-check callback.

◆ getTimeoutCallback()

const CallbackFunction& CDPL::ConfGen::TorsionDriver::getTimeoutCallback ( ) const

Returns the currently configured timeout-check callback.

Returns
A const reference to the timeout-check callback.

◆ setLogMessageCallback()

void CDPL::ConfGen::TorsionDriver::setLogMessageCallback ( const LogMessageCallbackFunction func)

Sets the callback receiving log messages emitted by the driver.

Parameters
funcThe log-message callback.

◆ getLogMessageCallback()

const LogMessageCallbackFunction& CDPL::ConfGen::TorsionDriver::getLogMessageCallback ( ) const

Returns the currently configured log-message callback.

Returns
A const reference to the log-message callback.

◆ setup() [1/2]

unsigned int CDPL::ConfGen::TorsionDriver::setup ( const Chem::MolecularGraph molgraph)

Sets up the driver for molgraph with the default rotatable bond perception.

Parameters
molgraphThe input molecular graph.
Returns
A ConfGen::ReturnCode value reporting the outcome of the setup.

◆ setup() [2/2]

unsigned int CDPL::ConfGen::TorsionDriver::setup ( const Chem::MolecularGraph molgraph,
const Util::BitSet bond_mask 
)

Sets up the driver for molgraph using only the bonds whose corresponding bit is set in bond_mask as rotatable.

Parameters
molgraphThe input molecular graph.
bond_maskThe bit mask of rotatable bonds (one bit per bond of molgraph).
Returns
A ConfGen::ReturnCode value reporting the outcome of the setup.

◆ clearInputCoordinates() [1/2]

void CDPL::ConfGen::TorsionDriver::clearInputCoordinates ( )

Removes all stored input coordinates.

◆ clearInputCoordinates() [2/2]

void CDPL::ConfGen::TorsionDriver::clearInputCoordinates ( std::size_t  frag_idx)

Removes all input coordinates of the fragment at index frag_idx.

Parameters
frag_idxThe zero-based fragment index.

◆ addInputCoordinates() [1/4]

void CDPL::ConfGen::TorsionDriver::addInputCoordinates ( const Math::Vector3DArray coords)

Adds coords as a new starting conformation that the driver will torsion-drive.

Parameters
coordsThe input 3D coordinates.

◆ addInputCoordinates() [2/4]

void CDPL::ConfGen::TorsionDriver::addInputCoordinates ( const Math::Vector3DArray coords,
std::size_t  frag_idx 
)

Adds coords as a new starting conformation restricted to the fragment at index frag_idx.

Parameters
coordsThe input 3D coordinates of the fragment.
frag_idxThe zero-based fragment index.

◆ addInputCoordinates() [3/4]

void CDPL::ConfGen::TorsionDriver::addInputCoordinates ( const ConformerData conf_data,
std::size_t  frag_idx 
)

Adds the conformer data conf_data as a new starting conformation restricted to the fragment at index frag_idx.

Parameters
conf_dataThe input conformer data.
frag_idxThe zero-based fragment index.

◆ addInputCoordinates() [4/4]

void CDPL::ConfGen::TorsionDriver::addInputCoordinates ( const ConformerData::SharedPointer conf_data,
std::size_t  frag_idx 
)

Adds the conformer data shared pointer conf_data as a new starting conformation restricted to the fragment at index frag_idx.

Parameters
conf_dataThe input conformer data.
frag_idxThe zero-based fragment index.

◆ getNumFragments()

std::size_t CDPL::ConfGen::TorsionDriver::getNumFragments ( ) const

Returns the number of fragments produced by the rotatable bond decomposition.

Returns
The fragment count.

◆ getFragment()

const Chem::Fragment& CDPL::ConfGen::TorsionDriver::getFragment ( std::size_t  idx) const

Returns the fragment at index idx.

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

◆ generateConformers()

unsigned int CDPL::ConfGen::TorsionDriver::generateConformers ( )

Runs the torsion-driving conformer enumeration.

Returns
A ConfGen::ReturnCode value reporting the outcome of the generation.

◆ getNumConformers()

std::size_t CDPL::ConfGen::TorsionDriver::getNumConformers ( ) const

Returns the number of generated conformers.

Returns
The conformer count.

◆ getConformer() [1/2]

const ConformerData& CDPL::ConfGen::TorsionDriver::getConformer ( std::size_t  idx) const

Returns the conformer at index idx.

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

◆ getConformer() [2/2]

ConformerData& CDPL::ConfGen::TorsionDriver::getConformer ( std::size_t  idx)

Returns the conformer at index idx.

Parameters
idxThe zero-based conformer index.
Returns
A reference to the conformer data.
Exceptions
Base::IndexErrorif the number of conformers is zero or idx is not in the range [0, getNumConformers() - 1].

◆ getConformersBegin() [1/2]

ConstConformerIterator CDPL::ConfGen::TorsionDriver::getConformersBegin ( ) const

Returns a constant iterator pointing to the first conformer.

Returns
A constant iterator pointing to the first conformer.

◆ getConformersEnd() [1/2]

ConstConformerIterator CDPL::ConfGen::TorsionDriver::getConformersEnd ( ) const

Returns a constant iterator pointing one past the last conformer.

Returns
A constant iterator pointing one past the last conformer.

◆ getConformersBegin() [2/2]

ConformerIterator CDPL::ConfGen::TorsionDriver::getConformersBegin ( )

Returns a mutable iterator pointing to the first conformer.

Returns
A mutable iterator pointing to the first conformer.

◆ getConformersEnd() [2/2]

ConformerIterator CDPL::ConfGen::TorsionDriver::getConformersEnd ( )

Returns a mutable iterator pointing one past the last conformer.

Returns
A mutable iterator pointing one past the last conformer.

◆ begin() [1/2]

ConstConformerIterator CDPL::ConfGen::TorsionDriver::begin ( ) const

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

Returns
A constant iterator pointing to the first conformer.

◆ end() [1/2]

ConstConformerIterator CDPL::ConfGen::TorsionDriver::end ( ) const

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

Returns
A constant iterator pointing one past the last conformer.

◆ begin() [2/2]

ConformerIterator CDPL::ConfGen::TorsionDriver::begin ( )

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

Returns
A mutable iterator pointing to the first conformer.

◆ end() [2/2]

ConformerIterator CDPL::ConfGen::TorsionDriver::end ( )

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

Returns
A mutable iterator pointing one past the last conformer.

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