Model¶
-
class mdk::Model
A model object, which serves as one of two objects (other being
param::Parameters
) which instantiate the simulation. Contains residues (with types, messes, positions etc.), chains and structured parts, topological information (i.e. the box shape), along with an array of utilities for the modification of the model, in particular initializing the velocities or preparing the model into a conformation (a line or a self-avoiding walk).Public Functions
-
Chain &addChain()
-
Contact &addContact()
-
StructuredPart &addSP()
-
void morphIntoLine()
-
void morphIntoSAW(Random &rand, bool useTop = false, double density = 1e-4 * atom / pow(angstrom, 3.0), double minDist = 4.56 * angstrom)
Morphing the model into a self-avoiding walk. A custom version with clarity in mind, doesn’t replicate the positions from the Fortran code which makes testing difficult.
Note: it doesn’t use native bond angles correctly at the moment.
- Parameters
rand – Random number source to use.
useTop – Whether to create and use the topology during the creation process.
density – Target density of the box. 0 means an infinite box?
minDist – Minimum distance for the conformation to be considered intersecting, and therefore invalid.
-
void legacyMorphIntoSAW(Random &rand, bool useTop = false, double density = 1e-4 * atom / pow(angstrom, 3.0), double minDist = 4.56 * angstrom, bool nativeBondLen = false)
Morphing the model into a self-avoiding walk. A version which replicates the behavior of the Fortran code but in a more clear way.
- Parameters
rand – Random number source to use.
useTop – Whether to create and use the topology during the creation process.
density – Target density of the box. 0 means an infinite box?
minDist – Minimum distance for the conformation to be considered intersecting, and therefore invalid.
nativeBondLen – Whether to derive the bond lengths from the native structure. By default the bond lengths are 3.8 angstrem; if
nativeBondLen
is true, the bond length is taken to be a mean bond length in the native structure.
-
void exactLegacySAW(Random &rand, bool useTop = false, double density = 0.0 * atom / pow(angstrom, 3.0), double minDist = 4.56 * angstrom, double bond = 3.8 * angstrom)
Morphing the model into a self-avoiding walk. A version which replicates (one-by-one) the code of the Fortran version. It is also less intuitive because of it.
- Parameters
rand – Random number source to use.
useTop – Whether to create and use the topology during the creation process.
density – Target density of the box. 0 means an infinite box?
minDist – Minimum distance for the conformation to be considered intersecting, and therefore invalid. Note, from what I see the intersection is checked only for each chain internally, and not across the chains.
bond – Default bond length to use.
-
void initVelocity(Random &rand, double temperature, bool useMass = true)
Initialize velocities of the residues, assuming they are placed in a medium with a given temperature.
- Parameters
rand – Random number source to use.
temperature – Temperature of the medium.
useMass – Whether to account for different masses of the residues.
-
StructuredPart &addContactMap(cmap::ContactMap const &contactMap)
-
void addCMapContacts(cmap::ContactMap const &contactMap, Chain &chain)
-
void useAverageMasses()
Set the masses of all residues to be equal to the mean of the current masses.
Public Members
-
int n = 0
The number of residues in the model.
-
std::vector<StructuredPart> structuredParts
Private Functions
-
struct Chain
Public Members
-
int idx
-
int start
-
int end
-
std::vector<int> structuredParts
A list of indices of structured parts that are overlayed over the chain.
-
int idx
-
struct Contact
-
struct Residue
A structure representing a single “residue”, or a pseudoatom, of the model.
-
struct StructuredPart
-
Chain &addChain()