9 #ifndef IMPATOM_CHARMM_PARAMETERS_H
10 #define IMPATOM_CHARMM_PARAMETERS_H
12 #include "internal/charmm_helpers.h"
16 #include <cereal/access.hpp>
24 IMPKERNEL_BEGIN_NAMESPACE
26 IMPKERNEL_END_NAMESPACE
29 IMPATOM_BEGIN_NAMESPACE
33 double force_constant;
37 out <<
"force constant: " << force_constant <<
"; ideal value: " << ideal;
41 friend class cereal::access;
43 template<
class Archive>
void serialize(Archive &ar) {
44 ar(force_constant, ideal);
52 double force_constant;
57 out <<
"force constant: " << force_constant
58 <<
"; multiplicity: " << multiplicity <<
"; ideal value: " << ideal;
62 friend class cereal::access;
64 template<
class Archive>
void serialize(Archive &ar) {
65 ar(force_constant, multiplicity, ideal);
89 std::map<std::string, Element> atom_type_to_element_;
90 std::map<ResidueType, Pointer<CHARMMIdealResidueTopology>>
92 std::map<std::string, Pointer<CHARMMPatch>> patches_;
93 std::map<internal::CHARMMBondNames, CHARMMBondParameters> bond_parameters_;
94 std::map<internal::CHARMMAngleNames, CHARMMBondParameters> angle_parameters_;
96 typedef Vector<std::pair<internal::CHARMMDihedralNames,
101 DihedralParameters::const_iterator find_dihedral(
102 DihedralParameters::const_iterator begin,
103 DihedralParameters::const_iterator end,
104 const internal::CHARMMDihedralNames &dihedral,
105 bool allow_wildcards)
const;
108 const internal::CHARMMDihedralNames &types)
const;
117 dihedral_parameters_cache_;
141 bool translate_names_to_pdb =
false);
151 residue_topologies_.insert(
152 std::make_pair(
ResidueType(res->get_type()), res));
158 residue_topologies_.find(type);
159 if (it != residue_topologies_.end()) {
174 patches_.insert(std::make_pair(patch->get_type(), patch));
179 std::map<std::string, CHARMMPatch>::iterator it = patches_.find(name);
180 if (it != patches_.end()) {
189 std::map<std::string, Pointer<CHARMMPatch>>::const_iterator it =
191 if (it != patches_.end()) {
214 std::string type2)
const {
215 internal::CHARMMBondNames types = internal::CHARMMBondNames(type1, type2);
216 if (bond_parameters_.find(types) != bond_parameters_.end()) {
217 return bond_parameters_.find(types)->second;
219 IMP_THROW(
"No CHARMM parameters found for bond " << type1 <<
"-" << type2,
230 std::string type3)
const {
231 internal::CHARMMAngleNames types =
232 internal::CHARMMAngleNames(type1, type2, type3);
233 if (angle_parameters_.find(types) != angle_parameters_.end()) {
234 return angle_parameters_.find(types)->second;
236 IMP_THROW(
"No CHARMM parameters found for angle " << type1 <<
"-" << type2
254 std::string type1, std::string type2, std::string type3,
255 std::string type4)
const;
266 std::string type1, std::string type2, std::string type3,
267 std::string type4)
const {
268 internal::CHARMMDihedralNames types =
269 internal::CHARMMDihedralNames(type1, type2, type3, type4);
271 DihedralParameters::const_iterator it = find_dihedral(
272 improper_parameters_.begin(), improper_parameters_.end(), types,
true);
273 if (it != improper_parameters_.end()) {
276 IMP_THROW(
"No CHARMM parameters found for improper "
277 << type1 <<
"-" << type2 <<
"-" << type3 <<
"-" << type4,
321 virtual String get_force_field_atom_type(
Atom atom)
const override;
323 void read_parameter_file(
TextInput input_file);
325 void read_topology_file(
TextInput input_file,
326 bool translate_names_to_pdb);
335 bool translate_names_to_pdb);
338 bool translate_names_to_pdb);
341 bool translate_names_to_pdb);
343 void parse_nonbonded_parameters_line(
String line);
344 void parse_bonds_parameters_line(
String line);
345 void parse_angles_parameters_line(
String line);
372 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.
Macros for maintaining molecular hierarchies.
Class to handle individual particles of a Model object.
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