RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
Annotation.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// Simple struct for holding annotation information associated with
14// intermolecular scores
15
16#ifndef _RBTANNOTATION_H_
17#define _RBTANNOTATION_H_
18
19#include "rxdock/Atom.h"
20#include "rxdock/Config.h"
21
22#include <nlohmann/json.hpp>
23
24using json = nlohmann::json;
25
26namespace rxdock {
27
29public:
31 // Constructors/destructors
32 Annotation(const Atom *pAtom1, const Atom *pAtom2, double dist, double score);
33 Annotation(json j);
34 virtual ~Annotation();
35
36 friend void to_json(json &j, const Annotation &annotation);
37 friend void from_json(const json &j, Annotation &annotation);
38
40 // Public methods
42 // Get
43 const Atom *GetAtom1Ptr() const;
44 const Atom *GetAtom2Ptr() const;
45 double GetDistance() const;
46 double GetScore() const;
47 // Get the fully qualified (FQ) residue name for atom 2 (target atom)
48 std::string GetFQResName() const;
49
50 // Set
51 void SetAtom1Ptr(const Atom *pAt1);
52 void SetAtom2Ptr(const Atom *pAt2);
53 void SetDistance(double d);
54 void SetScore(double s);
55
56 // Render annotation into string in rDock Viewer format
57 std::string Render() const;
58
59 // Operators
60 // Special meaning of operator+ for accumulating annotations by residue
61 void operator+=(const Annotation &ann);
62
63protected:
65 // Protected methods
67
68private:
70 // Private methods
72 Annotation(); // Disable default constructor
73 // Annotation(const Annotation&);//Copy constructor disabled by default
74 // Annotation& operator=(const Annotation&);//Copy assignment disabled
75 // by default
76
77protected:
79 // Protected data
81
82private:
84 // Private data
86 const Atom *m_pAtom1;
87 const Atom *m_pAtom2;
88 double m_dist;
89 double m_score;
90};
91
92// Useful typedefs
93typedef SmartPtr<Annotation> AnnotationPtr; // Smart pointer
94typedef std::vector<AnnotationPtr> AnnotationList; // Vector of smart pointers
95typedef AnnotationList::iterator AnnotationListIter;
96typedef AnnotationList::const_iterator AnnotationListConstIter;
97
99// Non-member functions (in rxdock namespace)
101void to_json(json &j, const Annotation &annotation);
102void from_json(const json &j, Annotation &annotation);
103
105// Comparison functions for sorting Annotation* containers
106// For use by STL sort algorithms
108
109// Less than operator for sorting Annotation*'s by the atom ID of atom 2
110// (target)
112public:
113 bool operator()(Annotation *pAnn1, Annotation *pAnn2) const {
114 return pAnn1->GetAtom2Ptr()->GetAtomId() <
115 pAnn2->GetAtom2Ptr()->GetAtomId();
116 }
117};
118
119} // namespace rxdock
120
121#endif //_RBTANNOTATION_H_
Definition Annotation.h:111
Definition Annotation.h:28
Definition Atom.h:49
Definition SmartPointer.h:48