RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
AromIdxSF.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// Indexed-grid-based intermolecular aromatic scoring function
14
15#ifndef _RBTAROMIDXSF_H_
16#define _RBTAROMIDXSF_H_
17
18#include "rxdock/AnnotationHandler.h"
19#include "rxdock/BaseIdxSF.h"
20#include "rxdock/BaseInterSF.h"
21#include "rxdock/Plane.h"
22
23#include <nlohmann/json.hpp>
24
25using json = nlohmann::json;
26
27namespace rxdock {
28
29class AromIdxSF : public BaseInterSF,
30 public BaseIdxSF,
31 public AnnotationHandler {
32public:
33 // Class type string
34 static const std::string _CT;
35 // Parameter names
36 static const std::string _INCR;
37 static const std::string _R12;
38 static const std::string _DR12MIN;
39 static const std::string _DR12MAX;
40 static const std::string _DAMIN;
41 static const std::string _DAMAX;
42 // DM 12 Jun 2002 - score threshold used for counting aromatic interactions
43 static const std::string _THRESHOLD;
44
45 AromIdxSF(const std::string &strName = "arom");
46 virtual ~AromIdxSF();
47
48 friend void to_json(json &j, const AromIdxSF &aromIdxSF);
49 friend void from_json(const json &j, AromIdxSF &aromIdxSF);
50
51 // Override BaseSF::ScoreMap to provide additional raw descriptors
52 // virtual void ScoreMap(StringVariantMap& scoreMap) const;
53
54protected:
55 virtual void SetupReceptor();
56 virtual void SetupLigand();
57 virtual void SetupScore();
58 virtual double RawScore() const;
59
60 // Clear the receptor and ligand grids and lists respectively
61 // As we are not using smart pointers, there is some memory management to do
62 void ClearReceptor();
63 void ClearLigand();
64
65 // DM 25 Oct 2000 - track changes to parameter values in local data members
66 // ParameterUpdated is invoked by ParamHandler::SetParameter
67 void ParameterUpdated(const std::string &strName);
68
69private:
71 // DM 6 Feb 2003
72 // To be consistent with the Polar score, we should really define a base
73 // AromSF class which will provide the scoring function primitives, then
74 // have an AromIdxSF subclass for intermolecular aromatic interactions, and
75 // a AromIntraSF subclass for ligand intramolecular interactions. Currently
76 // there is no AromIntraSF class so everything is contained within
77 // AromIdxSF
78
79 // Generic scoring function params
80 struct f1prms {
81 double R0, DRMin, DRMax, slope;
82 f1prms(double R, double DMin, double DMax)
83 : R0(R), DRMin(DMin), DRMax(DMax), slope(1.0 / (DMax - DMin)) {}
84 };
85
86 inline f1prms GetRprms() const { return f1prms(m_R12, m_DR12Min, m_DR12Max); }
87 inline f1prms GetAprms() const { return f1prms(0.0, m_DAMin, m_DAMax); }
88
89 // Generic scoring function primitive (deviation from ideal geometry)
90 inline double f1(double DR, const f1prms &prms) const {
91 return (DR > prms.DRMax) ? 0.0
92 : (DR > prms.DRMin) ? 1.0 - prms.slope * (DR - prms.DRMin)
93 : 1.0;
94 }
95
96 // The actual aromatic score, between a given interaction center and a list of
97 // near neighbour centers
98 double AromScore(const InteractionCenter *pIC1,
99 const InteractionCenterList &IC2List, const f1prms &Rprms,
100 const f1prms &Aprms) const;
101 double PiScore(const InteractionCenter *pIC1,
102 const InteractionCenterList &IC2List) const;
103 // End of section that should ultimately be moved to AromSF base class
105
106 InteractionGridPtr m_spAromGrid;
107 InteractionGridPtr m_spGuanGrid;
108 InteractionCenterList m_recepAromList;
109 InteractionCenterList m_recepGuanList;
110 InteractionCenterList m_ligAromList;
111 InteractionCenterList m_ligGuanList;
112
113 // DM 25 Oct 2000 - local copies of params
114 double m_R12;
115 double m_DR12Min;
116 double m_DR12Max;
117 double m_DAMin;
118 double m_DAMax;
119
120 // DM 12 Jun 2002 - keep track of number of ligand rings and guan carbons
121 // involved in non-zero arom interactions
122 mutable int m_nArom;
123 mutable int m_nGuan;
124 mutable double m_ss; // Sigma-sigma score
125 mutable double m_sp; // Sigma-pi score
126 mutable double m_pp; // pi-pi score
127 double m_threshold;
128};
129
130void to_json(json &j, const Bond &bond);
131void from_json(const json &j, Bond &bond);
132
133} // namespace rxdock
134
135#endif //_RBTAROMIDXSF_H_
Definition AnnotationHandler.h:28
Definition AromIdxSF.h:31
Definition BaseIdxSF.h:30
Definition BaseInterSF.h:27
Definition Bond.h:27
Definition InteractionGrid.h:29