BALL  1.5.0
ringAnalyser.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_RINGANALYSER_H
6 #define BALL_STRUCTURE_RINGANALYSER_H
7 
8 #ifndef BALL_COMMON_GLOBAL_H
9 # include <BALL/common.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_ATOMCONTAINER_H
14 #endif
15 
16 #ifndef BALL_CONCEPT_PROCESSOR_H
17 # include <BALL/CONCEPT/processor.h>
18 #endif
19 
20 #ifndef BALL_CONCEPT_PROPERTY_H
21 # include <BALL/CONCEPT/property.h>
22 #endif
23 
24 #include <vector>
25 #include <set>
26 #include <deque>
27 
28 namespace BALL
29 {
30  class Atom;
31  class Bond;
32 
37  : public UnaryProcessor<AtomContainer>
38  {
39  public:
40 
41  enum RingType
42  {
48  CORE
49  };
50 
52  : public PropertyManager
53  {
54  public:
56  Ring();
57 
59  Ring(std::vector<Atom*> const& atoms_);
60 
63 
66 
68  std::vector<Atom*> atoms;
69 
72 
74  std::set<Bond const*> shared_bonds;
75  };
76 
79 
84 
88  virtual ~RingAnalyser();
90 
93 
95  virtual bool start();
96 
101  virtual Processor::Result operator ()(AtomContainer& ac);
102 
104  virtual bool finish();
105 
107 
112  void clear();
113 
120  bool isInRing(const Atom* atom, std::vector<Atom*> const& ring) const;
121 
128  bool isInRingSystem(const Atom* atom, Index i) const;
129 
137  void sequenceRing(std::vector<Atom*>& ring);
138 
142 
145  std::vector<Ring> getRingSystem(Position i);
146 
149  std::vector<Position> getPeelingOrder(Position i);
150 
151  protected:
152 
157 
162 
166  void peelRings_();
167 
169  bool isCentralRing_(std::list<Position>::iterator ring, std::list<Position>& unassigned_rings);
170 
174  bool peelNextRing_(std::list<Position>& unassigned_rings, bool peel_fused = false);
175 
180  bool assignRTD_(std::list<Position>& trial_system);
181 
183  std::vector<Ring> rings_;
184 
186  std::vector<std::vector<Position> > ring_systems_;
187 
190 
192  std::vector<std::vector<Position> > peeling_order_;
193  };
194 
195 } // namespace BALL
196 
197 #endif // BALL_STRUCTURE_RINGANALYSER_H
Definition: constants.h:13
BALL_INDEX_TYPE Index
char Atom[5]
Definition: PDBdefs.h:257
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:74
Methods for the analysis of the structure of ringsystems.
Definition: ringAnalyser.h:38
bool peelNextRing_(std::list< Position > &unassigned_rings, bool peel_fused=false)
virtual bool start()
Processor method which is called before the operator()-call.
virtual bool finish()
Processor method which is called after the operator()-call.
std::vector< std::vector< Position > > peeling_order_
the order in which rings are peeled from their respective ring systems
Definition: ringAnalyser.h:192
std::vector< Position > getPeelingOrder(Position i)
RingAnalyser()
Default-Constructor.
bool isCentralRing_(std::list< Position >::iterator ring, std::list< Position > &unassigned_rings)
bool isInRingSystem(const Atom *atom, Index i) const
helper-function; determines, whether an atom is part of a certain ring
virtual ~RingAnalyser()
Destructor.
void sequenceRing(std::vector< Atom * > &ring)
void peelRings_()
performs an analysis of the structure of a ringsystem
Size getNumberOfRingSystems()
bool assignRTD_(std::list< Position > &trial_system)
interface for a Ring Template Database (RTD), no functionality yet
std::vector< Ring > rings_
the smallest set of smallest rings of our molecule
Definition: ringAnalyser.h:183
std::vector< std::vector< Position > > ring_systems_
the ring systems, stored as indices into the smallest set of smallest rings
Definition: ringAnalyser.h:186
void clusterRings_()
performs an agglomerative clustering of single rings to ringsystems
bool isInRing(const Atom *atom, std::vector< Atom * > const &ring) const
helper-function; determines, whether an atom is part of a certain ring
std::vector< Ring > getRingSystem(Position i)
HashMap< Bond const *, std::deque< Position > > rings_per_bond_
the ring memberships per bond
Definition: ringAnalyser.h:189
Position predecessor(Position i) const
The predecessor of atom i in the ring.
std::set< Bond const * > shared_bonds
the bonds shared with other rings
Definition: ringAnalyser.h:74
Position successor(Position i) const
The successor of atom i in the ring.
Ring()
Default constructor.
std::vector< Atom * > atoms
the atoms of this ring
Definition: ringAnalyser.h:68
RingType type
the type of this ring
Definition: ringAnalyser.h:71
Ring(std::vector< Atom * > const &atoms_)
Detailed constructor.
#define BALL_EXPORT
Definition: COMMON/global.h:50