BALL 1.5.0
|
Computation of the connected components of the molecular graph. More...
#include <BALL/STRUCTURE/connectedComponentsProcessor.h>
Public Member Functions | |
Constructors and Destructors | |
ConnectedComponentsProcessor () | |
Default Constructor. | |
virtual | ~ConnectedComponentsProcessor () |
Destructor. | |
Processor-related methods | |
virtual bool | start () |
Processor method which is called before the operator()-call. | |
void | clear () |
virtual Processor::Result | operator() (AtomContainer &ac) |
virtual bool | finish () |
Processor method which is called after the operator()-call. | |
![]() | |
UnaryProcessor () | |
UnaryProcessor (const UnaryProcessor &) | |
virtual | ~UnaryProcessor () |
Type definitions | |
typedef std::vector< Atom * > | Component |
typedef std::vector< Molecule > | MolVec |
typedef std::vector< Component > | ComponentVector |
BALL_CREATE (ConnectedComponentsProcessor) | |
Accessors and convenience methods. | |
typedef boost::disjoint_sets< int *, int *, boost::find_with_full_path_compression > | DisjointSet |
ComponentVector | components_ |
Size | getNumberOfConnectedComponents () |
Returns the number of connected components found. | |
void | getComponents (ComponentVector &comp) |
void | getLargestComponent (Molecule &result) |
void | getMinAtomsComponents (MolVec &result, size_t min) |
void | getAllComponents (MolVec &results) |
Additional Inherited Members | |
![]() | |
typedef Processor::Result | result_type |
typedef AtomContainer | argument_type |
typedef AtomContainer & | argument_reference |
typedef const AtomContainer & | const_argument_reference |
typedef AtomContainer * | argument_pointer |
typedef const AtomContainer * | const_argument_pointer |
Computation of the connected components of the molecular graph.
Connected Component Processor
The processor can be applied to all instances of AtomContainer to group the contained atoms to their connected component. This is done according to the intra bonds assoziated with each atom. Thus this enables to identify sub-groups of covalently connected atoms in the atom container. This is especially useful when a molecule entry actually contains more than one independent molecule (like ions plus a drug molecule).
Definition at line 31 of file connectedComponentsProcessor.h.
std::vector<Atom*> BALL::ConnectedComponentsProcessor::Component |
Definition at line 38 of file connectedComponentsProcessor.h.
Definition at line 40 of file connectedComponentsProcessor.h.
|
protected |
Definition at line 135 of file connectedComponentsProcessor.h.
std::vector<Molecule> BALL::ConnectedComponentsProcessor::MolVec |
Definition at line 39 of file connectedComponentsProcessor.h.
BALL::ConnectedComponentsProcessor::ConnectedComponentsProcessor | ( | ) |
Default Constructor.
|
virtual |
Destructor.
BALL::ConnectedComponentsProcessor::BALL_CREATE | ( | ConnectedComponentsProcessor | ) |
void BALL::ConnectedComponentsProcessor::clear | ( | ) |
Clears the data structures.
|
virtual |
Processor method which is called after the operator()-call.
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
void BALL::ConnectedComponentsProcessor::getAllComponents | ( | MolVec & | results | ) |
void BALL::ConnectedComponentsProcessor::getComponents | ( | ComponentVector & | comp | ) |
Returns a copy of the protected member "components_" in 'comp', if the processor was applied to any atom container before. comp then contains all connected molecules/components of that molecule.
The contained Component entries are vectors of atom pointers. Any previously contained element in comp will be discarded.
The result will again contain all atoms of the molecule the processor was applied to before.
comp | - will contain all found components |
void BALL::ConnectedComponentsProcessor::getLargestComponent | ( | Molecule & | result | ) |
Convenience method. Inserts the atoms of the largest molecule into a input of type Molecule . Note: thus that input normally needs to be empty (or at least free of other atom entries) otherwise the atoms are simply added to the pre-existing set. Properties of the original molecule are NOT transfered to the output molecule.
result | - atoms that belong to the larges contained molecule will be inserted into result |
void BALL::ConnectedComponentsProcessor::getMinAtomsComponents | ( | MolVec & | result, |
size_t | min ) |
Convenience method. Inserts elements of type Molecule that have at least a minimum number of atoms into the input vector. Properties of the original molecule are NOT transfered to the output molecules.
result | - Molecule 's that have the minimum number of atoms will be inserted here |
min | - minimal amount of atoms that are needed for a molecule to be selected as result |
Size BALL::ConnectedComponentsProcessor::getNumberOfConnectedComponents | ( | ) |
Returns the number of connected components found.
|
virtual |
Operator () for the processor
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
|
virtual |
Processor method which is called before the operator()-call.
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
|
protected |
Definition at line 136 of file connectedComponentsProcessor.h.