RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
Constraint.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// Base class for pharmacophore constraints
14
15#ifndef _RBT_CONSTRAINT_H_
16#define _RBT_CONSTRAINT_H_
17
18#include "rxdock/Atom.h"
19#include "rxdock/Coord.h"
20#include "rxdock/Error.h"
21#include "rxdock/Model.h"
22
23#include <nlohmann/json.hpp>
24
25using json = nlohmann::json;
26
27namespace rxdock {
28
30public:
31 static const std::string _CT;
33 // Constructors
35 Constraint(Coord, double);
36 Constraint(const Constraint &);
37 Constraint();
38
39 Constraint(json j);
40
41 friend void to_json(json &j, const Constraint &constraint);
42 friend void from_json(const json &j, Constraint &constraint);
43
45 // Destructor
47 virtual ~Constraint();
48
49 void copy(const Constraint &);
50 std::ostream &Print(std::ostream &) const;
51 friend std::ostream &operator<<(std::ostream &, const Constraint &);
52
53 Coord GetCoords() const { return coord; }
54 double GetTolerance() const { return tolerance; }
55 virtual void AddAtomList(ModelPtr, bool bCheck = true) = 0;
56 double Score() const;
57
59 // Private methods
61protected:
62 Coord coord;
63 double tolerance;
64 AtomList m_atomList;
65
66private:
68 // Private data
70};
71
72void to_json(json &j, const Constraint &constraint);
73void from_json(const json &j, Constraint &constraint);
74
75// Useful typedefs
76typedef SmartPtr<Constraint> ConstraintPtr; // Smart pointer
77typedef std::vector<ConstraintPtr> ConstraintList; // Vector of smart pointers
78typedef ConstraintList::iterator ConstraintListIter;
79typedef ConstraintList::const_iterator ConstraintListConstIter;
80
81ConstraintPtr CreateConstraint(Coord &c, double &t, std::string &n,
82 bool bCount = true);
83void ZeroCounters();
84void ReadConstraint(std::istream &ifile, ConstraintPtr &cnt,
85 bool bCount = true);
86void ReadConstraintFromMoe(std::istream &ifile, ConstraintPtr &cnt,
87 bool bCount = true);
88void ReadStartMoe(std::istream &ifile);
89void ReadConstraints(std::istream &ii, ConstraintList &cl, bool bCount = true);
90
91// 7 Feb 2005 (DM, Enspiral Discovery)
92// New constraint type - any heavy atom
93// Likely to be inefficient for large ligands, but has the advantage
94// of being simple to code and run
96public:
97 HeavyConstraint(Coord c, double t) : Constraint(c, t) {}
98 void AddAtomList(ModelPtr, bool bCheck = true);
99 static unsigned int counter;
100};
101
102class HBAConstraint : public Constraint {
103public:
104 HBAConstraint(Coord c, double t) : Constraint(c, t) {}
105 void AddAtomList(ModelPtr, bool bCheck = true);
106 static unsigned int counter;
107};
108
109class HBDConstraint : public Constraint {
110public:
111 HBDConstraint(Coord c, double t) : Constraint(c, t) {}
112 void AddAtomList(ModelPtr, bool bCheck = true);
113 static unsigned int counter;
114};
115
117public:
118 HydroConstraint(Coord c, double t) : Constraint(c, t) {}
119 void AddAtomList(ModelPtr, bool bCheck = true);
120 static unsigned int counter;
121};
122
124public:
125 HydroAliphaticConstraint(Coord c, double t) : Constraint(c, t) {}
126 void AddAtomList(ModelPtr, bool bCheck = true);
127 static unsigned int counter;
128};
129
131public:
132 HydroAromaticConstraint(Coord c, double t) : Constraint(c, t) {}
133 void AddAtomList(ModelPtr, bool bCheck = true);
134 static unsigned int counter;
135};
136
138public:
139 NegChargeConstraint(Coord c, double t) : Constraint(c, t) {}
140 void AddAtomList(ModelPtr, bool bCheck = true);
141 static unsigned int counter;
142};
143
145public:
146 PosChargeConstraint(Coord c, double t) : Constraint(c, t) {}
147 void AddAtomList(ModelPtr, bool bCheck = true);
148 static unsigned int counter;
149};
150
152public:
153 RingAromaticConstraint(Coord c, double t) : Constraint(c, t) {}
154 void AddAtomList(ModelPtr, bool bCheck = true);
155 static unsigned int counter;
156};
157
158} // namespace rxdock
159
160#endif //_Constraint_H_
Definition Constraint.h:29
Definition Coord.h:45
Definition Constraint.h:102
Definition Constraint.h:109
Definition Constraint.h:95
Definition Constraint.h:123
Definition Constraint.h:130
Definition Constraint.h:116
Definition Constraint.h:137
Definition Constraint.h:144
Definition Constraint.h:151