Debian Codegraph @

include/BALL/DOCKING/COMMON/conformationSet.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 #ifndef BALL_DOCKING_COMMON_CONFORMATIONSET_H
6 #define BALL_DOCKING_COMMON_CONFORMATIONSET_H
7
8 #ifndef BALL_DATATYPE_HASHMAP_H
9 # include <BALL/DATATYPE/hashMap.h>
10 #endif
11
12 #ifndef BALL_KERNEL_SYSTEM_H
13 # include <BALL/KERNEL/system.h>
14 #endif
15
16 #ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
17 # include <BALL/MOLMEC/COMMON/snapShot.h>
18 #endif
19
20 #ifndef BALL_FORMAT_DCDFILE_H
21 # include <BALL/FORMAT/DCDFile.h>
22 #endif
23
24 #include <vector>
25 #include <set>
26
27 namespace BALL
28 {
29 /** Data structure for conformation results.
30 \ingroup Docking
31 */
32 class BALL_EXPORT ConformationSet
33 {
34 public:
35
36 /** The conformations are scored as indices into
37 * the vector of snapshots with a score
38 */
39 typedef std::pair < Index, float > Conformation;
40
41 ConformationSet() {};
42
43 ConformationSet(const ConformationSet& cs);
44
45 ConformationSet(const System& system);
46
47 virtual ~ConformationSet() {};
48
49 /** Operations
50 */
51 void setup(const System& system);
52
53 void add(const float score, const System& conformation);
54
55 const System& getSystem() const;
56
57 System& getSystem();
58
59 /** Use score as the new scoring information.
60 */
61 void setScoring(std::vector < Conformation > & score);
62
63 /** Return the current scoring.
64 */
65 const std::vector < Conformation > & getScoring() const;
66
67 /** Reset the scoring vector to the identity permutation with
68 * identical scores of 0.
69 */
70 void resetScoring();
71
72 /** Returns the _unranked_ list of conformations, i.e. the conformations
73 * in the order in which they were added.
74 */
75 const std::vector < SnapShot > & getUnscoredConformations() const;
76
77 /** Returns the i-th snapshot using the current scoring information.
78 * TODO: Exception handling
79 */
80 const SnapShot& operator [] (const Index pos) const;
81
82 /** Export the first num results in the order of the current scoring as dcd file
83 * with name filename. If num == 0, all results are exported.
84 */
85 bool writeDCDFile(const String& filename, const Size num = 0);
86
87 bool readDCDFile(const String& filename);
88
89 /** Return the number of conformations.
90 */
91 Size size() const;
92
93 void setParent(ConformationSet* new_parent){parent_= new_parent;}
94
95 ConformationSet* getParent() {return parent_;}
96
97 const ConformationSet* getParent() const {return parent_;}
98
99 protected:
100
101 /** Attributes
102 */
103
104 // Indices of the conformations in the SnapShotManager.
105 // Sorted according to their score
106 std::vector < Conformation > snapshot_order_;
107
108 /** The original system on which the SnapShots are based
109 */
110 System system_;
111
112 /** The SnapShots
113 */
114 vector<SnapShot> structures_;
115
116 /** the original ConformationSet on which this set is based
117 */
118 ConformationSet* parent_;
119 };
120
121 }
122 #endif