RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
NoeRestraint.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Miscellaneous helper classes/structs for handling NOE interactions
14
15#ifndef _RBTNOERESTRAINT_H_
16#define _RBTNOERESTRAINT_H_
17
18#include "rxdock/Atom.h"
19
20#include <nlohmann/json.hpp>
21
22using json = nlohmann::json;
23
24namespace rxdock {
25
26// NOE Restraint type
27// UNDEFINED: undefined restraint type
28// OR: The distance to each of the atoms in the list is calculated separately,
29// and any of these can satisfy the restraint.
30// In practice, this means only the shortest distance is scored
31// MEAN: The distance to the mean coords of the atoms in the list is calculated,
32// and used to evaluate the restraint
33// OR: The distance to each of the atoms in the list is calculated separately,
34// and all of these should satisfy the restraint.
35// In practice, this means only the longest distance is scored
36enum eNoeType { NOE_UNDEFINED, NOE_OR, NOE_MEAN, NOE_AND };
37
38// Returns a string representing the NOE restraint type
39std::string ConvertNoeRestraintTypeToString(const eNoeType type);
40
42// Simple struct for holding one end of an NOE restraint
43// Has an atom name string list and a restraint type
45public:
46 NoeEndNames() {}
47 bool isOK() const;
48 // Public data
49 std::vector<std::string> names;
50 eNoeType type;
51
52 friend void to_json(json &j, const NoeEndNames &noeEndNames);
53 friend void from_json(const json &j, NoeEndNames &noeEndNames);
54};
55
56void to_json(json &j, const NoeEndNames &noeEndNames);
57void from_json(const json &j, NoeEndNames &noeEndNames);
58
59// Insertion operator for the above
60std::ostream &operator<<(std::ostream &s, const NoeEndNames &n);
61
63// As above, but with a real atom list in place of the string list
65public:
66 // Default constructor
67 NoeEndAtoms() {}
68 // Constructor accepting an NoeEndNames and an atom list to match against
69 NoeEndAtoms(const NoeEndNames &n, const AtomList &atomList);
70 bool isOK() const;
71 // Public data
72 AtomList atoms;
73 eNoeType type;
74
75 friend void to_json(json &j, const NoeEndAtoms &noeEndAtoms);
76 friend void from_json(const json &j, NoeEndAtoms &noeEndAtoms);
77};
78
79void to_json(json &j, const NoeEndAtoms &noeEndAtoms);
80void from_json(const json &j, NoeEndAtoms &noeEndAtoms);
81
82// Insertion operator for the above
83std::ostream &operator<<(std::ostream &s, const NoeEndAtoms &n);
84
86// Simple struct for holding a complete NOE restraint definition
87// Has two NoeEndNames, and max distance
89public:
90 NoeRestraintNames() : maxDist(5.0) {}
91 bool isOK() const;
92 // Public data
93 NoeEndNames from;
94 NoeEndNames to;
95 double maxDist;
96
97 friend void to_json(json &j, const NoeRestraintNames &noeRestraintNames);
98 friend void from_json(const json &j, NoeRestraintNames &noeRestraintNames);
99};
100
101void to_json(json &j, const NoeRestraintNames &noeRestraintNames);
102void from_json(const json &j, NoeRestraintNames &noeRestraintNames);
103
104// Insertion operator for the above
105std::ostream &operator<<(std::ostream &s, const NoeRestraintNames &noe);
106
108// As above, but with real NoeEndAtoms in place of NoeEndNames
110public:
111 // Default constructor
112 NoeRestraintAtoms() : maxDist(5.0) {}
113 // Constructor accepting an NoeRestraintNames and an atom list to match
114 // against
115 NoeRestraintAtoms(const NoeRestraintNames &n, const AtomList &atomList);
116 bool isOK() const; // true if at least one atom at each end of the NOE and
117 // NOE type is not undefined
118 bool isSimple()
119 const; // true if exactly one atom at each end of the NOE (unambiguous)
120 // Public data
121 NoeEndAtoms from;
122 NoeEndAtoms to;
123 // Double minDist;
124 double maxDist;
125
126 friend void to_json(json &j, const NoeRestraintAtoms &noeRestraintAtoms);
127 friend void from_json(const json &j, NoeRestraintAtoms &noeRestraintAtoms);
128};
129
130void to_json(json &j, const NoeRestraintAtoms &noeRestraintAtoms);
131void from_json(const json &j, NoeRestraintAtoms &noeRestraintAtoms);
132
133// Insertion operator for the above
134std::ostream &operator<<(std::ostream &s, const NoeRestraintAtoms &noe);
135
137// Simple struct for holding a complete STD restraint definition
138// Has one NoeEndNames, and max distance (from receptor)
140public:
141 StdRestraintNames() : maxDist(5.0) {}
142 bool isOK() const;
143 // Public data
144 NoeEndNames from;
145 double maxDist;
146
147 friend void to_json(json &j, const StdRestraintNames &stdRestraintNames);
148 friend void from_json(const json &j, StdRestraintNames &stdRestraintNames);
149};
150
151void to_json(json &j, const StdRestraintNames &stdRestraintNames);
152void from_json(const json &j, StdRestraintNames &stdRestraintNames);
153
154// Insertion operator for the above
155std::ostream &operator<<(std::ostream &s, const StdRestraintNames &std);
156
158// As above, but with real NoeEndAtoms in place of NoeEndNames
160public:
161 // Default constructor
162 StdRestraintAtoms() : maxDist(5.0) {}
163 // Constructor accepting an StdRestraintNames and an atom list to match
164 // against
165 StdRestraintAtoms(const StdRestraintNames &n, const AtomList &atomList);
166 bool isOK() const; // true if at least one atom in the definition and type
167 // is not undefined
168 bool isSimple()
169 const; // true if exactly one atom at in the STD definition (unambiguous)
170 // Public data
171 NoeEndAtoms from;
172 double maxDist;
173
174 friend void to_json(json &j, const StdRestraintAtoms &stdRestraintAtoms);
175 friend void from_json(const json &j, StdRestraintAtoms &stdRestraintAtoms);
176};
177
178void to_json(json &j, const StdRestraintAtoms &stdRestraintAtoms);
179void from_json(const json &j, StdRestraintAtoms &stdRestraintAtoms);
180
181// Insertion operator for the above
182std::ostream &operator<<(std::ostream &s, const StdRestraintAtoms &std);
183
184// Useful typedefs
185typedef std::vector<NoeRestraintNames> NoeRestraintNamesList;
186typedef NoeRestraintNamesList::iterator NoeRestraintNamesListIter;
187typedef NoeRestraintNamesList::const_iterator NoeRestraintNamesListConstIter;
188
189typedef std::vector<NoeRestraintAtoms> NoeRestraintAtomsList;
190typedef NoeRestraintAtomsList::iterator NoeRestraintAtomsListIter;
191typedef NoeRestraintAtomsList::const_iterator NoeRestraintAtomsListConstIter;
192
193typedef std::vector<StdRestraintNames> StdRestraintNamesList;
194typedef StdRestraintNamesList::iterator StdRestraintNamesListIter;
195typedef StdRestraintNamesList::const_iterator StdRestraintNamesListConstIter;
196
197typedef std::vector<StdRestraintAtoms> StdRestraintAtomsList;
198typedef StdRestraintAtomsList::iterator StdRestraintAtomsListIter;
199typedef StdRestraintAtomsList::const_iterator StdRestraintAtomsListConstIter;
200
201} // namespace rxdock
202
203#endif //_RBTNOERESTRAINT_H_
Definition NoeRestraint.h:64
Definition NoeRestraint.h:44
Definition NoeRestraint.h:109
Definition NoeRestraint.h:88
Definition NoeRestraint.h:159
Definition NoeRestraint.h:139