9 #ifndef IMPATOM_CHARMM_PARAMETERS_H
10 #define IMPATOM_CHARMM_PARAMETERS_H
12 #include "internal/charmm_helpers.h"
21 IMPKERNEL_BEGIN_NAMESPACE
23 IMPKERNEL_END_NAMESPACE
26 IMPATOM_BEGIN_NAMESPACE
30 double force_constant;
34 {out <<
"force constant: " << force_constant
35 <<
"; ideal value: " << ideal;});
42 double force_constant;
47 {out <<
"force constant: " << force_constant
48 <<
"; multiplicity: " << multiplicity
49 <<
"; ideal value: " << ideal;});
72 std::map<std::string, Element> atom_type_to_element_;
73 std::map<ResidueType, Pointer<CHARMMIdealResidueTopology> >
75 std::map<std::string, Pointer<CHARMMPatch> > patches_;
76 std::map<internal::CHARMMBondNames, CHARMMBondParameters> bond_parameters_;
77 std::map<internal::CHARMMAngleNames, CHARMMBondParameters> angle_parameters_;
79 typedef base::Vector<std::pair<internal::CHARMMDihedralNames,
84 DihedralParameters::const_iterator
85 find_dihedral(DihedralParameters::const_iterator begin,
86 DihedralParameters::const_iterator end,
87 const internal::CHARMMDihedralNames &dihedral,
88 bool allow_wildcards)
const;
113 bool translate_names_to_pdb=
false);
123 residue_topologies_.insert(std::make_pair(
ResidueType(res->get_type()),
129 std::map<ResidueType, Pointer<CHARMMIdealResidueTopology> >::const_iterator
130 it = residue_topologies_.find(type);
131 if (it != residue_topologies_.end()) {
134 IMP_THROW(
"Residue " << type <<
" does not exist", ValueException);
146 patches_.insert(std::make_pair(patch->get_type(), patch));
151 std::map<std::string, CHARMMPatch>::iterator it = patches_.find(name);
152 if (it != patches_.end()) {
155 IMP_THROW(
"Patch " << name <<
" does not exist", ValueException);
161 std::map<std::string, Pointer<CHARMMPatch> >::const_iterator it
162 = patches_.find(name);
163 if (it != patches_.end()) {
166 IMP_THROW(
"Patch " << name <<
" does not exist", ValueException);
179 std::string type2)
const {
180 internal::CHARMMBondNames types = internal::CHARMMBondNames(type1, type2);
181 if (bond_parameters_.find(types) != bond_parameters_.end()) {
182 return bond_parameters_.find(types)->second;
184 IMP_THROW(
"No CHARMM parameters found for bond "
185 << type1 <<
"-" << type2, IndexException);
195 std::string type3)
const {
196 internal::CHARMMAngleNames types = internal::CHARMMAngleNames(type1, type2,
198 if (angle_parameters_.find(types) != angle_parameters_.end()) {
199 return angle_parameters_.find(types)->second;
201 IMP_THROW(
"No CHARMM parameters found for angle "
202 << type1 <<
"-" << type2 <<
"-" << type3, IndexException);
218 std::string type1, std::string type2, std::string type3,
219 std::string type4)
const {
221 internal::CHARMMDihedralNames types = internal::CHARMMDihedralNames(
222 type1, type2, type3, type4);
224 DihedralParameters::const_iterator match =
225 find_dihedral(dihedral_parameters_.begin(),
226 dihedral_parameters_.end(), types,
true);
227 if (match != dihedral_parameters_.end()) {
230 param.push_back(match->second);
231 while ((match = find_dihedral(match + 1, dihedral_parameters_.end(),
232 match->first,
false))
233 != dihedral_parameters_.end()) {
234 param.push_back(match->second);
237 if (param.size() == 0) {
238 IMP_THROW(
"No CHARMM parameters found for dihedral "
239 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
255 std::string type1, std::string type2, std::string type3,
256 std::string type4)
const {
257 internal::CHARMMDihedralNames types = internal::CHARMMDihedralNames(
258 type1, type2, type3, type4);
260 DihedralParameters::const_iterator it =
261 find_dihedral(improper_parameters_.begin(),
262 improper_parameters_.end(), types,
true);
263 if (it != improper_parameters_.end()) {
266 IMP_THROW(
"No CHARMM parameters found for improper "
267 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
285 Particles create_angles(Particles bonds)
const;
306 Particles create_dihedrals(Particles bonds)
const;
311 virtual String get_force_field_atom_type(
Atom atom)
const;
316 bool translate_names_to_pdb);
320 Particles &ps)
const;
323 bool translate_names_to_pdb);
326 bool translate_names_to_pdb);
329 bool translate_names_to_pdb);
331 void parse_nonbonded_parameters_line(
String line);
332 void parse_bonds_parameters_line(
String line);
333 void parse_angles_parameters_line(
String line);
334 void parse_dihedrals_parameters_line(
String line,
335 DihedralParameters ¶m);
336 WarningContext warn_context_;
364 IMPATOM_END_NAMESPACE