00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPATOM_ATOM_H
00009 #define IMPATOM_ATOM_H
00010
00011 #include "atom_config.h"
00012 #include "atom_macros.h"
00013 #include "Residue.h"
00014 #include "Hierarchy.h"
00015 #include "element.h"
00016 #include <IMP/core/utility.h>
00017 #include <IMP/core/XYZ.h>
00018 #include <IMP/core/core_macros.h>
00019
00020 #include <IMP/base_types.h>
00021 #include <IMP/Particle.h>
00022 #include <IMP/Model.h>
00023
00024 #include <vector>
00025 #include <deque>
00026
00027 IMPATOM_BEGIN_NAMESPACE
00028
00029 IMP_DECLARE_CONTROLLED_KEY_TYPE(AtomType, IMP_ATOM_TYPE_INDEX);
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 IMPATOMEXPORT extern const AtomType AT_UNKNOWN;
00060
00061 IMPATOMEXPORT extern const AtomType AT_N;
00062
00063 IMPATOMEXPORT extern const AtomType AT_CA;
00064 #ifndef IMP_DOXYGEN
00065
00066 IMPATOMEXPORT extern const AtomType AT_C;
00067
00068 IMPATOMEXPORT extern const AtomType AT_O;
00069
00070 IMPATOMEXPORT extern const AtomType AT_H;
00071
00072 IMPATOMEXPORT extern const AtomType AT_H1;
00073
00074 IMPATOMEXPORT extern const AtomType AT_H2;
00075
00076 IMPATOMEXPORT extern const AtomType AT_H3;
00077
00078 IMPATOMEXPORT extern const AtomType AT_HA;
00079
00080 IMPATOMEXPORT extern const AtomType AT_HA1;
00081
00082 IMPATOMEXPORT extern const AtomType AT_HA2;
00083
00084 IMPATOMEXPORT extern const AtomType AT_CB;
00085
00086 IMPATOMEXPORT extern const AtomType AT_HB;
00087
00088 IMPATOMEXPORT extern const AtomType AT_HB1;
00089 IMPATOMEXPORT extern const AtomType AT_HB2;
00090 IMPATOMEXPORT extern const AtomType AT_HB3;
00091 IMPATOMEXPORT extern const AtomType AT_OXT;
00092 IMPATOMEXPORT extern const AtomType AT_CH3;
00093 IMPATOMEXPORT extern const AtomType AT_CG;
00094 IMPATOMEXPORT extern const AtomType AT_CG1;
00095 IMPATOMEXPORT extern const AtomType AT_CG2;
00096 IMPATOMEXPORT extern const AtomType AT_HG;
00097 IMPATOMEXPORT extern const AtomType AT_HG1;
00098 IMPATOMEXPORT extern const AtomType AT_HG2;
00099 IMPATOMEXPORT extern const AtomType AT_HG3;
00100 IMPATOMEXPORT extern const AtomType AT_HG11;
00101 IMPATOMEXPORT extern const AtomType AT_HG21;
00102 IMPATOMEXPORT extern const AtomType AT_HG31;
00103 IMPATOMEXPORT extern const AtomType AT_HG12;
00104 IMPATOMEXPORT extern const AtomType AT_HG22;
00105 IMPATOMEXPORT extern const AtomType AT_HG32;
00106 IMPATOMEXPORT extern const AtomType AT_OG;
00107 IMPATOMEXPORT extern const AtomType AT_OG1;
00108 IMPATOMEXPORT extern const AtomType AT_SG;
00109 IMPATOMEXPORT extern const AtomType AT_CD;
00110 IMPATOMEXPORT extern const AtomType AT_CD1;
00111 IMPATOMEXPORT extern const AtomType AT_CD2;
00112 IMPATOMEXPORT extern const AtomType AT_HD;
00113 IMPATOMEXPORT extern const AtomType AT_HD1;
00114 IMPATOMEXPORT extern const AtomType AT_HD2;
00115 IMPATOMEXPORT extern const AtomType AT_HD3;
00116 IMPATOMEXPORT extern const AtomType AT_HD11;
00117 IMPATOMEXPORT extern const AtomType AT_HD21;
00118 IMPATOMEXPORT extern const AtomType AT_HD31;
00119 IMPATOMEXPORT extern const AtomType AT_HD12;
00120 IMPATOMEXPORT extern const AtomType AT_HD22;
00121 IMPATOMEXPORT extern const AtomType AT_HD32;
00122 IMPATOMEXPORT extern const AtomType AT_SD;
00123 IMPATOMEXPORT extern const AtomType AT_OD1;
00124 IMPATOMEXPORT extern const AtomType AT_OD2;
00125 IMPATOMEXPORT extern const AtomType AT_ND1;
00126 IMPATOMEXPORT extern const AtomType AT_ND2;
00127 IMPATOMEXPORT extern const AtomType AT_CE;
00128 IMPATOMEXPORT extern const AtomType AT_CE1;
00129 IMPATOMEXPORT extern const AtomType AT_CE2;
00130 IMPATOMEXPORT extern const AtomType AT_CE3;
00131 IMPATOMEXPORT extern const AtomType AT_HE;
00132 IMPATOMEXPORT extern const AtomType AT_HE1;
00133 IMPATOMEXPORT extern const AtomType AT_HE2;
00134 IMPATOMEXPORT extern const AtomType AT_HE3;
00135 IMPATOMEXPORT extern const AtomType AT_HE21;
00136 IMPATOMEXPORT extern const AtomType AT_HE22;
00137 IMPATOMEXPORT extern const AtomType AT_OE1;
00138 IMPATOMEXPORT extern const AtomType AT_OE2;
00139 IMPATOMEXPORT extern const AtomType AT_NE;
00140 IMPATOMEXPORT extern const AtomType AT_NE1;
00141 IMPATOMEXPORT extern const AtomType AT_NE2;
00142 IMPATOMEXPORT extern const AtomType AT_CZ;
00143 IMPATOMEXPORT extern const AtomType AT_CZ2;
00144 IMPATOMEXPORT extern const AtomType AT_CZ3;
00145 IMPATOMEXPORT extern const AtomType AT_NZ;
00146 IMPATOMEXPORT extern const AtomType AT_HZ;
00147 IMPATOMEXPORT extern const AtomType AT_HZ1;
00148 IMPATOMEXPORT extern const AtomType AT_HZ2;
00149 IMPATOMEXPORT extern const AtomType AT_HZ3;
00150 IMPATOMEXPORT extern const AtomType AT_CH2;
00151 IMPATOMEXPORT extern const AtomType AT_NH1;
00152 IMPATOMEXPORT extern const AtomType AT_NH2;
00153 IMPATOMEXPORT extern const AtomType AT_OH;
00154 IMPATOMEXPORT extern const AtomType AT_HH;
00155 IMPATOMEXPORT extern const AtomType AT_HH11;
00156 IMPATOMEXPORT extern const AtomType AT_HH21;
00157 IMPATOMEXPORT extern const AtomType AT_HH2;
00158 IMPATOMEXPORT extern const AtomType AT_HH12;
00159 IMPATOMEXPORT extern const AtomType AT_HH22;
00160 IMPATOMEXPORT extern const AtomType AT_HH13;
00161 IMPATOMEXPORT extern const AtomType AT_HH23;
00162 IMPATOMEXPORT extern const AtomType AT_HH33;
00163 IMPATOMEXPORT extern const AtomType AT_P;
00164 IMPATOMEXPORT extern const AtomType AT_OP1;
00165 IMPATOMEXPORT extern const AtomType AT_OP2;
00166 IMPATOMEXPORT extern const AtomType AT_O5p;
00167 IMPATOMEXPORT extern const AtomType AT_C5p;
00168 IMPATOMEXPORT extern const AtomType AT_H5p;
00169 IMPATOMEXPORT extern const AtomType AT_H5pp;
00170 IMPATOMEXPORT extern const AtomType AT_C4p;
00171 IMPATOMEXPORT extern const AtomType AT_H4p;
00172 IMPATOMEXPORT extern const AtomType AT_O4p;
00173 IMPATOMEXPORT extern const AtomType AT_C1p;
00174 IMPATOMEXPORT extern const AtomType AT_H1p;
00175 IMPATOMEXPORT extern const AtomType AT_C3p;
00176 IMPATOMEXPORT extern const AtomType AT_H3p;
00177 IMPATOMEXPORT extern const AtomType AT_O3p;
00178 IMPATOMEXPORT extern const AtomType AT_C2p;
00179 IMPATOMEXPORT extern const AtomType AT_H2p;
00180 IMPATOMEXPORT extern const AtomType AT_H2pp;
00181 IMPATOMEXPORT extern const AtomType AT_O2p;
00182 IMPATOMEXPORT extern const AtomType AT_HO2p;
00183 IMPATOMEXPORT extern const AtomType AT_N9;
00184 IMPATOMEXPORT extern const AtomType AT_C8;
00185 IMPATOMEXPORT extern const AtomType AT_H8;
00186 IMPATOMEXPORT extern const AtomType AT_N7;
00187 IMPATOMEXPORT extern const AtomType AT_C5;
00188 IMPATOMEXPORT extern const AtomType AT_C4;
00189 IMPATOMEXPORT extern const AtomType AT_N3;
00190 IMPATOMEXPORT extern const AtomType AT_C2;
00191 IMPATOMEXPORT extern const AtomType AT_N1;
00192 IMPATOMEXPORT extern const AtomType AT_C6;
00193 IMPATOMEXPORT extern const AtomType AT_N6;
00194 IMPATOMEXPORT extern const AtomType AT_H61;
00195 IMPATOMEXPORT extern const AtomType AT_H62;
00196 IMPATOMEXPORT extern const AtomType AT_O6;
00197 IMPATOMEXPORT extern const AtomType AT_N2;
00198 IMPATOMEXPORT extern const AtomType AT_H21;
00199 IMPATOMEXPORT extern const AtomType AT_H22;
00200 IMPATOMEXPORT extern const AtomType AT_H6;
00201 IMPATOMEXPORT extern const AtomType AT_H5;
00202 IMPATOMEXPORT extern const AtomType AT_O2;
00203 IMPATOMEXPORT extern const AtomType AT_N4;
00204 IMPATOMEXPORT extern const AtomType AT_H41;
00205 IMPATOMEXPORT extern const AtomType AT_H42;
00206 IMPATOMEXPORT extern const AtomType AT_O4;
00207 IMPATOMEXPORT extern const AtomType AT_C7;
00208 IMPATOMEXPORT extern const AtomType AT_H71;
00209 IMPATOMEXPORT extern const AtomType AT_H72;
00210 IMPATOMEXPORT extern const AtomType AT_H73;
00211 #endif
00212
00213
00214
00215
00216
00217
00218
00219 class IMPATOMEXPORT Atom:
00220 public Hierarchy
00221 {
00222 public:
00223
00224 IMP_DECORATOR(Atom, Hierarchy);
00225
00226 Particle* get_particle() const {
00227 return Hierarchy::get_particle();
00228 }
00229
00230
00231 static Atom setup_particle(Particle *p, AtomType t);
00232
00233
00234 static Atom setup_particle(Particle *p, Atom o);
00235
00236
00237 static bool particle_is_instance(Particle *p) {
00238 return p->has_attribute(get_atom_type_key())
00239 && Hierarchy::particle_is_instance(p);
00240 }
00241
00242 AtomType get_atom_type() const {
00243 return AtomType(get_particle()->get_value(get_atom_type_key()));
00244 }
00245
00246
00247 void set_atom_type(AtomType t);
00248
00249 Element get_element() const {
00250 return Element(get_particle()->get_value(get_element_key()));
00251 }
00252
00253
00254
00255
00256
00257
00258
00259 IMP_DECORATOR_GET_SET_OPT(input_index, get_input_index_key(),
00260 Int, Int, -1);
00261
00262
00263
00264
00265
00266
00267
00268
00269 static IntKey get_atom_type_key();
00270
00271 static IntKey get_element_key();
00272
00273 static IntKey get_input_index_key();
00274
00275 };
00276
00277 IMP_OUTPUT_OPERATOR(Atom);
00278
00279 IMP_DECORATORS(Atom, Hierarchies);
00280
00281
00282
00283
00284
00285
00286 #ifdef SWIG
00287 class Residue;
00288 #endif
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 IMPATOMEXPORT Residue get_residue(Atom d, bool nothrow=false);
00301
00302
00303
00304
00305
00306
00307
00308 IMPATOMEXPORT Atom get_atom(Residue rd, AtomType at);
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319 IMPATOMEXPORT AtomType add_atom_type(std::string name, Element e);
00320
00321
00322 IMPATOMEXPORT bool get_atom_type_exists(std::string name);
00323
00324 IMPATOM_END_NAMESPACE
00325
00326 #endif