The proto-Nucleic-Acid Builder (pNAB)
|
Go to the documentation of this file.
5 #ifndef PNAB_CONTAINERS_H
6 #define PNAB_CONTAINERS_H
11 #include <openbabel/mol.h>
12 #include <openbabel/atom.h>
13 #include <openbabel/bond.h>
14 #include <openbabel/obconversion.h>
15 #include <openbabel/math/matrix3x3.h>
18 #define M_PI 3.14159265358979323846
22 #define DEG_TO_RAD (M_PI/180.0)
240 OpenBabel::vector3
getStepTranslationVec(
unsigned n = 0,
bool is_base_pair=
false,
bool is_second_strand=
false);
274 OpenBabel::matrix3x3
getStepRotationMatrix(
unsigned n = 0,
bool is_base_pair=
false,
bool is_second_strand=
false);
287 OpenBabel::matrix3x3
rodrigues_formula(OpenBabel::vector3 axis_vector,
double theta);
385 std::cerr <<
"Called getVector() for backbone with no vector atom." << std::endl;
480 return base.GetAtom(
static_cast<unsigned>(
linker[0]));
490 return base.GetAtom(
static_cast<unsigned>(
linker[1]));
572 Bases(std::vector<Base> input_bases);
587 for (
auto v :
bases) {
588 if (v.getName().find(name) != std::string::npos)
591 std::cerr <<
"Base \"" << name <<
"\" does not exists in list of bases. Please check input file."
751 #endif //PNAB_CONTAINERS_H
OpenBabel::matrix3x3 getStepRotationMatrix(unsigned n=0, bool is_base_pair=false, bool is_second_strand=false)
Get the step rotation matrix.
Definition: Containers.cpp:62
std::array< std::size_t, 2 > backbone_interconnects
Atom indices defining where backbone connects.
Definition: Containers.h:707
OpenBabel::OBAtom * getLinker()
Get the first Backbone::linker atom pointer.
Definition: Containers.h:373
std::vector< bool > strand_orientation
Defines strand orientation for each strand in the hexad.
Definition: Containers.h:147
double crossover_rate
The crossover rate in the genetic algorithm search.
Definition: Containers.h:131
Class for holding backbone information.
Definition: Containers.h:333
double inclination
Inclination.
Definition: Containers.h:181
std::vector< Base > getComplimentBasesFromStrand(std::vector< std::string > strand)
Returns the complimentary vector of the instances of Base given the names of the bases in the strand.
Definition: Containers.cpp:453
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
const OpenBabel::OBMol getMol()
Returns the nucleotide molecule, BaseUnit::unit.
Definition: Containers.h:653
Base()
Empty constructor.
Definition: Containers.h:461
void center()
Centers the molecule. Basically just an alias of the Center() function from OpenBabel.
Definition: Containers.h:393
OpenBabel::OBMol backbone
The molecule for the backbone.
Definition: Containers.h:429
void validate()
Does some basic sanity checks (such as whether or not the indices of the atom are within the range of...
Definition: Containers.cpp:295
OpenBabel::OBAtom * getHead()
Gives the pointer to an atom that is the head from Backbone::interconnects{head, tail}.
Definition: Containers.h:357
std::array< unsigned, 2 > linker
The atom indices used to align and connect backbone to base in the nucleotide.
Definition: Containers.h:427
bool is_helical
Are the base parameters helical or step parameters.
Definition: Containers.h:202
Bases()
Empty constructor.
Definition: Containers.h:577
bool all_bases_pair
Whether all the bases in the strand have complimentary bases.
Definition: Containers.h:620
double weighting_temperature
The temperature used to compute the weighted probability for weighted Monte Carlo and weighted random...
Definition: Containers.h:115
A class for holding necessary and optional runtime parameters for conformational searches.
Definition: Containers.h:35
OpenBabel::vector3 getStepTranslationVec(unsigned n=0, bool is_base_pair=false, bool is_second_strand=false)
Get the step translation vector.
Definition: Containers.cpp:30
bool is_hexad
Defines whether the 60 degrees rotation for hexads is performed.
Definition: Containers.h:152
std::vector< std::string > strand
The names of each base used in the strand.
Definition: Containers.h:142
const std::array< std::size_t, 2 > getBaseIndexRange()
Returns the indices for the begining and end of the nucleobase atom indices, BaseUnit::base_index_ran...
Definition: Containers.h:662
OpenBabel::OBAtom * getTail()
Gives the pointer to an atom that is the tail from Backbone::interconnects{head, tail}.
Definition: Containers.h:365
std::vector< std::vector< unsigned > > getFixedBonds()
Returns a vector of the pair of indices for fixed rotatable dihedrals in the backbone,...
Definition: Containers.h:698
Backbone()
Empty constructor.
Definition: Containers.h:341
bool vector_atom_deleted
Whether or not the getVector() atom was deleted.
Definition: Containers.h:553
OpenBabel::OBAtom * getLinker()
Gives the atom of the base that connects directly to the backbone, Base::linker[0].
Definition: Containers.h:479
double h_twist
Helical twist.
Definition: Containers.h:186
std::string file_path
Path to a file containing the base.
Definition: Containers.h:542
std::size_t num_steps
The number of points sampled in Monte Carlo and random searches and the number of generations in the ...
Definition: Containers.h:93
double tilt
Tilt.
Definition: Containers.h:193
double opening
Opening.
Definition: Containers.h:198
double mutation_rate
The mutation rate in the genetic algorithm search.
Definition: Containers.h:126
std::string code
Three character code to define base ("Adenine": "ADE")
Definition: Containers.h:540
std::size_t base_connect_index
Atom index where backbone connects to base (the base atom)
Definition: Containers.h:706
std::string search_algorithm
The search algorithm.
Definition: Containers.h:80
std::vector< std::vector< unsigned > > fixed_bonds
Indices of fixed bonds in dihedral search.
Definition: Containers.h:708
double slide
Slide.
Definition: Containers.h:191
std::vector< OpenBabel::vector3 > StepParametersToReferenceFrame()
Computes the origin and direction vectors given a set of step parameters.
Definition: Containers.cpp:99
std::string getCode()
Gives the three-letter code of the base, Base::code.
Definition: Containers.h:507
Class to fully define bases (i.e. Adenine, Cytosine)
Definition: Containers.h:452
std::array< unsigned, 2 > interconnects
The atom indices that define the periodic conditions between backbones { head, tail }.
Definition: Containers.h:426
double shear
Shear.
Definition: Containers.h:199
double rise
Rise.
Definition: Containers.h:192
RuntimeParameters()
Empty constructor.
Definition: Containers.h:43
A class for holding values for all helical parameters.
Definition: Containers.h:171
std::vector< Base > getBasesFromStrand(std::vector< std::string > strand)
Returns the vector of the instances of Base given the names of the bases in the strand.
Definition: Containers.cpp:443
std::vector< std::vector< unsigned > > fixed_bonds
A vector containing pairs of indices defining fixed rotatable bonds during dihedral search.
Definition: Containers.h:428
bool vector_atom_deleted
Whether or not the atom from getVector() has been deleted.
Definition: Containers.h:439
unsigned int num_candidates
Quit after finding the specified number of accepted candidates.
Definition: Containers.h:155
OpenBabel::matrix3x3 getGlobalRotationMatrix(bool is_base_pair=false, bool is_second_strand=false)
Get the global rotation matrix.
Definition: Containers.cpp:40
double shift
Shift.
Definition: Containers.h:190
std::string getBasePairName()
Get the name of the pair base, Base::pair_name.
Definition: Containers.h:535
double stagger
Stagger.
Definition: Containers.h:201
double buckle
Buckle.
Definition: Containers.h:196
HelicalParameters()
Empty constructor.
Definition: Containers.h:179
void translate(OpenBabel::vector3 vec)
Translates the molecule by a vector. Basically just an alias of the Translate() function from OpenBab...
Definition: Containers.h:409
double roll
Roll.
Definition: Containers.h:194
std::vector< double > energy_filter
[max bond E, max angle E, max torsion E, max VDW E, max total E]
Definition: Containers.h:47
void deleteVectorAtom()
Deletes the atom from getVector() safely. If the atom is already deleted, nothing happens.
Definition: Containers.h:522
OpenBabel::OBMol base
The OBMol defining the base.
Definition: Containers.h:543
const std::array< std::size_t, 2 > getBackboneLinkers()
Returns the indices for atoms where the backbone connects, BaseUnit::backbone_interconnects.
Definition: Containers.h:680
std::vector< Base > bases
The vector of bases.
Definition: Containers.h:619
double dihedral_step
The dihedral step size for systematic search (degrees)
Definition: Containers.h:108
double y_displacement
Y-Displacement.
Definition: Containers.h:188
OpenBabel::matrix3x3 rodrigues_formula(OpenBabel::vector3 axis_vector, double theta)
Rodrigues rotation formula for rotating a vector in space.
Definition: Containers.cpp:78
BaseUnit()
Empty constructor.
Definition: Containers.h:646
double x_displacement
X-Displacement.
Definition: Containers.h:187
std::size_t getBaseConnectIndex()
Returns the index of the atom where the nucleobase connects to the backbone, BaseUnit::base_connect_i...
Definition: Containers.h:689
OpenBabel::OBAtom * getVector()
Get the second Backbone::linker atom pointer (which is probably a hydrogen)
Definition: Containers.h:381
OpenBabel::OBMol unit
Holds molecule containing base with backbone attached.
Definition: Containers.h:703
double stretch
Stretch.
Definition: Containers.h:200
void deleteVectorAtom()
Deletes the atom from getVector() safely. If the atom is already deleted, nothing happens.
Definition: Containers.cpp:252
The PNAB name space contains all the C++ classes and functions for the proto-Nucleic Acid Builder.
Definition: binder.cpp:14
OpenBabel::OBMol getMolecule()
Gives a copy of the molecule in the backbone, Backbone::backbone.
Definition: Containers.h:417
std::array< std::size_t, 2 > base_index_range
Range of indices of the unit that are a part of the base, [start, stop].
Definition: Containers.h:704
std::string pair_name
Name of the pair base.
Definition: Containers.h:541
Class to hold bases with backbones attached (nucleotides), along with associated necessary informatio...
Definition: Containers.h:632
double glycosidic_bond_distance
Set a user-defined glycosidic bond distance (in Angstroms). If zero (default), sets the distance base...
Definition: Containers.h:154
void validate()
Does some basic sanity checks (such as whether or not the indices of the atom are within the range of...
Definition: Containers.cpp:372
std::string getName()
Gives the full name of the base, Base::name.
Definition: Containers.h:515
std::string name
Full name of base (i.e. "Adenine" or just "A")
Definition: Containers.h:539
std::string file_path
The path to the file containing the molecule.
Definition: Containers.h:430
OpenBabel::vector3 getGlobalTranslationVec(bool is_base_pair=false, bool is_second_strand=false)
Get the global translation vector.
Definition: Containers.cpp:21
double max_distance
Maximum accepted distance (Angstrom) between head and tail of successive nucleotides.
Definition: Containers.h:62
std::map< std::string, PNAB::Base > name_base_map
A map of the names of the bases and the complimentary bases.
Definition: Containers.h:621
double propeller
Propeller twist.
Definition: Containers.h:197
double h_rise
Helical rise.
Definition: Containers.h:189
const std::array< std::size_t, 2 > getBackboneIndexRange()
Returns the indices for the begining and end of the backbone atom indices, BaseUnit::backbone_index_r...
Definition: Containers.h:671
void rotate(double *rot)
Rotates the molecule by a matrix. Basically just an alias of the Rotate() function from OpenBabel.
Definition: Containers.h:401
double tip
Tip.
Definition: Containers.h:185
int population_size
The population size in the genetic algorithm search.
Definition: Containers.h:136
void computeHelicalParameters()
A function to compute the helical parameters. This should be called when the the step parameters are ...
Definition: Containers.cpp:12
OpenBabel::OBAtom * getVector()
Gives the (most likely hydrogen) atom of the base connected to the atom from getLinker() which define...
Definition: Containers.h:488
double monte_carlo_temperature
The temperature used in the Monte Carlo acceptance and rejection procedure.
Definition: Containers.h:121
void ReferenceFrameToHelicalParameters(OpenBabel::vector3 origin2, OpenBabel::vector3 x2, OpenBabel::vector3 y2, OpenBabel::vector3 z2)
Computes the helical parameters given the origin and direction vectors of the second base.
Definition: Containers.cpp:148
std::array< std::size_t, 2 > linker
Holds indices for atoms forming a vector to connect to backbone {linker, hydrogen}.
Definition: Containers.h:544
OpenBabel::OBMol getMolecule()
Returns a copy of the base molecule, Base::base.
Definition: Containers.h:499
PNAB::Base getBaseFromName(std::string name)
Returns the Base instance given the name of the base.
Definition: Containers.h:586
std::vector< bool > build_strand
Defines whether to build a given strand.
Definition: Containers.h:143
std::string ff_type
The type of the forcefield such as "GAFF" or "MMFF94"; available through Openbabel.
Definition: Containers.h:74
double twist
Twist.
Definition: Containers.h:195
unsigned int seed
Definition: Containers.h:100
std::array< std::size_t, 2 > backbone_index_range
Range of indices of the unit that are a part of the backbone, [start, stop].
Definition: Containers.h:705