STORMM Source Documentation
Loading...
Searching...
No Matches
nml_conformer.h
1// -*-c++-*-
2#ifndef STORMM_NML_CONFORMER_H
3#define STORMM_NML_CONFORMER_H
4
5#include "copyright.h"
6#include "Constants/behavior.h"
7#include "Constants/symbol_values.h"
8#include "Structure/structure_enumerators.h"
9#include "Synthesis/synthesis_enumerators.h"
10#include "Parsing/textfile.h"
11#include "namelist_element.h"
12#include "namelist_emulator.h"
13
14namespace stormm {
15namespace namelist {
16
17using constants::ExceptionResponse;
18using parse::TextFile;
19using parse::WrapTextSearch;
20using structure::SamplingIntensity;
21using synthesis::SystemGrouping;
22using synthesis::VariableTorsionAdjustment;
23
26constexpr int default_conf_rotation_samples = 3;
27constexpr int default_conf_cis_trans_samples = 2;
28constexpr int default_conf_max_rotatable_bonds = 4;
29constexpr int default_conf_max_seeding_attempts = 3;
30constexpr int default_conf_clash_pairs = 0;
31constexpr int default_conf_max_system_trials = 16384;
32constexpr int default_conf_sample_trials = 512;
33constexpr int default_conf_running_states = 16;
34constexpr int default_conf_final_states = 100;
35constexpr int default_conf_reshuffle_iterations = 0;
36constexpr int active_states_limit = 524288;
37constexpr int seeding_attempts_limit = 100;
38constexpr double default_conf_rmsd_tolerance = 1.5;
39constexpr double default_conf_core_restraint = 16.0;
40constexpr char default_conf_chirality[] = "false";
41constexpr char default_conf_cis_trans[] = "false";
42constexpr char default_conf_stop_hbonds[] = "false";
43constexpr char default_conf_output_grouping[] = "system";
44constexpr char default_conf_sampling_effort[] = "light";
45constexpr char default_conf_adjustment_method[] = "none";
46constexpr char default_conf_rotation_set_zero[] = "60.0";
47constexpr char default_conf_rotation_set_one[] = "180.0";
48constexpr char default_conf_rotation_set_two[] = "-60.0";
49constexpr char default_conf_cis_trans_set_zero[] = "0.0";
50constexpr char default_conf_cis_trans_set_one[] = "180.0";
51constexpr char default_conf_rotation_snap[] = "10.0";
52constexpr char default_conf_cis_trans_snap[] = "5.0";
54
57public:
58
70 ConformerControls(ExceptionResponse policy_in = ExceptionResponse::DIE);
71
72 ConformerControls(const TextFile &tf, int *start_line, bool *found_nml,
73 ExceptionResponse policy_in = ExceptionResponse::DIE,
74 WrapTextSearch wrap = WrapTextSearch::NO);
76
80 ConformerControls(const ConformerControls &original) = default;
81 ConformerControls(ConformerControls &&original) = default;
82 ConformerControls& operator=(const ConformerControls &original) = default;
83 ConformerControls& operator=(ConformerControls &&original) = default;
85
87 const std::string& getCoreAtomMask() const;
88
90 const std::string& getCoreDataItemName() const;
91
93 double getCoreRK2Value() const;
94
96 double getCoreRK3Value() const;
97
99 double getCoreR2Value() const;
100
102 double getCoreR3Value() const;
103
105 bool sampleChirality() const;
106
108 bool sampleCisTrans() const;
109
112 bool preventHydrogenBonding() const;
113
119 int getRunningStateCount() const;
120
122 int getFinalStateCount() const;
123
125 int getRotationSampleCount() const;
126
128 int getCisTransSampleCount() const;
129
131 const std::vector<double>& getRotationSampleValues() const;
132
134 const std::vector<double>& getCisTransSampleValues() const;
135
137 int getRotatableBondLimit() const;
138
140 int getMaxSeedingAttempts() const;
141
144 int getClashPairTolerance() const;
145
149 int getSamplingTrialLimit() const;
150
155 int getMaximumTrialLimit() const;
156
159 double getRMSDTolerance() const;
160
164 SystemGrouping getGroupingMethod() const;
165
167 SamplingIntensity getSamplingIntensity() const;
168
170 double getRotatableBondSnapThreshold() const;
171
173 double getCisTransBondSnapThreshold() const;
174
178 VariableTorsionAdjustment getTorsionAdjustmentProtocol() const;
179
181 const NamelistEmulator& getTranscript() const;
182
183private:
184 ExceptionResponse policy;
189 std::string core_atom_mask;
190 std::string core_data_item;
193 double core_rk2;
194 double core_rk3;
195 double core_r2;
196 double core_r3;
197 std::string anchor_conformation;
204 bool sample_chirality;
205 bool sample_cis_trans;
206 bool prevent_hbonds;
208 int running_states;
209 int final_states;
210 int rotation_sample_count;
211 int rotatable_bond_limit;
212 int cis_trans_sample_count;
213 int max_seeding_attempts;
216 int clash_pair_tolerance;
220 int sampling_trial_limit;
224 int maximum_trial_limit;
226 double rmsd_tolerance;
228 std::string group_method;
231 std::string sample_effort;
235 double rotation_snap_threshold;
238 double cis_trans_snap_threshold;
241 std::string adjustment_method;
243
245 std::vector<double> rotation_sample_values;
246
248 std::vector<double> cis_trans_sample_values;
249
251 NamelistEmulator nml_transcript;
252
254 void validateCoreRestraint() const;
255
260 void validateSampleChirality(const std::string &directive) const;
261
266 void validateSampleCisTrans(const std::string &directive) const;
267
272 void validatePreventHBonds(const std::string &directive) const;
273
275 void validateStateCounts();
276
278 void validateGroupingMethod();
279
281 void validateSeedingAttempts();
282
286 void validateClashCounts();
287
289 void validateSamplingIntensity();
290
298 void validateTorsionSnapping(double *snap_setting, const std::string &desc) const;
299
301 void validateTorsionAdjustmentProtocol();
302
320 void processSamplingValues(int *sample_count, const std::string &count_keyword,
321 std::vector<double> *sample_values, const std::string &value_keyword,
322 double value_stride, double value_notch,
323 const NamelistEmulator &t_nml);
324};
325
335NamelistEmulator conformerInput(const TextFile &tf, int *start_line, bool *found,
336 ExceptionResponse policy = ExceptionResponse::DIE,
337 WrapTextSearch wrap = WrapTextSearch::NO);
338
339} // namespace namelist
340} // namespace stormm
341
342#endif
bool sampleCisTrans() const
Get an indicator of whether to sample cis- and trans- isomers.
Definition nml_conformer.cpp:178
const std::vector< double > & getCisTransSampleValues() const
Get the list of rotational angle values to sample about each cis-trans isomeric bond.
Definition nml_conformer.cpp:213
double getCoreR2Value() const
Get the core restraint r2 displacement.
Definition nml_conformer.cpp:163
int getRotatableBondLimit() const
Get the maximum number of rotatable bonds to sample.
Definition nml_conformer.cpp:218
ConformerControls(ExceptionResponse policy_in=ExceptionResponse::DIE)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_conformer.cpp:28
ConformerControls(const ConformerControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
bool sampleChirality() const
Get an indicator of whether to sample chirality.
Definition nml_conformer.cpp:173
int getSamplingTrialLimit() const
Get the maximum number of sampling trials that will be permitted across the various systems when atte...
Definition nml_conformer.cpp:233
int getRunningStateCount() const
Get the total number of states to attempt minimizing at one time. This will put a limit on the expand...
Definition nml_conformer.cpp:188
int getRotationSampleCount() const
Get the number of samples to apply to each explicitly sampled rotatable bond.
Definition nml_conformer.cpp:198
const std::string & getCoreDataItemName() const
Get the name of the data item expected to contain core atoms.
Definition nml_conformer.cpp:148
double getRotatableBondSnapThreshold() const
Get the tolerance for snapping rotatable bond settings to consensus values.
Definition nml_conformer.cpp:258
SystemGrouping getGroupingMethod() const
Get the output grouping strategy, indicating whether to take the specified number of final states for...
Definition nml_conformer.cpp:248
int getMaxSeedingAttempts() const
Get the maximum number of conformer seeding attempts.
Definition nml_conformer.cpp:223
SamplingIntensity getSamplingIntensity() const
Get a general sampling strategy from the user.
Definition nml_conformer.cpp:253
int getCisTransSampleCount() const
Get the number of samples to apply to each explicitly sampled cis-trans isomeric bond.
Definition nml_conformer.cpp:203
const std::string & getCoreAtomMask() const
Get the core atom mask string.
Definition nml_conformer.cpp:143
double getCoreR3Value() const
Get the core restraint r3 displacement.
Definition nml_conformer.cpp:168
int getFinalStateCount() const
Get the number of final states to produce for each initial system.
Definition nml_conformer.cpp:193
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_conformer.cpp:273
bool preventHydrogenBonding() const
Get an indicator as to whether to apply restraints that will prevent hydrogen bond formation in the r...
Definition nml_conformer.cpp:183
int getClashPairTolerance() const
Get the number of clashing pairs of atoms that can be seen in a structure before it is declared to co...
Definition nml_conformer.cpp:228
const std::vector< double > & getRotationSampleValues() const
Get the list of rotational angle values to sample about each rotatable bond.
Definition nml_conformer.cpp:208
VariableTorsionAdjustment getTorsionAdjustmentProtocol() const
Get the torsion angle adjustment strategy (applies to rotatable and cis-trans isomeric bonds) used in...
Definition nml_conformer.cpp:268
double getCisTransBondSnapThreshold() const
Get the tolerance for snapping cis-trans isomeric bond settings to consensus values.
Definition nml_conformer.cpp:263
double getCoreRK2Value() const
Get the core restraint r2 penalty (near-repulsive potential) stiffness.
Definition nml_conformer.cpp:153
int getMaximumTrialLimit() const
Get the maximum number of minimizations to attempt with any one molecule. Each initial state provided...
Definition nml_conformer.cpp:238
double getCoreRK3Value() const
Get the core restraint r3 penalty (position-keeping potential) stiffness.
Definition nml_conformer.cpp:158
double getRMSDTolerance() const
Get the positional root mean squared deviation that will distinguish each reported confomer.
Definition nml_conformer.cpp:243
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45