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

High-level driver for the generation of low-energy conformer ensembles of molecular graphs. More...

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

 ConformerGenerator ()
 Constructs the ConformerGenerator instance. More...
 
 ConformerGenerator (const ConformerGenerator &)=delete
 
 ~ConformerGenerator ()
 Destructor. More...
 
ConformerGeneratoroperator= (const ConformerGenerator &)=delete
 
const ConformerGeneratorSettingsgetSettings () const
 Returns the current generator settings. More...
 
ConformerGeneratorSettingsgetSettings ()
 Returns the current generator settings (mutable). More...
 
void clearFragmentLibraries ()
 Removes all configured fragment libraries. More...
 
void addFragmentLibrary (const FragmentLibrary::SharedPointer &lib)
 Adds lib to the list of fragment libraries consulted during fragment-based 3D structure generation. 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 generator. More...
 
const LogMessageCallbackFunctiongetLogMessageCallback () const
 Returns the currently configured log-message callback. More...
 
unsigned int generate (const Chem::MolecularGraph &molgraph)
 Generates a conformer ensemble for molgraph. More...
 
unsigned int generate (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr)
 Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at its current 3D coordinates. More...
 
unsigned int generate (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
 Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at the supplied 3D coordinates fixed_substr_coords. More...
 
void setConformers (Chem::MolecularGraph &molgraph) const
 Transfers the generated conformer ensemble onto molgraph. 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

High-level driver for the generation of low-energy conformer ensembles of molecular graphs.

The generator implements two complementary sampling strategies for producing the conformer ensemble:

Both strategies share a common downstream pipeline of MMFF94-based energy minimization, RMSD-based clustering and energy window filtering. Behaviour is controlled by the embedded conformer generation settings instance, the configured fragment and torsion libraries and the optional abort/timeout/log callbacks.

See also
[CFRG]

Member Typedef Documentation

◆ ConstConformerIterator

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

A constant iterator over the generated conformers.

◆ ConformerIterator

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

A mutable iterator over the generated conformers.

Constructor & Destructor Documentation

◆ ConformerGenerator() [1/2]

CDPL::ConfGen::ConformerGenerator::ConformerGenerator ( )

Constructs the ConformerGenerator instance.

◆ ConformerGenerator() [2/2]

CDPL::ConfGen::ConformerGenerator::ConformerGenerator ( const ConformerGenerator )
delete

◆ ~ConformerGenerator()

CDPL::ConfGen::ConformerGenerator::~ConformerGenerator ( )

Destructor.

Member Function Documentation

◆ operator=()

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

◆ getSettings() [1/2]

const ConformerGeneratorSettings& CDPL::ConfGen::ConformerGenerator::getSettings ( ) const

Returns the current generator settings.

Returns
A const reference to the settings.

◆ getSettings() [2/2]

ConformerGeneratorSettings& CDPL::ConfGen::ConformerGenerator::getSettings ( )

Returns the current generator settings (mutable).

Returns
A reference to the settings.

◆ clearFragmentLibraries()

void CDPL::ConfGen::ConformerGenerator::clearFragmentLibraries ( )

Removes all configured fragment libraries.

◆ addFragmentLibrary()

void CDPL::ConfGen::ConformerGenerator::addFragmentLibrary ( const FragmentLibrary::SharedPointer lib)

Adds lib to the list of fragment libraries consulted during fragment-based 3D structure generation.

Parameters
libThe fragment library to add.

◆ clearTorsionLibraries()

void CDPL::ConfGen::ConformerGenerator::clearTorsionLibraries ( )

Removes all configured torsion libraries.

◆ addTorsionLibrary()

void CDPL::ConfGen::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::getAbortCallback ( ) const

Returns the currently configured abort-check callback.

Returns
A const reference to the abort-check callback.

◆ setTimeoutCallback()

void CDPL::ConfGen::ConformerGenerator::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::ConformerGenerator::getTimeoutCallback ( ) const

Returns the currently configured timeout-check callback.

Returns
A const reference to the timeout-check callback.

◆ setLogMessageCallback()

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

Sets the callback receiving log messages emitted by the generator.

Parameters
funcThe log-message callback.

◆ getLogMessageCallback()

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

Returns the currently configured log-message callback.

Returns
A const reference to the log-message callback.

◆ generate() [1/3]

unsigned int CDPL::ConfGen::ConformerGenerator::generate ( const Chem::MolecularGraph molgraph)

Generates a conformer ensemble for molgraph.

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

◆ generate() [2/3]

unsigned int CDPL::ConfGen::ConformerGenerator::generate ( const Chem::MolecularGraph molgraph,
const Chem::MolecularGraph fixed_substr 
)

Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at its current 3D coordinates.

Parameters
molgraphThe input molecular graph.
fixed_substrThe substructure that must retain its current 3D coordinates.
Returns
A ConfGen::ReturnCode value reporting the outcome of the generation.
Since
1.1

◆ generate() [3/3]

unsigned int CDPL::ConfGen::ConformerGenerator::generate ( const Chem::MolecularGraph molgraph,
const Chem::MolecularGraph fixed_substr,
const Math::Vector3DArray fixed_substr_coords 
)

Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at the supplied 3D coordinates fixed_substr_coords.

Parameters
molgraphThe input molecular graph.
fixed_substrThe substructure that must retain the supplied 3D coordinates.
fixed_substr_coordsThe 3D coordinates assigned to fixed_substr.
Returns
A ConfGen::ReturnCode value reporting the outcome of the generation.
Since
1.1

◆ setConformers()

void CDPL::ConfGen::ConformerGenerator::setConformers ( Chem::MolecularGraph molgraph) const

Transfers the generated conformer ensemble onto molgraph.

The per-conformer 3D coordinates are written to each atom's 3D-coordinates array (via Chem::set3DCoordinatesArray) and the corresponding per-conformer energies are attached to the molecular graph (via Chem::setConformerEnergies).

Parameters
molgraphThe molecular graph that receives the conformer coordinates and energies.

◆ getNumConformers()

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

Returns the number of generated conformers.

Returns
The conformer count.

◆ getConformer() [1/2]

const ConformerData& CDPL::ConfGen::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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::ConformerGenerator::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: