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, 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 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;
112 bool translate_names_to_pdb =
false);
122 residue_topologies_.insert(
123 std::make_pair(
ResidueType(res->get_type()), res));
129 residue_topologies_.find(type);
130 if (it != residue_topologies_.end()) {
145 patches_.insert(std::make_pair(patch->get_type(), patch));
150 std::map<std::string, CHARMMPatch>::iterator it = patches_.find(name);
151 if (it != patches_.end()) {
160 std::map<std::string, Pointer<CHARMMPatch> >::const_iterator it =
162 if (it != patches_.end()) {
185 std::string type2)
const {
186 internal::CHARMMBondNames types = internal::CHARMMBondNames(type1, type2);
187 if (bond_parameters_.find(types) != bond_parameters_.end()) {
188 return bond_parameters_.find(types)->second;
190 IMP_THROW(
"No CHARMM parameters found for bond " << type1 <<
"-" << type2,
201 std::string type3)
const {
202 internal::CHARMMAngleNames types =
203 internal::CHARMMAngleNames(type1, type2, type3);
204 if (angle_parameters_.find(types) != angle_parameters_.end()) {
205 return angle_parameters_.find(types)->second;
207 IMP_THROW(
"No CHARMM parameters found for angle " << type1 <<
"-" << type2
225 std::string type1, std::string type2, std::string type3,
226 std::string type4)
const {
228 internal::CHARMMDihedralNames types =
229 internal::CHARMMDihedralNames(type1, type2, type3, type4);
231 DihedralParameters::const_iterator match = find_dihedral(
232 dihedral_parameters_.begin(), dihedral_parameters_.end(), types,
false);
233 if (match != dihedral_parameters_.end()) {
234 param.push_back(match->second);
235 while ((match = find_dihedral(match + 1, dihedral_parameters_.end(),
236 match->first,
false)) !=
237 dihedral_parameters_.end()) {
238 param.push_back(match->second);
242 match = find_dihedral(
243 dihedral_parameters_.begin(), dihedral_parameters_.end(), types,
true);
244 if (match != dihedral_parameters_.end()) {
245 param.push_back(match->second);
246 while ((match = find_dihedral(match + 1, dihedral_parameters_.end(),
247 match->first,
true)) !=
248 dihedral_parameters_.end()) {
249 param.push_back(match->second);
254 if (param.size() == 0) {
255 IMP_THROW(
"No CHARMM parameters found for dihedral "
256 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
272 std::string type1, std::string type2, std::string type3,
273 std::string type4)
const {
274 internal::CHARMMDihedralNames types =
275 internal::CHARMMDihedralNames(type1, type2, type3, type4);
277 DihedralParameters::const_iterator it = find_dihedral(
278 improper_parameters_.begin(), improper_parameters_.end(), types,
true);
279 if (it != improper_parameters_.end()) {
282 IMP_THROW(
"No CHARMM parameters found for improper "
283 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
327 virtual String get_force_field_atom_type(
Atom atom)
const;
329 void read_parameter_file(
TextInput input_file);
331 void read_topology_file(
TextInput input_file,
332 bool translate_names_to_pdb);
341 bool translate_names_to_pdb);
344 bool translate_names_to_pdb);
347 bool translate_names_to_pdb);
349 void parse_nonbonded_parameters_line(
String line);
350 void parse_bonds_parameters_line(
String line);
351 void parse_angles_parameters_line(
String line);
378 IMPATOM_END_NAMESPACE
The ideal topology of a single residue.
CHARMMParameters * get_heavy_atom_CHARMM_parameters()
Storage and access to force field.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
The parameters for a CHARMM bond or angle.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
The parameters for a CHARMM dihedral or improper.
Handling of file input/output.
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.
A more IMP-like version of the std::vector.
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.
Warnings with the same key within the context are only output once.
A smart pointer to a reference counted object.
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.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
The standard decorator for manipulating molecular structures.
Base class for all CHARMM residue-based topology.
A decorator for a particle representing an atom.
An exception for a request for an invalid member of a container.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
Various important macros for implementing decorators.
Class to handle individual particles of a Model object.
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()
An exception for an invalid value being passed to IMP.
std::string String
Basic string value.
void set_was_used(bool tf) const