Debian Codegraph @

include/BALL/DOCKING/COMMON/result.h

raw symbols SCIP
1 // ----------------------------------------------------
2 // $Maintainer: Marc Röttig $
3 // $Authors: Marc Röttig, Marcel Schumann $
4 // ----------------------------------------------------
5
6 #ifndef BALL_DOCKING_RESULT_H
7 #define BALL_DOCKING_RESULT_H
8
9 #include <BALL/DOCKING/COMMON/receptor.h>
10 #include <BALL/DOCKING/COMMON/flexibleMolecule.h>
11 #include <vector>
12 #include <map>
13
14
15 namespace BALL
16 {
17 /** Result class.
18 This class represents a result that occur within virtual
19 screening workflows, like docking results or rescoring results.
20 */
21 class BALL_EXPORT Result
22 {
23 public:
24
25 enum BALL_EXPORT Method
26 {
27 UNKNOWN = -1,
28 RECEPTORIMPORT,
29 LIGANDIMPORT,
30 DOCKING,
31 RESCORING,
32 MDRESCORING,
33 CONSENSUSRESCORING,
34 MOLECULE_CHECK
35 };
36
37 class BALL_EXPORT ResultData
38 {
39 public:
40 ResultData();
41 ResultData(int result_type);
42 void setReceptorConformationId(String id);
43 void setReceptorConformation(Conformation* conf);
44 bool hasReceptorConformationId() const;
45 String getReceptorConformationId() const;
46 void setLigandConformationId(String id);
47 void setLigandConformation(Conformation* conf);
48 String getLigandConformationId() const;
49 bool hasLigandConformationId() const;
50 void setScoringMethod(int method);
51 bool hasScoringMethod() const;
52 int getScoringMethod() const;
53 void setEnergy(double e);
54 double getEnergy() const;
55 bool hasEnergy() const;
56 bool check() const;
57 void setConformation(Conformation* conf);
58 Conformation* getConformation();
59 private:
60 Conformation* conformation;
61 bool has_rec_id;
62 bool has_lig_id;
63 bool has_energy;
64 bool has_method;
65 String rec_conf_id;
66 String lig_conf_id;
67 int scoringmethod;
68 double energy;
69 int resulttype;
70 };
71
72 static Result::Method getMethod(int i);
73 static Result* makeLigandImportResult();
74 static Result* makeReceptorImportResult();
75 static Result* makeDockingResult();
76 static Result* makeRescoringResult();
77 BALL_CREATE(Result)
78 Result();
79
80 /* Constructor.
81 */
82 Result(const Result::Method& _method);
83
84 /** Copy constructor */
85 Result(const Result& res);
86
87 /** Copy constructor that copies only those entries whose IDs can be found in the given HashSet. */
88 Result(const Result& res, const HashSet<String>& IDs);
89
90 /* Destructor.
91 */
92 virtual ~Result();
93
94 /** Clear all ResultData from this object. \n
95 Method information and description will be retained. */
96 void clear();
97
98 /** Copy the content of 'res' into this Result object */
99 void operator = (const Result& res);
100
101 /** Add the content of 'res' to this Result object */
102 void operator += (const Result& res);
103
104 /** Get the Method of the Result.
105 @return Method
106 */
107 Result::Method getMethod();
108
109 /** Get the Method string of the Result.
110 @return Method string
111 */
112 String getMethodString();
113
114 /** Set the Method of the Result.
115 @param Method
116 */
117 void setMethod(Result::Method _method);
118
119 /** Get the list of all input conformation UIDs.
120 @return vector of UIDs
121 */
122 const vector < String > * getInputConformations();
123
124 /** Get the input conformation of the result for a specific Ligand.
125 @param pointer to Ligand
126 @return pointer to input Conformation
127 @throws BALL::Exception::GeneralException
128 */
129 Conformation* getInputConformer(Ligand* lig);
130
131 /** Get the first output conformation of the result for a specific Ligand.
132 @param pointer to Ligand
133 @return pointer to first output Conformation
134 @throws BALL::Exception::GeneralException
135 */
136 Conformation* getFirstOutputConformation(Ligand* lig);
137
138 /** Get the all output conformation of the result for a specific Ligand.
139 @param pointer to Ligand
140 @return vector of ResultData for each output conformation
141 */
142 vector < Result::ResultData > getOutputConformations(Ligand* lig);
143
144 const HashSet<String>* getInputIds();
145 HashSet<String> getOutputIds();
146 ResultData getOutputData(String id);
147 bool hasOutputData(String id);
148
149 /** Add a result entry for a Ligand conformation.
150 @param pointer to Ligand input conformation
151 @param ResultData
152 */
153 void add(Conformation* lig_conf_in, ResultData &rd);
154
155 /** Add a result entry for a Ligand conformation.
156 @param pointer to Ligand input conformation
157 @param pointer to Ligand output conformation
158 @param scoring method
159 @param energy
160 @param receptor conformation
161 */
162 void add(Conformation* lig_conf_in, Conformation* lig_conf_out, int scoringmethod, double energy, Conformation* rec_conf);
163
164 void add(const String& lig_conf_in, const String& lig_conf_out, int scoringmethod, double energy, const String& rec_conf);
165
166 /** Add a result entry for a Ligand conformation.
167 @param Ligand input conformation String
168 @param ResultData
169 */
170 void add(String lig_conf_id_in, Result::ResultData &rd);
171
172 /** Get result entries for a Ligand conformation String.
173 @param Ligand input conformation String
174 @return ResultData
175 */
176 const vector<Result::ResultData>* get(String inpose_id);
177
178 static String toString(const ResultData &rd);
179
180 /** Remove the result data for all conformations of the given FlexibleMolecule from this Result object. */
181 void erase(const FlexibleMolecule* flexmol);
182
183 void erase(const String& ID);
184
185 void sort(const list<String>& input_order, list<String>& output_order);
186
187 void setTimestamp(const String& timestamp);
188
189 const String& getTimestamp();
190
191 void setDescription(const String& text);
192
193 const String& getDescription();
194
195 void setToolInfo(const String& toolinfo);
196
197 const String& getToolInfo();
198
199 const HashMap<String, vector<ResultData> >* getData();
200
201 protected:
202
203 String timestamp_;
204 String toolinfo_;
205 Result::Method method;
206 HashMap<String, vector<ResultData> > result_data_;
207 HashMap<String, ResultData> result_output_data_;
208 vector < String > input_conformations_;
209 HashSet < String > input_conformations_map_;
210
211 /** Optional String describing the method or approach that was use to generate this result (e.g. the name of the docking or rescoring algorithm) */
212 String description_;
213 };
214 }
215 #endif /* BALL_DOCKING_RESULT_H */