File size: 3,955 Bytes
8efb4bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef CHEM_ATOM_H
#define CHEM_ATOM_H

#include "Atom.h"

enum HB_TYPE {DONOR = 0, ACCEPTOR = 1, HB_BOTH = 2, NONE = 3};
enum MOL2_TYPE {C2 = 0, C3 =1 , Car = 2, Ccat = 3, N2 = 4, N4 = 5, Nam = 6,
                Nar = 7, Npl3 = 8, O2 = 9, O3 = 10, Oco2 = 11, P3 = 12, S3 = 13, UNK_MOL2_TYPE = 14 };

/*

CLASS

  ChemAtom



  This is a class that addes additional atrributes to Atom



KEYWORD

  ChemAtom, radius, charge, type, ASA, solvation



AUTHORS

  Dina Schneidman (duhovka@tau.ac.il)



  copyright: GAMBA Group , Tel-Aviv Univ. Israel, 2004.



GOALS

  ChemAtom extends Atom and has 4 additional attributes: chemical

  type, radius, charge and probability of the atom of being steady.



CHANGES LOG

<UL>

</UL>



USAGE

*/

class ChemAtom : public Atom { //, public EnergyAtom {
 public:
  // GROUP: Constructors

  //// empty atom
  ChemAtom();

  //// construction with atom data
  ChemAtom(const Vector3& p, const char ch, const unsigned int aid,
	   const unsigned int resid, const char* const t, const char resTp,
	   const int chem_type=0, const float rad=1.5, const float charge=0);

  ChemAtom(const std::string& PDBrec, bool cif = false);


  // GROUP: modifiers

  //// set chemical type
  void setChemType(const int chem_type) {
    if(chem_type <= 0 || chem_type > 18) {
      std::cerr << "Error in ChemType for atom " << *this << std::endl;
    } else {
      chemType_ = chem_type;
    }
  }

  //// set radius
  void setRadius(const float r) { radius_ = r; }

  //// set epsilon
  void setEpsilon(const float e) { epsilon_ = e; }

  //// set charge
  void setCharge(const float c) { charge_ = c; }

  //// set HB data
  void setHBData(const HB_TYPE hbType, const Vector3& hbDirection);

  //// set probability of being steady
  void setSteadyProb(const float p) { steadyProb_ = p; }

  //// set ASA
  void setASA(const float ASA) { ASA_ = ASA; }

  //// set atom position
  void setPosition(const Vector3& v) { update(v); }

  //// set mol2 type
  void setMol2Type(const MOL2_TYPE t) { mol2Type_ = t; }

  // GROUP: Inspectors

  //// get atom chemical type for ACE computation
  int getChemType() const {
    if(chemType_ <= 0 || chemType_ > 18) return 0;
    return chemType_;
  }

  //// get atom radius
  float getRadius() const { return radius_; }

  //// get epsilon value
  float getEpsilon() const { return epsilon_; }

  ////
  bool isHydrogen() const { return isH(); }

  //// get atom charge
  float getCharge() const { return charge_; }

  ////
  bool isDonor() const { return (hbType_ == HB_BOTH || hbType_ == DONOR); }

  ////
  bool isAcceptor() const { return (hbType_ == HB_BOTH || hbType_ == ACCEPTOR); }

  //// returns direction of h-donor/acceptor, in case of undefined direction zero vector is returned
  const Vector3& getHBDirection() const { return hbDirection_; }

  //// get probability of being steady
  float getSteadyProb() const { return steadyProb_; }

  //// get ASA
  float getASA() const { return ASA_; }

  ////
  bool isNonPolar() const { return isNonPolar_; }

  ////
  MOL2_TYPE getMol2Type() const { return mol2Type_; }

  Vector3 position() const {return (Atom(*this)).position(); }

  friend Vector3& operator*=(ChemAtom &v,const RigidTrans3 &rt) {
    //cout << "ChemAtom *= RigidTrans3" << endl;
    v += (rt.rotation() * v) + rt.translation() - v;
    if (!v.hbDirection_.isZero())
      v.hbDirection_ = rt.rotation() * v.hbDirection_;
    return v;
  }


  //// maximal atom radius
  static const float maxRadius;


private:
  void setPolarity();

 private:
  int chemType_; // type required for ACE computation
  float radius_;
  float charge_;
  float epsilon_; // for vdw computation
  HB_TYPE hbType_;
  Vector3 hbDirection_;
  bool isNonPolar_;
  float steadyProb_;
  float ASA_;
  MOL2_TYPE mol2Type_;
};
#endif /* IMP_CHEMATOM_H */