BALL  1.5.0
List of all members
BALL::ConnectedComponentsProcessor Class Reference

Computation of the connected components of the molecular graph. More...

#include <BALL/STRUCTURE/connectedComponentsProcessor.h>

Inheritance diagram for BALL::ConnectedComponentsProcessor:
BALL::UnaryProcessor< AtomContainer > BALL::UnaryFunctor< AtomContainer, Processor::Result >

Public Member Functions

Constructors and Destructors
 ConnectedComponentsProcessor ()
 Default Constructor. More...
 
virtual ~ConnectedComponentsProcessor ()
 Destructor. More...
 
Processor-related methods
virtual bool start ()
 Processor method which is called before the operator()-call. More...
 
void clear ()
 
virtual Processor::Result operator() (AtomContainer &ac)
 
virtual bool finish ()
 Processor method which is called after the operator()-call. More...
 
- Public Member Functions inherited from BALL::UnaryProcessor< AtomContainer >
 UnaryProcessor ()
 
 UnaryProcessor (const UnaryProcessor &)
 
virtual ~UnaryProcessor ()
 

Type definitions

typedef std::vector< Atom * > Component
 
typedef std::vector< MoleculeMolVec
 
typedef std::vector< ComponentComponentVector
 
 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. More...
 
void getComponents (ComponentVector &comp)
 
void getLargestComponent (Molecule &result)
 
void getMinAtomsComponents (MolVec &result, size_t min)
 
void getAllComponents (MolVec &results)
 

Additional Inherited Members

- Public Types inherited from BALL::UnaryFunctor< AtomContainer, Processor::Result >
typedef Processor::Result result_type
 
typedef AtomContainer argument_type
 
typedef AtomContainerargument_reference
 
typedef const AtomContainerconst_argument_reference
 
typedef AtomContainerargument_pointer
 
typedef const AtomContainerconst_argument_pointer
 

Detailed Description

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.

Member Typedef Documentation

◆ Component

Definition at line 38 of file connectedComponentsProcessor.h.

◆ ComponentVector

Definition at line 40 of file connectedComponentsProcessor.h.

◆ DisjointSet

typedef boost::disjoint_sets< int*, int*, boost::find_with_full_path_compression > BALL::ConnectedComponentsProcessor::DisjointSet
protected

Definition at line 135 of file connectedComponentsProcessor.h.

◆ MolVec

Definition at line 39 of file connectedComponentsProcessor.h.

Constructor & Destructor Documentation

◆ ConnectedComponentsProcessor()

BALL::ConnectedComponentsProcessor::ConnectedComponentsProcessor ( )

Default Constructor.

◆ ~ConnectedComponentsProcessor()

virtual BALL::ConnectedComponentsProcessor::~ConnectedComponentsProcessor ( )
virtual

Destructor.

Member Function Documentation

◆ BALL_CREATE()

BALL::ConnectedComponentsProcessor::BALL_CREATE ( ConnectedComponentsProcessor  )

◆ clear()

void BALL::ConnectedComponentsProcessor::clear ( )

Clears the data structures.

◆ finish()

virtual bool BALL::ConnectedComponentsProcessor::finish ( )
virtual

Processor method which is called after the operator()-call.

Reimplemented from BALL::UnaryProcessor< AtomContainer >.

◆ getAllComponents()

void BALL::ConnectedComponentsProcessor::getAllComponents ( MolVec results)

Convenience method. Inserts all identified Molecule 's into the input vector. Properties of the original molecule are NOT transfered to the output molecules.

Parameters
result- All real Molecule 's will be inserted here

◆ getComponents()

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.

Parameters
comp- will contain all found components

◆ getLargestComponent()

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.

Parameters
result- atoms that belong to the larges contained molecule will be inserted into result

◆ getMinAtomsComponents()

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.

Parameters
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

◆ getNumberOfConnectedComponents()

Size BALL::ConnectedComponentsProcessor::getNumberOfConnectedComponents ( )

Returns the number of connected components found.

◆ operator()()

virtual Processor::Result BALL::ConnectedComponentsProcessor::operator() ( AtomContainer ac)
virtual

Operator () for the processor

Reimplemented from BALL::UnaryProcessor< AtomContainer >.

◆ start()

virtual bool BALL::ConnectedComponentsProcessor::start ( )
virtual

Processor method which is called before the operator()-call.

Reimplemented from BALL::UnaryProcessor< AtomContainer >.

Member Data Documentation

◆ components_

ComponentVector BALL::ConnectedComponentsProcessor::components_
protected

Definition at line 136 of file connectedComponentsProcessor.h.