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 <<
"; ideal value: " << ideal;
42 double force_constant;
47 out <<
"force constant: " << force_constant
48 <<
"; multiplicity: " << multiplicity <<
"; ideal value: " << ideal;
72 std::map<std::string, Element> atom_type_to_element_;
73 std::map<ResidueType, base::Pointer<CHARMMIdealResidueTopology> >
75 std::map<std::string, base::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 find_dihedral(
85 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(
124 std::make_pair(
ResidueType(res->get_type()), res));
130 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, base::Pointer<CHARMMPatch> >::const_iterator it =
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 " << type1 <<
"-" << type2,
195 std::string type3)
const {
196 internal::CHARMMAngleNames types =
197 internal::CHARMMAngleNames(type1, type2, type3);
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 " << type1 <<
"-" << type2
219 std::string type1, std::string type2, std::string type3,
220 std::string type4)
const {
222 internal::CHARMMDihedralNames types =
223 internal::CHARMMDihedralNames(type1, type2, type3, type4);
225 DihedralParameters::const_iterator match = find_dihedral(
226 dihedral_parameters_.begin(), 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 =
258 internal::CHARMMDihedralNames(type1, type2, type3, type4);
260 DihedralParameters::const_iterator it = find_dihedral(
261 improper_parameters_.begin(), improper_parameters_.end(), types,
true);
262 if (it != improper_parameters_.end()) {
265 IMP_THROW(
"No CHARMM parameters found for improper "
266 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
311 virtual String get_force_field_atom_type(
Atom atom)
const;
316 bool translate_names_to_pdb);
325 bool translate_names_to_pdb);
328 bool translate_names_to_pdb);
331 bool translate_names_to_pdb);
333 void parse_nonbonded_parameters_line(
String line);
334 void parse_bonds_parameters_line(
String line);
335 void parse_angles_parameters_line(
String line);
362 IMPATOM_END_NAMESPACE
The ideal topology of a single residue.
CHARMMParameters * get_heavy_atom_CHARMM_parameters()
Storage and access to force field.
void set_was_used(bool tf) const
The parameters for a CHARMM bond or angle.
The parameters for a CHARMM dihedral or improper.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
A smart pointer to a reference counted object.
const CHARMMBondParameters & get_angle_parameters(std::string type1, std::string type2, std::string type3) const
Get parameters for the angle between the three given CHARMM atom types.
const CHARMMBondParameters & get_bond_parameters(std::string type1, std::string type2) const
Get bond parameters for the bond between the two given CHARMM atom types.
CHARMM force field parameters.
Classes for handling CHARMM-style topology.
const CHARMMDihedralParameters & get_improper_parameters(std::string type1, std::string type2, std::string type3, std::string type4) const
Get parameters for the improper between the four given CHARMM atom types.
The standard decorator for manipulating molecular structures.
Base class for all CHARMM residue-based topology.
A decorator for a particle representing an atom.
Class to handle individual model particles.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Various important macros for implementing decorators.
#define IMP_FORCE_FIELD_PARAMETERS(Name)
Define the basic things you need for a ForceFieldParameters.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
Handling of file input/output.
CHARMMDihedralParametersList get_dihedral_parameters(std::string type1, std::string type2, std::string type3, std::string type4) const
Get parameters for the dihedral between the four given CHARMM atom types.
The topology of a complete CHARMM model.
CHARMMParameters * get_all_atom_CHARMM_parameters()
std::string String
Basic string value.