RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
TriposAtomType.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// Atom typing class for Tripos 5.2 forcefield
14
15#ifndef _RBTTRIPOSATOMTYPE_H_
16#define _RBTTRIPOSATOMTYPE_H_
17
18#include "rxdock/Config.h"
19
20#include <nlohmann/json.hpp>
21
22using json = nlohmann::json;
23
24namespace rxdock {
25
26class Atom;
27
29public:
31 // Enums
33
34 // Atom types
35 enum eType {
36 UNDEFINED = 0,
37 Al,
38 Br,
39 C_cat,
40 C_1,
41 C_1_H1,
42 C_2,
43 C_2_H1,
44 C_2_H2,
45 C_3,
46 C_3_H1,
47 C_3_H2,
48 C_3_H3,
49 C_ar,
50 C_ar_H1,
51 Ca,
52 Cl,
53 Du,
54 F,
55 H,
56 H_P,
57 I,
58 K,
59 Li,
60 LP,
61 N_1,
62 N_2,
63 N_3,
64 N_4,
65 N_am,
66 N_ar,
67 N_pl3,
68 Na,
69 O_2,
70 O_3,
71 O_co2,
72 P_3,
73 S_2,
74 S_3,
75 S_o,
76 S_o2,
77 Si,
78 MAXTYPES // KEEP AS LAST TYPE: used to size the atom name string list
79 };
80
81 struct info {
82 std::string name;
83 int atomicNo;
84 int hybrid;
85 info() : atomicNo(0), hybrid(0) {}
86 info(const std::string &n, int a, int h)
87 : name(n), atomicNo(a), hybrid(h) {}
88 };
89
91 // Constructors/destructors
92
93 RBTDLL_EXPORT TriposAtomType();
94 RBTDLL_EXPORT virtual ~TriposAtomType();
95
96 friend void to_json(json &j, const TriposAtomType &triposAtomType);
97 friend void from_json(const json &j, TriposAtomType &triposAtomType);
98
100 // Public methods
102
103 // Returns Tripos atom type for given atom
104 // If useExtendedTypes is true, pseudo types for extended carbons and polar Hs
105 // are used
106 eType operator()(Atom *pAtom, bool useExtendedTypes = false) const;
107 // Converts Tripos type to string
108 RBTDLL_EXPORT std::string Type2Str(eType) const;
109 // Get hybridisation from Tripos type
110 int Type2Hybrid(eType) const;
111 // Get atomic number from Tripos type
112 int Type2AtomicNo(eType) const;
113 // Converts string to Tripos type
114 RBTDLL_EXPORT eType Str2Type(const std::string &) const;
115
116protected:
118 // Protected methods
120
121private:
123 // Private methods
125 void SetupTypeInfo();
126
127protected:
129 // Protected data
131
132private:
134 // Private data
136 std::vector<info> m_typeInfo;
137};
138
139void to_json(json &j, const TriposAtomType &triposAtomType);
140void from_json(const json &j, TriposAtomType &triposAtomType);
141
142// Useful typedefs
143typedef std::vector<TriposAtomType::info> TriposInfoList;
144typedef TriposInfoList::iterator TriposInfoListIter;
145typedef TriposInfoList::const_iterator TriposInfoListConstIter;
146
147typedef std::vector<TriposAtomType::eType> TriposAtomTypeList;
148typedef TriposAtomTypeList::iterator TriposAtomTypeListIter;
149typedef TriposAtomTypeList::const_iterator TriposAtomTypeListConstIter;
150
151} // namespace rxdock
152
153#endif //_RBTTRIPOSATOMTYPE_H_
Definition Atom.h:49
Definition TriposAtomType.h:28
Definition TriposAtomType.h:81