/usr/include/BALL/FORMAT/dockResultFile.h is in libball1.4-dev 1.4.3~beta1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | // ----------------------------------------------------
// $Maintainer: Marc Röttig $
// $Authors: Marc Röttig, Marcel Schumann $
// ----------------------------------------------------
#ifndef BALL_FORMAT_DOCKRESULTFILE_H
#define BALL_FORMAT_DOCKRESULTFILE_H
#include <BALL/FORMAT/PDBFile.h>
#include <BALL/DATATYPE/hashMap.h>
#include <BALL/DOCKING/COMMON/result.h>
#include <BALL/DOCKING/COMMON/receptor.h>
#include <QtXml/QXmlDefaultHandler>
#include <QtXml/QXmlStreamReader>
#include <QtXml/QXmlStreamWriter>
#include <QtCore/QFile>
#include <QtCore/QTemporaryFile>
#include <vector>
namespace BALL
{
/** DockResultFile class.
Used to store docking results.
*/
class BALL_EXPORT DockResultFile : public GenericMolFile
{
public:
static bool SHOW_IDENTICAL_LIGANDS_WARNING;
BALL_CREATE(DockResultFile)
DockResultFile();
DockResultFile(const String& name, File::OpenMode open_mode = std::ios::in);
virtual ~DockResultFile() throw();
/** Read receptor object.
@return Receptor* pointer to the read Receptor object
*/
Receptor* readReceptor() throw(Exception::ParseError);
/** Write receptor object (directly).
@param pointer to Receptor object
*/
void writeReceptor(Receptor* s);
/** Read receptor object.
@return Ligand* pointer to the read Ligand object
*/
Ligand* readLigand() throw(Exception::ParseError);
/** Write Ligand object (directly).
@param pointer to Ligand object
*/
bool writeLigand(Ligand* lig);
/** Write Result object (directly).
@param pointer to Result object
*/
void writeResult(Result* res);
/** Write vector of Result objects (directly).
@param vector of pointers to Result objects
*/
void writeResults(vector<Result*>& res);
/** Read result objects.
@return vector of Result pointers
*/
vector<Result*> readResults() throw(Exception::ParseError);
/** Close file. */
void close();
const vector<Result*>* getResults();
void addResult(Result* res);
/** Return the number of unique conformations currently stored in the result-sections of this DockResultFile. */
Size countConformations();
/** @name GenericMolecule interface functions */
//@{
Molecule* read() throw (Exception::ParseError);
bool write(const Molecule& mol) throw (File::CannotWrite);
void setOutputParameters(Result::Method, String property_name, String& receptor_conf_UID, String method_description="");
void setToolInfo(const String& toolinfo, const String& timestamp);
void setInputParameters(list<Size>& selected_results);
void selectAllResultsForInput();
/** Disables the automatic creation of Results-items when using write(const Molecule& mol). However, this is only necessary when merging/sorting DockingFiles when Results are set manually. */
void disableAutomaticResultCreation();
/** Return the current Ligand object that was created by the last call of read() or write(const Molecule& mol). */
const FlexibleMolecule* getCurrentLigand();
//@}
private:
static const String VERSION;
Result* receptor_result_;
bool closed_;
bool mode_read_;
String filename_;
String timestamp_;
String toolinfo_;
// --- for use of GenericMolFile interface functions ---
vector<Conformation*> gmf_input_conformations_;
static FlexibleMolecule* gmf_current_ligand_;
static FlexibleMolecule* gmf_last_ligand_;
static bool gmf_new_ligand_read_;
HashSet<String> gmf_input_conformation_IDs_;
String gmf_property_name_;
Result* gmf_result_;
Result* gmf_import_;
Result::Method gmf_result_method_;
String gmf_result_description_;
String gmf_receptor_conf_UID_;
bool gmf_result_creation_disabled_;
// ---------------------------------
/* Stores the IDs of the Ligands that have already been written to file in order to make sure that identical molecules are not written multiple times. */
HashSet<String> written_ligand_IDs_;
QXmlStreamReader* xmlIn_;
QFile* file_;
// output file handles
QTemporaryFile* resultfileTmp_;
QTemporaryFile* ligandfileTmp_;
QTemporaryFile* receptorfileTmp_;
QFile* resultfile_;
QFile* ligandfile_;
QFile* receptorfile_;
QXmlStreamWriter* xmlOutReceptor_;
QXmlStreamWriter* xmlOutLigand_;
QXmlStreamWriter* xmlOutResult_;
vector<Result*> results_;
Receptor* receptor_;
vector<Ligand*> ligands_;
// receptors
Protein* current_protein_;
Chain* current_chain_;
Residue* current_residue_;
vector<PDBAtom*> current_PDB_atoms_;
HashMap<String,Vector3> pdb_atom_coords_;
Position flexdef_idx;
FlexDefinition current_flexdef_;
Receptor* current_receptor_;
Ligand* current_ligand_;
String current_ligand_id_;
String current_receptor_id_;
Molecule* current_molecule_;
String current_molecule_id_;
String current_conformation_id_;
String current_molecule_name_;
String current_protein_name_;
Atom* current_atom_;
Vector3 current_coords_;
vector<Atom*> current_atoms_;
vector<int> bonds_from_;
vector<int> bonds_to_;
vector<int> bonds_order_;
HashMap<Size,Vector3> current_conformation_data_;
// results
Result* current_result_;
String current_Result_InputPoseId_;
void addReceptor(Receptor* s);
void addLigand(Ligand* lig);
void concatenate();
// receptor write
void writeReceptors(QXmlStreamWriter &out);
void writeReceptor(Receptor* recep, QXmlStreamWriter &out);
void writeProtein(Protein* prot, QXmlStreamWriter &out);
void writeResidue(Residue* res, QXmlStreamWriter &out);
void writePDBAtom(PDBAtom* at, QXmlStreamWriter &out);
void writePDBAtom(Atom* at, QXmlStreamWriter &out);
void writeConformation(Conformation* conf, QXmlStreamWriter &out);
void writeFlexibility(const FlexDefinition &fd, QXmlStreamWriter &out);
void writeRotamericFlexibleResidue(Position idx, QXmlStreamWriter &out);
void writeFullyFlexibleResidue(Position idx, QXmlStreamWriter &out);
// receptor read
bool readReceptors_() throw(Exception::ParseError);
bool readReceptor_() throw(Exception::ParseError);
bool readProtein() throw(Exception::ParseError);
bool readResidue() throw(Exception::ParseError);
bool readPDBAtom() throw(Exception::ParseError);
// result read
bool readResults_() throw(Exception::ParseError);
bool readResult() throw(Exception::ParseError);
bool readSubResult() throw(Exception::ParseError);
bool readEntry() throw(Exception::ParseError);
// result write
void writeResults(QXmlStreamWriter &out);
void writeResult(Result* result, QXmlStreamWriter &out);
void writeResultData(const Result::ResultData &rd, QXmlStreamWriter &out);
// ligand write
void writeLigands(QXmlStreamWriter &out);
bool writeLigand(Ligand* lig, QXmlStreamWriter &out);
void writeMolecule(Molecule* mol, QXmlStreamWriter &out);
void writeAtom(Atom* at, QXmlStreamWriter &out);
void writeBond(Bond* b, QXmlStreamWriter &out);
// ligand read
bool readLigands() throw(Exception::ParseError);
bool readLigand_() throw(Exception::ParseError);
bool readMolecule() throw(Exception::ParseError);
bool readConformations(FlexibleMolecule* target) throw(Exception::ParseError);
bool readConformation(Conformation* conformation) throw(Exception::ParseError);
bool readCoordinates() throw(Exception::ParseError);
bool readFlexibility() throw(Exception::ParseError);
bool readFlexibilities() throw(Exception::ParseError);
bool readFullFlexResidue() throw(Exception::ParseError);
bool readRotamericResidue() throw(Exception::ParseError);
bool readAtoms() throw(Exception::ParseError);
bool readAtom() throw(Exception::ParseError);
bool readBonds() throw(Exception::ParseError);
bool readBond() throw(Exception::ParseError);
// building
void buildLigand() throw(Exception::ParseError);
void buildMolecule() throw(Exception::ParseError);
void buildReceptor() throw(Exception::ParseError);
void buildProtein() throw(Exception::ParseError);
void buildResidue() throw(Exception::ParseError);
// helper methods
bool retrieveInt(const String& s, int &out);
bool retrieveFloat(const String& s, float &out);
void setElement(Atom* at, String symbol);
bool setCoordinate(const int& idx , const String& coord);
static String fromQString(const QString &s);
static QString toQString(const String &s);
static void attributesToHashMap(const QXmlAttributes& attributes, HashMap<String,String>& map);
static void attributesToHashMap(const QXmlStreamAttributes& attributes, HashMap<String,String>& map);
static bool isAminoAcid(String s);
// we do not allow copy construction ..
DockResultFile(const DockResultFile &df);
// .. and assignment
DockResultFile& operator=(const DockResultFile &df);
// XML tags
static String ROOTTAG;
static String RECEPTORSTAG;
static String RECEPTORTAG;
static String RECEPTOR_A_ID;
static String PROTEINTAG;
static String PROTEIN_A_NAME;
static String CONFORMATIONSTAG;
static String CONFORMATIONTAG;
static String CONFORMATION_A_ID;
static String FLEXIBILITIESTAG;
static String FLEXIBILITYTAG;
static String RESIDUETAG;
static String RESIDUE_A_NAME;
static String RESIDUE_A_IDX;
static String PDBATOMTAG;
static String PDBATOM_A_NAME;
static String RESULTSTAG;
static String RESULTTAG;
static String RESULT_A_METHOD;
static String RESULT_A_METHODSTRING;
static String SUBRESULTTAG;
static String SUBRESULT_A_LIGCONFID;
static String RESULTDATATAG;
static String POSEDATATAG;
static String RESULTDATA_A_ENERGY;
static String RESULTDATA_A_CONFID;
static String RESULTDATA_A_LIGID;
static String RESULTDATA_A_METHOD;
static String LIGANDSTAG;
static String LIGANDTAG;
static String LIGAND_A_ID;
static String MOLECULETAG;
static String MOLECULE_A_NAME;
static String ATOMTAG;
static String ATOM_A_ELEMENT;
static String ATOMSTAG;
static String BONDSTAG;
static String BONDTAG;
static String BOND_A_FROM;
static String BOND_A_TO;
static String BOND_A_ORDER;
};
}
#endif
|