9 #ifndef IMPATOM_CHARMM_TOPOLOGY_H
10 #define IMPATOM_CHARMM_TOPOLOGY_H
15 #include <IMP/atom/atom_config.h>
20 IMPATOM_BEGIN_NAMESPACE
30 std::string charmm_type_;
36 : name_(name), charmm_type_(other.charmm_type_),
37 charge_(other.charge_) {};
39 std::string get_name()
const {
return name_; }
40 std::string get_charmm_type()
const {
return charmm_type_; }
41 double get_charge()
const {
return charge_; }
42 void set_charmm_type(std::string charmm_type) { charmm_type_ = charmm_type; }
43 void set_charge(
double charge) { charge_ = charge; }
45 <<
"; CHARMM type: " << charmm_type_
46 <<
"; charge: " << charge_;});
70 std::string atom_name_;
71 Pointer<Object> residue_;
76 std::string get_atom_name()
const {
return atom_name_; }
91 template <
unsigned int D>
99 for (Strings::const_iterator it = atoms.begin();
100 it != atoms.end(); ++it) {
107 : endpoints_(endpoints) {
113 return endpoints_[i];
119 it = endpoints_.begin(); it != endpoints_.end(); ++it) {
120 if (it->get_atom_name() == name) {
136 it = endpoints_.begin(); it != endpoints_.end(); ++it) {
137 Atom a = it->get_atom(current_residue, previous_residue,
138 next_residue, resmap);
150 it = endpoints_.begin(); it != endpoints_.end(); ++it) {
151 if (it != endpoints_.begin()) {
154 out << it->get_atom_name();
159 typedef CHARMMConnection<2> CHARMMBond;
160 typedef CHARMMConnection<3> CHARMMAngle;
161 typedef CHARMMConnection<4> CHARMMDihedral;
192 float first_distance_, second_distance_, first_angle_, second_angle_,
197 float first_angle,
float dihedral,
198 float second_angle,
float second_distance,
201 second_distance_(second_distance), first_angle_(first_angle),
202 second_angle_(second_angle), dihedral_(dihedral),
203 improper_(improper) {}
205 float first_distance,
float first_angle,
206 float dihedral,
float second_angle,
207 float second_distance,
bool improper)
209 second_distance_(second_distance), first_angle_(first_angle),
210 second_angle_(second_angle), dihedral_(dihedral),
211 improper_(improper) {}
213 float get_first_distance()
const {
return first_distance_; }
214 float get_second_distance()
const {
return second_distance_; }
215 float get_first_angle()
const {
return first_angle_; }
216 float get_second_angle()
const {
return second_angle_; }
218 bool get_improper()
const {
return improper_; }
222 out <<
"; distances: " << first_distance_ <<
", "
223 << second_distance_ <<
"; angles: " << first_angle_
224 <<
", " << second_angle_ <<
"; dihedral: "
246 Object(
"CharmmResidueTopoBase%1%"),
248 set_name(std::string(
"CHARMM residue ") + type);
251 std::string get_type()
const {
return type_; }
253 unsigned int get_number_of_atoms()
const {
return atoms_.size(); }
257 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
266 unsigned int get_number_of_bonds()
const {
return bonds_.size(); }
267 void add_bond(
const CHARMMBond &bond) {
268 bonds_.push_back(bond);
270 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
272 CHARMMBond &
get_bond(
unsigned int index) {
return bonds_[index]; }
275 unsigned int get_number_of_angles()
const {
return angles_.size(); }
276 void add_angle(
const CHARMMAngle &bond) {
277 angles_.push_back(bond);
279 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
281 CHARMMAngle &get_angle(
unsigned int index) {
return angles_[index]; }
283 unsigned int get_number_of_dihedrals()
const {
return dihedrals_.size(); }
284 void add_dihedral(
const CHARMMDihedral &bond) {
285 dihedrals_.push_back(bond);
287 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
289 CHARMMDihedral &
get_dihedral(
unsigned int index) {
return dihedrals_[index]; }
291 unsigned int get_number_of_impropers()
const {
return impropers_.size(); }
292 void add_improper(
const CHARMMDihedral &bond) {
293 impropers_.push_back(bond);
295 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
296 CHARMMDihedral &get_improper(
unsigned int index) {
return impropers_[index]; }
299 unsigned int get_number_of_internal_coordinates()
const {
300 return internal_coordinates_.size();
303 internal_coordinates_.push_back(ic);
306 &get_internal_coordinate(
unsigned int index)
const {
307 return internal_coordinates_[index];
310 const CHARMMBond &
get_bond(
unsigned int index)
const {
311 return bonds_[index];
313 const CHARMMAngle &get_angle(
unsigned int index)
const {
314 return angles_[index];
316 const CHARMMDihedral &
get_dihedral(
unsigned int index)
const {
317 return dihedrals_[index];
319 const CHARMMDihedral &get_improper(
unsigned int index)
const {
320 return impropers_[index];
336 std::string default_first_patch_, default_last_patch_;
346 void remove_atom(std::string name);
348 void set_default_first_patch(std::string patch) {
349 default_first_patch_ = patch;
351 void set_default_last_patch(std::string patch) {
352 default_last_patch_ = patch;
354 std::string get_default_first_patch()
const {
return default_first_patch_; }
355 std::string get_default_last_patch()
const {
return default_last_patch_; }
380 set_name(std::string(
"CHARMM patching residue ") + type);
383 void add_removed_atom(std::string name) { deleted_atoms_.push_back(name); }
385 unsigned int get_number_of_removed_atoms()
const {
386 return deleted_atoms_.size();
389 std::string get_removed_atom(
unsigned int i)
const {
390 return deleted_atoms_[i];
400 void apply(CHARMMResidueTopology *res)
const;
409 void apply(CHARMMResidueTopology *res1, CHARMMResidueTopology *res2)
const;
435 set_default_first_patch(ideal->get_default_first_patch());
436 set_default_last_patch(ideal->get_default_last_patch());
439 for (
unsigned int i = 0; i < ideal->get_number_of_atoms(); ++i) {
440 add_atom(ideal->get_atom(i));
443 for (
unsigned int i = 0; i < ideal->get_number_of_bonds(); ++i) {
444 add_bond(ideal->get_bond(i));
446 for (
unsigned int i = 0; i < ideal->get_number_of_angles(); ++i) {
447 add_angle(ideal->get_angle(i));
449 for (
unsigned int i = 0; i < ideal->get_number_of_dihedrals(); ++i) {
450 add_dihedral(ideal->get_dihedral(i));
452 for (
unsigned int i = 0; i < ideal->get_number_of_impropers(); ++i) {
453 add_improper(ideal->get_improper(i));
455 for (
unsigned int i = 0; i < ideal->get_number_of_internal_coordinates();
457 add_internal_coordinate(ideal->get_internal_coordinate(i));
461 bool get_patched()
const {
return patched_; }
462 void set_patched(
bool patched) { patched_ = patched; }
469 IMPATOM_END_NAMESPACE