6 #ifndef BALL_FORMAT_DOCKRESULTFILE_H 7 #define BALL_FORMAT_DOCKRESULTFILE_H 14 #include <QtXml/QXmlDefaultHandler> 15 #include <QtCore/QXmlStreamReader> 16 #include <QtCore/QXmlStreamWriter> 17 #include <QtCore/QFile> 18 #include <QtCore/QTemporaryFile> 57 bool writeLigand(
Ligand* lig);
62 void writeResult(
Result* res);
67 void writeResults(vector<
Result*>& res);
73 vector<
Result*> readResults();
78 const vector<
Result*>* getResults();
79 void addResult(
Result* res);
82 Size countConformations();
94 void setOutputParameters(
Result::Method,
String property_name,
String& receptor_conf_UID,
String method_description="");
96 void setToolInfo(const
String& toolinfo, const
String& timestamp);
98 void setInputParameters(list<
Size>& selected_results);
100 void selectAllResultsForInput();
103 void disableAutomaticResultCreation();
114 static const
String VERSION;
128 static
bool gmf_new_ligand_read_;
130 String gmf_property_name_;
133 Result::Method gmf_result_method_;
134 String gmf_result_description_;
135 String gmf_receptor_conf_UID_;
136 bool gmf_result_creation_disabled_;
142 QXmlStreamReader* xmlIn_;
146 QTemporaryFile* resultfileTmp_;
147 QTemporaryFile* ligandfileTmp_;
148 QTemporaryFile* receptorfileTmp_;
151 QFile* receptorfile_;
152 QXmlStreamWriter* xmlOutReceptor_;
153 QXmlStreamWriter* xmlOutLigand_;
154 QXmlStreamWriter* xmlOutResult_;
162 Chain* current_chain_;
165 vector<
PDBAtom*> current_PDB_atoms_;
172 String current_ligand_id_;
173 String current_receptor_id_;
175 String current_molecule_id_;
176 String current_conformation_id_;
177 String current_molecule_name_;
178 String current_protein_name_;
181 vector<
Atom*> current_atoms_;
182 vector<
int> bonds_from_;
183 vector<
int> bonds_to_;
184 vector<
int> bonds_order_;
189 String current_Result_InputPoseId_;
192 void addLigand(
Ligand* lig);
195 void writeReceptors(QXmlStreamWriter &out);
196 void writeReceptor(
Receptor* recep, QXmlStreamWriter &out);
197 void writeProtein(
Protein* prot, QXmlStreamWriter &out);
198 void writeResidue(
Residue* res, QXmlStreamWriter &out);
199 void writePDBAtom(
PDBAtom* at, QXmlStreamWriter &out);
200 void writePDBAtom(
Atom* at, QXmlStreamWriter &out);
201 void writeConformation(
Conformation* conf, QXmlStreamWriter &out);
202 void writeFlexibility(const
FlexDefinition &fd, QXmlStreamWriter &out);
203 void writeRotamericFlexibleResidue(
Position idx, QXmlStreamWriter &out);
204 void writeFullyFlexibleResidue(
Position idx, QXmlStreamWriter &out);
206 bool readReceptors_();
207 bool readReceptor_();
214 bool readSubResult();
217 void writeResults(QXmlStreamWriter &out);
218 void writeResult(
Result* result, QXmlStreamWriter &out);
219 void writeResultData(const
Result::ResultData &rd, QXmlStreamWriter &out);
221 void writeLigands(QXmlStreamWriter &out);
222 bool writeLigand(
Ligand* lig, QXmlStreamWriter &out);
223 void writeMolecule(
Molecule* mol, QXmlStreamWriter &out);
224 void writeAtom(
Atom* at, QXmlStreamWriter &out);
225 void writeBond(
Bond* b, QXmlStreamWriter &out);
232 bool readCoordinates();
233 bool readFlexibility();
234 bool readFlexibilities();
235 bool readFullFlexResidue();
236 bool readRotamericResidue();
244 void buildMolecule();
245 void buildReceptor();
250 bool retrieveInt(const String& s,
int &out);
251 bool retrieveFloat(const String& s,
float &out);
252 void setElement(
Atom* at, String symbol);
253 bool setCoordinate(const
int& idx , const String& coord);
254 static String fromQString(const QString &s);
255 static QString toQString(const String &s);
256 static
void attributesToHashMap(const QXmlAttributes& attributes,
HashMap<String,String>& map);
257 static
void attributesToHashMap(const QXmlStreamAttributes& attributes,
HashMap<String,String>& map);
258 static
bool isAminoAcid(String s);
266 static String ROOTTAG;
267 static String RECEPTORSTAG;
268 static String RECEPTORTAG;
269 static String RECEPTOR_A_ID;
270 static String PROTEINTAG;
271 static String PROTEIN_A_NAME;
272 static String CONFORMATIONSTAG;
273 static String CONFORMATIONTAG;
274 static String CONFORMATION_A_ID;
275 static String FLEXIBILITIESTAG;
276 static String FLEXIBILITYTAG;
277 static String RESIDUETAG;
278 static String RESIDUE_A_NAME;
279 static String RESIDUE_A_IDX;
280 static String PDBATOMTAG;
281 static String PDBATOM_A_NAME;
283 static String RESULTSTAG;
284 static String RESULTTAG;
285 static String RESULT_A_METHOD;
286 static String RESULT_A_METHODSTRING;
287 static String SUBRESULTTAG;
288 static String SUBRESULT_A_LIGCONFID;
289 static String RESULTDATATAG;
290 static String POSEDATATAG;
291 static String RESULTDATA_A_ENERGY;
292 static String RESULTDATA_A_CONFID;
293 static String RESULTDATA_A_LIGID;
294 static String RESULTDATA_A_METHOD;
296 static String LIGANDSTAG;
297 static String LIGANDTAG;
298 static String LIGAND_A_ID;
299 static String MOLECULETAG;
300 static String MOLECULE_A_NAME;
301 static String ATOMTAG;
302 static String ATOM_A_ELEMENT;
303 static String ATOMSTAG;
304 static String BONDSTAG;
305 static String BONDTAG;
306 static String BOND_A_FROM;
307 static String BOND_A_TO;
308 static String BOND_A_ORDER;
static bool SHOW_IDENTICAL_LIGANDS_WARNING
HashMap class based on the STL map (containing serveral convenience functions)
std::ios::openmode OpenMode