The proto-Nucleic-Acid Builder (pNAB)
ConformationSearch.h
Go to the documentation of this file.
1 
5 #ifndef PNAB_CONFORMATIONSEARCH_H
6 #define PNAB_CONFORMATIONSEARCH_H
7 
8 #include "Chain.h"
9 
10 #define BOLTZMANN 0.0019872041 // kcal/(mol.K)
11 
12 namespace PNAB {
61 
62  public:
77  PNAB::HelicalParameters &helical_params, PNAB::Bases bases,
78  std::string prefix = "test", bool verbose = true);
79 
91  std::string run();
92 
93  private:
94  bool verbose_;
96  std::array<unsigned, 2> backbone_range_;
100  std::mt19937_64 rng_;
102  OpenBabel::matrix3x3 step_rot_,
104  OpenBabel::vector3 step_translate_,
106  OpenBabel::OBConversion conv_;
108  std::string prefix_;
109 
111  OpenBabel::OBMol bu_a_mol;
112  unsigned head,
114  std::string output_string;
115  double* coords;
116  OpenBabel::OBRotorList rl;
117  std::vector<OpenBabel::OBRotor*> rotor_vector;
118 
134  void SystematicSearch();
135 
157  void RandomSearch(bool weighted);
158 
193  void MonteCarloSearch(bool weighted);
194 
228  void GeneticAlgorithmSearch();
229 
254  std::vector <std::piecewise_linear_distribution<double>> WeightedDistributions();
255 
272  double measureDistance(double *coords, unsigned head, unsigned tail);
273 
284  void reportData(PNAB::ConformerData &conf_data);
285 
295  void printProgress(std::size_t search_index, std::size_t search_size);
296  };
297 }
298 
299 #endif //PNAB_MONTECARLOROTORSEARCH_H
jupyter_widgets.backbone
def backbone(param)
Main backbone widget for use in Jupyter notebook.
Definition: jupyter_widgets.py:264
PNAB::ConformationSearch::reportData
void reportData(PNAB::ConformerData &conf_data)
A function to report the data on the accepted candidates.
Definition: ConformationSearch.cpp:700
PNAB::Backbone
Class for holding backbone information.
Definition: Containers.h:333
PNAB::ConformationSearch::head
unsigned head
The first terminal atom in the backbone.
Definition: ConformationSearch.h:112
PNAB::ConformationSearch::GeneticAlgorithmSearch
void GeneticAlgorithmSearch()
This algorithm utilizes the genetic algorihtm procedure to improve the choice of the dihedral angle.
Definition: ConformationSearch.cpp:128
PNAB::ConformationSearch::tail
unsigned tail
The second terminal atom in the backbone.
Definition: ConformationSearch.h:113
PNAB::ConformationSearch::glbl_translate_
OpenBabel::vector3 glbl_translate_
The global translation vector, HelicalParameters::getGlobalTranslationVec.
Definition: ConformationSearch.h:105
PNAB::ConformationSearch::rng_
std::mt19937_64 rng_
A random number generator.
Definition: ConformationSearch.h:100
PNAB::Bases
A class that contains a vector of all the defined bases and a funtion to return a base and the compli...
Definition: Containers.h:562
PNAB::ConformationSearch::coords
double * coords
The coordinates of the first nucleotide.
Definition: ConformationSearch.h:115
PNAB::ConformationSearch::run
std::string run()
A function to call the appropriate search algorithm using the provided RuntimeParameters::search_algo...
Definition: ConformationSearch.cpp:95
PNAB::ConformationSearch::verbose_
bool verbose_
Whether to print progress report to screen.
Definition: ConformationSearch.h:94
PNAB::RuntimeParameters
A class for holding necessary and optional runtime parameters for conformational searches.
Definition: Containers.h:35
PNAB::ConformationSearch::prefix_
std::string prefix_
A string to prepend the name of the accepted backbone candidates.
Definition: ConformationSearch.h:108
PNAB::ConformationSearch::printProgress
void printProgress(std::size_t search_index, std::size_t search_size)
Prints the percentage of search completed and the best accepted candidate.
Definition: ConformationSearch.cpp:673
PNAB::ConformationSearch::glbl_rot_
OpenBabel::matrix3x3 glbl_rot_
The global rotation matrix, HelicalParameters::getGlobalRotationMatrix.
Definition: ConformationSearch.h:103
PNAB::ConformationSearch::step_translate_
OpenBabel::vector3 step_translate_
The step translation vector, HelicalParameters::getStepTranslationVec.
Definition: ConformationSearch.h:104
PNAB::ConformationSearch::runtime_params_
PNAB::RuntimeParameters runtime_params_
The runtime parameters instance, RuntimeParameters.
Definition: ConformationSearch.h:95
PNAB::ConformationSearch::step_rot_
OpenBabel::matrix3x3 step_rot_
The step rotation matrix, HelicalParameters::getStepRotationMatrix.
Definition: ConformationSearch.h:102
PNAB::ConformationSearch::bu_a_mol
OpenBabel::OBMol bu_a_mol
The molecule of the first nucleotide.
Definition: ConformationSearch.h:111
PNAB::ConformationSearch::MonteCarloSearch
void MonteCarloSearch(bool weighted)
The algorithm utilizes the Metropolis Monte Carlo scheme to improve the choice of the dihedral angle.
Definition: ConformationSearch.cpp:371
jupyter_widgets.bases
def bases(param)
Bases widget for use in Jupyter notebook.
Definition: jupyter_widgets.py:427
PNAB::ConformationSearch::monomer_num_coords_
unsigned monomer_num_coords_
3*The number of atoms in the first nucleotide
Definition: ConformationSearch.h:107
PNAB::HelicalParameters
A class for holding values for all helical parameters.
Definition: Containers.h:171
PNAB::ConformationSearch::rl
OpenBabel::OBRotorList rl
The list of the all rotatable dihedral angles in the backbone.
Definition: ConformationSearch.h:116
Chain.h
A file for declaring a class for building and evaluating nucleic acid strands.
PNAB::ConformationSearch::backbone_
PNAB::Backbone backbone_
The backbone molecule.
Definition: ConformationSearch.h:97
PNAB::ConformationSearch::output_string
std::string output_string
A string in CSV format containing the properties of the accepted candidates.
Definition: ConformationSearch.h:114
PNAB::ConformationSearch::WeightedDistributions
std::vector< std::piecewise_linear_distribution< double > > WeightedDistributions()
Produces weighted distributions for each rotatable dihedral angle in the backbone.
Definition: ConformationSearch.cpp:509
PNAB::ConformationSearch
A rotor search function used to find acceptable conformations of arbitrary backbone and helical param...
Definition: ConformationSearch.h:60
PNAB::ConformationSearch::helical_params_
PNAB::HelicalParameters helical_params_
the helical parameters
Definition: ConformationSearch.h:98
PNAB::ConformationSearch::number_of_candidates
int number_of_candidates
The number of accepted candiates.
Definition: ConformationSearch.h:101
PNAB
The PNAB name space contains all the C++ classes and functions for the proto-Nucleic Acid Builder.
Definition: binder.cpp:14
PNAB::ConformerData
Class to contain important information for an individual conformer.
Definition: Containers.h:725
PNAB::ConformationSearch::conv_
OpenBabel::OBConversion conv_
An openbabel conversion object used to write accepted candidates.
Definition: ConformationSearch.h:106
PNAB::ConformationSearch::bases_
PNAB::Bases bases_
the list of the defined bases
Definition: ConformationSearch.h:99
PNAB::ConformationSearch::RandomSearch
void RandomSearch(bool weighted)
The algorithm randomly changes all the dihedral angles in the backbone and evaluates whether they are...
Definition: ConformationSearch.cpp:289
PNAB::BaseUnit
Class to hold bases with backbones attached (nucleotides), along with associated necessary informatio...
Definition: Containers.h:632
PNAB::ConformationSearch::ConformationSearch
ConformationSearch(PNAB::RuntimeParameters &runtime_params, PNAB::Backbone &backbone, PNAB::HelicalParameters &helical_params, PNAB::Bases bases, std::string prefix="test", bool verbose=true)
Constructor for the conformation search class.
Definition: ConformationSearch.cpp:15
PNAB::ConformationSearch::measureDistance
double measureDistance(double *coords, unsigned head, unsigned tail)
Compute the distance between the head backbone atom and the tail backbone atom of the next nucleotide...
Definition: ConformationSearch.cpp:680
PNAB::ConformationSearch::backbone_range_
std::array< unsigned, 2 > backbone_range_
The Backbone index range for the first nucleotide.
Definition: ConformationSearch.h:96
PNAB::ConformationSearch::rotor_vector
std::vector< OpenBabel::OBRotor * > rotor_vector
A vector of dihedral angles to be rotated in the search. Excludes fixed angles.
Definition: ConformationSearch.h:117
PNAB::ConformationSearch::SystematicSearch
void SystematicSearch()
Given a step size, the algorithm exhaustively searches over all the rotatable dihedral angles in the ...
Definition: ConformationSearch.cpp:596
PNAB::ConformationSearch::unit
BaseUnit unit
The nucleotide unit for the first nucleotide in the strand. Used for searching for conformations.
Definition: ConformationSearch.h:110