This class provides methods for analysis of the chains in a molecule. More...
#include <BALL/STRUCTURE/chainBuilder.h>
Public Member Functions | |
| ChainBuilder () | |
Default-Constructor. | |
| ~ChainBuilder () | |
Destructor. | |
| vector< vector< Atom * > > | buildChains (System &molecule_sys) |
Determines the the main chain and side chains of a structure diagram. | |
Static Public Member Functions | |
| static bool | compareChains (const vector< Atom * > &x, const vector< Atom * > &y) |
comparator for sorting the chains by their length | |
Private Member Functions | |
| vector< vector< Size > > | calcAdjMatrix (vector< Atom * > &core_chain_atoms) |
creates a matrix, holding a "1" if two atoms a connected and "0" if they are not | |
| void | visit_c_areas (Size &k, vector< vector< Size > > &adj_matrix, vector< int > &val, Size &nodes, Size &id, vector< Atom * > &core_chain_atoms, vector< Atom * > &chain_area) |
recursive visit-finction, used by findChainAreas() | |
| void | findChainAreas (Size &nodes, vector< vector< Size > > &adj_matrix, vector< Atom * > &core_chain_atoms, vector< vector< Atom * > > &chain_areas) |
performs a depth-first-search for chain-areas in a molecule | |
| void | findEdges (vector< Atom * > &chain_area) |
finds all edges in one chain area | |
| void | visit_chains (Size &k, vector< vector< Size > > &adj_matrix, vector< int > &val, Size &id, vector< Atom * > &chain_area, Size &end, bool &breaker, Size &t, vector< Atom * > &prev_nodes) |
visit-function used by findPath() | |
| vector< Atom * > | findPath (Atom *&first_edge, Atom *&second_edge, vector< Atom * > &chain_area, vector< vector< Size > > &adj_matrix) |
breadth-first-search, finding the shortest path between two edges of a chain-area | |
| vector< vector< Atom * > > | findChains (vector< Atom * > &chain_area, vector< vector< Size > > &adj_matrix) |
finds all relevant chains in one chain-area | |
| Size | getIndex (Atom *&atom, vector< Atom * > &container) |
helper-function to determine an Atom's index in a certain vector<Atom*> | |
This class provides methods for analysis of the chains in a molecule.
| BALL::ChainBuilder::ChainBuilder | ( | ) |
Default-Constructor.
| BALL::ChainBuilder::~ChainBuilder | ( | ) |
Destructor.
Determines the the main chain and side chains of a structure diagram.
| molecule_sys | the input System |
| vector<vector<Size> > BALL::ChainBuilder::calcAdjMatrix | ( | vector< Atom * > & | core_chain_atoms | ) | [private] |
creates a matrix, holding a "1" if two atoms a connected and "0" if they are not
| core_chain_atoms | the core chain atoms of a molecule |
| static bool BALL::ChainBuilder::compareChains | ( | const vector< Atom * > & | x, | |
| const vector< Atom * > & | y | |||
| ) | [static] |
comparator for sorting the chains by their length
| x | chain | |
| y | chain |
| void BALL::ChainBuilder::findChainAreas | ( | Size & | nodes, | |
| vector< vector< Size > > & | adj_matrix, | |||
| vector< Atom * > & | core_chain_atoms, | |||
| vector< vector< Atom * > > & | chain_areas | |||
| ) | [private] |
performs a depth-first-search for chain-areas in a molecule
| nodes | number of nodes in the molecule-graph | |
| adj_matrix | adjacence-matrix representing the molecule-graph | |
| core_chain_atoms | the core chain atoms of the molecule | |
| chain_areas | the chain areas that are to be found |
| vector<vector<Atom*> > BALL::ChainBuilder::findChains | ( | vector< Atom * > & | chain_area, | |
| vector< vector< Size > > & | adj_matrix | |||
| ) | [private] |
finds all relevant chains in one chain-area
| chain_area | the chain area that is to be searched | |
| adj_matrix | adjacence-matrix representing the molecule-graph |
| void BALL::ChainBuilder::findEdges | ( | vector< Atom * > & | chain_area | ) | [private] |
finds all edges in one chain area
| chain_area |
| vector<Atom*> BALL::ChainBuilder::findPath | ( | Atom *& | first_edge, | |
| Atom *& | second_edge, | |||
| vector< Atom * > & | chain_area, | |||
| vector< vector< Size > > & | adj_matrix | |||
| ) | [private] |
breadth-first-search, finding the shortest path between two edges of a chain-area
| first_edge | the first of the two edges | |
| second_edge | the second of the two edges | |
| chain_area | the chain area that is to be searched | |
| adj_matrix | adjacence-matrix representing the molecule-graph |
helper-function to determine an Atom's index in a certain vector<Atom*>
| atom | the Atom | |
| container | the vector<Atom*> |
| void BALL::ChainBuilder::visit_c_areas | ( | Size & | k, | |
| vector< vector< Size > > & | adj_matrix, | |||
| vector< int > & | val, | |||
| Size & | nodes, | |||
| Size & | id, | |||
| vector< Atom * > & | core_chain_atoms, | |||
| vector< Atom * > & | chain_area | |||
| ) | [private] |
recursive visit-finction, used by findChainAreas()
| k | counter for the sequence-vector | |
| adj_matrix | adjacence-matrix representing the molecule-graph | |
| val | sequence, in which the atoms are visited | |
| nodes | number of nodes in the molecule-graph | |
| id | indicates, at which point in the sequence a certain atom has been visited | |
| core_chain_atoms | the core chain atoms of the molecule | |
| chain_area | the chain area that is to be filled with its atoms |
| void BALL::ChainBuilder::visit_chains | ( | Size & | k, | |
| vector< vector< Size > > & | adj_matrix, | |||
| vector< int > & | val, | |||
| Size & | id, | |||
| vector< Atom * > & | chain_area, | |||
| Size & | end, | |||
| bool & | breaker, | |||
| Size & | t, | |||
| vector< Atom * > & | prev_nodes | |||
| ) | [private] |
visit-function used by findPath()
| k | counter for the sequence-vector | |
| adj_matrix | adjacence-matrix representing the molecule-graph | |
| val | sequence, in which the atoms are visited | |
| id | indicates, at which point in the sequence a certain atom has been visited | |
| chain_area | the chain area whos chains are to be found | |
| end | Index of the second edge - atom in the chain-area-vector | |
| breaker | flag, indicating, whether athe second edge has been reached | |
| t | starting point for the traceback | |
| prev_nodes | traceback-vector |