dnaMD.dnaEY class
dnaMD.dnaEY class

Extract the parameters for calculations 

Calculate BendingStretchingTwisting matrix 

Calculate StretchingTwisting matrix 

Calculate moduli as a function of time for convergence check 

Deformation energy of the input DNA using Global elastic properties 

Extract the local parameters for calculations 

Calculate local elastic matrix or stiffness matrix for local DNA segment 

Calculate local elastic properties as a function of time for convergence check 

Calculate local elastic properties of consecutive overlapped DNA segments 

Deformation energy of the input DNA using local elastic properties 
Deformation energy of the consecutive overlapped DNA segments 
dnaMD.dnaEY documentation
 class dnaEY(num_bp, esType='ST', filename=None, startBP=1)[source]
Elastic Properties Class to calculate elasticity and deformation free energy
To initialize this class:
dna = dnaEY(60, 'BST', filename='dna.h5') # 60 is the number of basepairs
This class also contains several methods (functions) that are discussed in following sections.
 Parameters:
num_bp (int) – Number of basepairs in DNA
esType (str) –
Elastic Properties type:
'BST'
or'ST'
'BST'
: BendingStretchingTwisting — All motions are considered'ST'
: StretchingTwisting — Bending motions are ignored.
Warning
For accurate calculation of bending motions, DNA structures in trajectory must be superimposed on a reference structure (See Publication’s Method Section).
filename (str) – HDF5 (.h5) file containing DNA data. In case of
esType='BST'
, it must contains coordinate of global helical axis (done bydnaMD.generate_smooth_axis()
or ‘dnaMD axisCurv’).startBP (int) – Number ID of first basepair.
 num_bp
Number of basepairs in DNA
 Type:
int
 esType
Elastic Properties type:
'BST'
or'ST'
'BST'
: BendingStretchingTwisting — All motions are considered'ST'
: StretchingTwisting — Bending motions are ignored.
Warning
For accurate calculation of bending motions, DNA structures in trajectory must be superimposed on a reference structure (See Publication’s Method Section).
 Type:
str
 filename
HDF5 (.h5) file containing DNA data. In case of
esType='BST'
, it must contains coordinate of global helical axis (done bydnaMD.generate_smooth_axis()
ordnaMD axisCurv
). Type:
str
 startBP
Number ID of first basepair.
 Type:
int
 esMatrix
Dictionary of Elastic Matrices. When a combination of new DNA segment and Trajectory segment is given, its Elastic Matrix is calculated and stored in this dictionary. It reduces time, when same DNA segment and Trajectory segment is given to calculate elastic properties.
Note
This and
dnaEY.minimumPoint
dictionary can be saved as a json file for later use. Type:
dict
 minimumPoint
Dictionary of minimum points on energy landscape. The dictionary keywords are similar to that of
dnaEY.esMatrix
. It is generated to speed up the calculation. It contains minimum (average) points for the motions. It is used in the calculation of deformation free energy.Note
This and
dnaEY.esMatrix
dictionary can be saved as a json file for later use. Type:
dict
 _calcEnergyBendStretchTwist(diff, es, which)[source]
Calculate energy for
esType='BST'
using a difference vector.It is called in
dnaEY.getGlobalDeformationEnergy()
for energy calculation of each frame. Parameters:
diff (numpy.ndarray) –
Array of difference between minimum and current parameter values.
\[\mathbf{x} = \begin{bmatrix} (\theta^{x}_{i}  \theta^{x}_0) & (\theta^{y}_{i}  \theta^{y}_0) & (L_i  L_0) & (\phi_i  \phi_0) \end{bmatrix}\]es (numpy.ndarray) – Elastic matrix. See in
dnaEY.getStretchTwistBendModulus()
about elastic matrix.which (str) – For which type of motions, energy will be calculated. see
which
parameter indnaEY.getGlobalDeformationEnergy()
for keywords.
 Returns:
energy – Deformation free energy value
 Return type:
float
 _calcEnergyStretchTwist(diff, es, which)[source]
Calculate energy for
estype='ST'
using a difference vector.It is called in
dnaEY.getGlobalDeformationEnergy()
for energy calculation of each frame. Parameters:
diff (numpy.ndarray) –
Array of difference between minimum and current parameter values.
\[\mathbf{x} = \begin{bmatrix} (L_i  L_0) & (\phi_i  \phi_0) \end{bmatrix}\]es (numpy.ndarray) – Elastic matrix. See in
dnaEY.getStretchTwistModulus()
about elastic matrix.which (str) – For which type of motions, energy will be calculated. See
which
parameter indnaEY.getGlobalDeformationEnergy()
for keywords.
 Returns:
energy – Deformation free energy value
 Return type:
float
 _calcLocalEnergy(diff, es, which)[source]
Calculate local deformation energy using a difference vector.
It is called in
dnaEY.getLocalDeformationEnergy()
for energy calculation of each frame. Parameters:
diff (numpy.ndarray) – Array of difference between minimum and current parameter values.
es (numpy.ndarray) – Elastic matrix. See in
dnaEY.calculateLocalElasticity()
about elastic matrix.which (str) – For which type of motions, energy will be calculated. see
which
parameter indnaEY.getLocalDeformationEnergy()
for keywords.
 Returns:
energy – Deformation free energy value
 Return type:
float
 calculateLocalElasticity(bp, frames=None, helical=False, unit='kT')[source]
Calculate local elastic matrix or stiffness matrix for local DNA segment
Note
Here local DNA segment referred to less than 5 basepair long.
In case of Basestep parameters: Shift (\(Dx\)), Slide (\(Dy\)), Rise (\(Dz\)), Tilt (\(\tau\)), Roll (\(\rho\)) and Twist (\(\omega\)), following elastic matrix is calculated.
\[\begin{split}\mathbf{K}_{basestep} = \begin{bmatrix} K_{Dx} & K_{Dx,Dy} & K_{Dx,Dz} & K_{Dx,\tau} & K_{Dx,\rho} & K_{Dx,\omega} \\ K_{Dx,Dy} & K_{Dy} & K_{Dy,Dz} & K_{Dy,\tau} & K_{Dy,\rho} & K_{Dy,\omega} \\ K_{Dx,Dz} & K_{Dy,Dz} & K_{Dz} & K_{Dz,\tau} & K_{Dz,\rho} & K_{Dz,\omega} \\ K_{Dx,\tau} & K_{Dy,\tau} & K_{Dz,\tau} & K_{\tau} & K_{\tau, \rho} & K_{\tau,\omega} \\ K_{Dx,\rho} & K_{Dy,\rho} & K_{Dz,\rho} & K_{\tau, \rho} & K_{\rho} & K_{\rho,\omega} \\ K_{Dx,\omega} & K_{Dy,\omega} & K_{Dz,\omega} & K_{\tau, \omega} & K_{\rho, \omega} & K_{\omega} \\ \end{bmatrix}\end{split}\]In case of Helical Basestep parameters: xdisplacement (\(dx\)), ydisplacement (\(dy\)), hrise (\(h\)), inclination (\(\eta\)), tip (\(\theta\)) and twist (\(\Omega\)), following elastic matrix is calculated.
\[\begin{split}\mathbf{K}_{helicalbasestep} = \begin{bmatrix} K_{dx} & K_{dx,dy} & K_{dx,h} & K_{dx,\eta} & K_{dx,\theta} & K_{dx,\Omega} \\ K_{dx,dy} & K_{dy} & K_{dy,h} & K_{dy,\eta} & K_{dy,\theta} & K_{dy,\Omega} \\ K_{dx,h} & K_{dy,h} & K_{h} & K_{h,\eta} & K_{h,\theta} & K_{h,\Omega} \\ K_{dx,\eta} & K_{dy,\eta} & K_{h,\eta} & K_{\eta} & K_{\eta, \theta} & K_{\eta,\Omega} \\ K_{dx,\theta} & K_{dy,\theta} & K_{h,\theta} & K_{\eta, \theta} & K_{\theta} & K_{\theta,\Omega} \\ K_{dx,\Omega} & K_{dy,\Omega} & K_{h,\Omega} & K_{\eta, \Omega} & K_{\theta, \Omega} & K_{\Omega} \\ \end{bmatrix}\end{split}\] Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frames (list) – List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.helical (bool) – If
helical=True
, elastic matrix for helical basestep parameters are calculated. Otherwise, by default, elastic matrix for basestep parameters are calculated.unit (str) – Unit of energy. Allowed units are:
'kT', 'kJ/mol' and 'kcal/mol'
.
 Returns:
mean (numpy.ndarray) – Value of parameters at which energy is zero. Minimum point on energy landscape.
if
helical=False
\[\begin{bmatrix} Dx_0 & Dy_0 & Dz_0 & \tau_0 & \rho_0 & \omega_0 \end{bmatrix}\]if
helical=True
\[\begin{bmatrix} dx_0 & dy_0 & h_0 & \eta_0 & \theta_0 & \Omega_0 \end{bmatrix}\]result (numpy.ndarray) – Elastic matrix.
 calculateLocalElasticitySegments(bp, span=2, frameGap=None, helical=False, unit='kT', err_type='block', tool='gmx analyze', outFile=None)[source]
Calculate local elastic properties of consecutive overlapped DNA segments
Calculate local elastic properties of consecutive overlapped DNA segments of length given by span.
 Parameters:
bp (list) – List of two basesteps forming the global DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.span (int) – Length of overlapping (local) DNA segments. It should be less than four.
frameGap (int) – How many frames to skip for next timeframe. Lower the number, slower will be the calculation.
helical (bool) – If
helical=True
, elastic matrix for helical basestep parameters are calculated. Otherwise, by default, elastic matrix for basestep parameters are calculated.unit (str) – Unit of energy. Allowed units are:
'kT', 'kJ/mol' and 'kcal/mol'
.err_type (str) – Error estimation by autocorrelation method
err_type='acf'
or block averaging methoderr_type='block'
tool (str) – GROMACS tool to calculate error. In older versions it is g_analyze while in newer versions (above 2016) it is gmx analyze.
outFile (str) – Output file in csv format.
 Returns:
segments (list) – list of DNA segments for which local elastic properties was calculated.
elasticities (OrderedDict) – A ordered dictionary of 1D arrays of shape (segments). The keys in dictionary are name of the elasticity in the same order as listed above.
error (OrderedDict) – A ordered dictionary of 1D arrays of shape (segments). The keys in dictionary are name of the elasticity in the same order as listed above..
 extractGlobalParameters(dna, bp, frames=None, paxis='Z', masked=False)[source]
Extract the parameters for calculations
 Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frames (list) – List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.paxis (str) – Axis parallel to global helicalaxis(
'X'
, or'Y'
or'Z'
). Only require when bending motions are included in the calculation.masked (bool) –
Default=False
. To skip specific frames/snapshots.DNA.mask
array should be set to use this functionality. This array contains boolean (eitherTrue
orFalse
) value for each frame to mask the frames. Presently, mask array is automatically generated duringdnaMD.DNA.generate_smooth_axis()
to skip those frames where 3D fitting curve was not successful within the given criteria.
 Returns:
time (numpy.ndarray) – 1D numpy array of shape (nframes) containing time
array (numpy.ndarray) – 2D numpy array of shape (parameters count, nframes) containing extracted parameters.
 extractLocalParameters(dna, bp, helical=False, frames=None)[source]
Extract the local parameters for calculations
 Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frames (list) – List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.helical (bool) – If
helical=True
, helical basestep parameters are extracted. Otherwise, by default, basestep parameters are extracted.
 Returns:
time (numpy.ndarray) – 1D numpy array of shape (nframes) containing time
array (numpy.ndarray) – 2D numpy array of shape (6, nframes) containing extracted parameters.
 getGlobalDeformationEnergy(bp, complexDna, freeDnaFrames=None, boundDnaFrames=None, paxis='Z', which='all', masked=False, outFile=None)[source]
Deformation energy of the input DNA using Global elastic properties
It can be used to calculated deformation energy of a input DNA with reference to the DNA present in the current object.
The deformation free energy is calculated using elastic matrix as follows
\[G = \frac{1}{2L_0}\mathbf{xKx^T}\]\[\mathbf{x} = \begin{bmatrix} (\theta^{x}  \theta^{x}_0) & (\theta^{y}  \theta^{y}_0) & (L  L_0) & (\phi  \phi_0) \end{bmatrix}\] Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.complexDna (
dnaMD.DNA
) – InputdnaMD.DNA
instance for which deformation energy will be calculated.freeDnaFrames (list) – To select a trajectory segment of current (free) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.boundDnaFrames (list) – To select a trajectory segment of input (bound) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.paxis (str) – Axis parallel to global helicalaxis(
'X'
, or'Y'
or'Z'
). Only require when bending motions are included in the calculation.which (str or list) –
For which motions, energy should be calculated. It should be either a list containing terms listed below or “all” for all energy terms.
 Following keywords are available:
'full'
: Use entire elastic matrix – all motions with their coupling'diag'
: Use diagonal of elastic matrix – all motions but no coupling'b1'
: Only bending1 motion'b2'
: Only bending2 motion'stretch'
: Only stretching motion'twist'
: Only Twisting motions'st_coupling'
: Only stretchtwist coupling motion'bs_coupling'
: Only Bending and stretching coupling'bt_coupling'
: Only Bending and Twisting coupling'bb_coupling'
: Only bending1 and bending2 coupling'bend'
: Both bending motions with their coupling'st'
: Stretching and twisting motions with their coupling'bs'
: Bending (b1, b2) and stretching motions with their coupling'bt'
: Bending (b1, b2) and twisting motions with their coupling
masked (bool) –
Default=False
. To skip specific frames/snapshots.DNA.mask
array should be set to use this functionality. This array contains boolean (eitherTrue
orFalse
) value for each frame to mask the frames. Presently, mask array is automatically generated duringdnaMD.DNA.generate_smooth_axis()
to skip those frames where 3D fitting curve was not successful within the given criteria.outFile (str) – Output file in csv format.
 Returns:
time (numpy.ndarray) – 1D array containing time values.
energy (OrderedDict of numpy.ndarray) – Dictionary of 1D array of shape (nframes) containing energy terms requested for DNA.
 getLocalDeformationEnergy(bp, complexDna, freeDnaFrames=None, boundDnaFrames=None, helical=False, unit='kT', which='all', outFile=None)[source]
Deformation energy of the input DNA using local elastic properties
The deformation energy of a basestep/s for probe DNA object with reference to the same basestep/s DNA present in the current DNA object.
The deformation free energy is calculated using elastic matrix as follows
\[G = \frac{1}{2}\mathbf{xKx^T}\]When
helical='False'
\[\mathbf{K} = \mathbf{K}_{basestep}\]\[\mathbf{x} = \begin{bmatrix} (Dx_{i}Dx_0) & (Dy_i  Dy_0) & (Dz_i  Dz_0) & (\tau_i  \tau_0) & (\rho_i  \rho_0) & (\omega_i  \omega_0) \end{bmatrix}\]When
helical='True'
\[\mathbf{K} = \mathbf{K}_{helicalbasestep}\]\[\mathbf{x} = \begin{bmatrix} (dx_{i}dx_0) & (dy_i  dy_0) & (h_i  h_0) & (\eta_i  \eta_0) & (\theta_i  \theta_0) & (\Omega_i  \Omega_0) \end{bmatrix}\] Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.complexDna (
dnaMD.DNA
) – InputdnaMD.DNA
instance for which deformation energy will be calculated.freeDnaFrames (list) – To select a trajectory segment of current (free) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.boundDnaFrames (list) – To select a trajectory segment of input (bound) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.helical (bool) – If
helical=True
, elastic matrix for helical basestep parameters are calculated. Otherwise, by default, elastic matrix for basestep parameters are calculated.unit (str) – Unit of energy. Allowed units are:
'kT', 'kJ/mol' and 'kcal/mol'
.which (str or list) –
For which motions (degrees of freedom), energy should be calculated. It should be either a list containing terms listed below or”all” for all energy terms.
 Following keywords are available:
'full'
: Use entire elastic matrix – all parameters with their coupling'diag'
: Use diagonal of elastic matrix – all motions but no coupling'shift'
or'xdisp'
'slide'
or'yidsp'
'rise'
or'hrise'
'tilt'
or'inclination'
'roll'
or'tip'
'twist'
or'htwist'
outFile (str) – Output file in csv format.
 Returns:
time (numpy.ndarray) – 1D array containing time values.
energy (dict of numpy.ndarray) – Dictionary of 1D array of shape (nframes) containing energy terms requested for DNA.
 getLocalDeformationEnergySegments(bp, complexDna, span=2, freeDnaFrames=None, boundDnaFrames=None, helical=False, unit='kT', which='all', err_type='block', tool='gmx analyze', outFile=None)[source]
Deformation energy of the consecutive overlapped DNA segments
It can be used to calculate deformation energy of several basestep/s from input DNA object with reference to the same basestep/s DNA present in the current DNA object.
For local deformation energy calculation see
dnaEY.getLocalDeformationEnergy()
. Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.span (int) – Length of overlapping (local) DNA segments. It should be less than four.
complexDna (
dnaMD.DNA
) – InputdnaMD.DNA
instance for which deformation energy will be calculated.freeDnaFrames (list) – To select a trajectory segment of current (free) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.boundDnaFrames (list) – To select a trajectory segment of input (bound) DNA data. List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.helical (bool) – If
helical=True
, elastic matrix for helical basestep parameters are calculated. Otherwise, by default, elastic matrix for basestep parameters are calculated.unit (str) – Unit of energy. Allowed units are:
'kT', 'kJ/mol' and 'kcal/mol'
.which (str or list) –
For which motions (degrees of freedom), energy should be calculated. It should be either a list containing terms listed below or “all” for all energy terms.
 Following keywords are available:
'full'
: Use entire elastic matrix – all parameters with their coupling'diag'
: Use diagonal of elastic matrix – all motions but no coupling'shift'
or'xdisp'
'slide'
or'yidsp'
'rise'
or'hrise'
'tilt'
or'inclination'
'roll'
or'tip'
'twist'
or'htwist'
err_type (str) – Error estimation by autocorrelation method
err_type='acf'
or block averaging methoderr_type='block'
tool (str) – GROMACS tool to calculate error. In older versions it is g_analyze while in newer versions (above 2016) it is gmx analyze.
outFile (str) – Output file in csv format.
 Returns:
segments (list) – list of DNA segments for which local deformation energy was calculated.
energies (dict of numpy.ndarray) – Dictionary of 1D array of shape (segments) containing energy terms requested for DNA.
error (OrderedDict) – A ordered dictionary of 1D arrays of shape (segments). The keys in dictionary are energyterms in the same order as listed above..
 getLocalElasticityByTime(bp, frameGap, helical=False, unit='kT', outFile=None)[source]
Calculate local elastic properties as a function of time for convergence check
It can be used to obtained elastic properties as a function of time.
Note
Elastic properties cannot be calculated using a single frame because fluctuations are required. Therefore, here time means trajectory between zero time to given time.
When
helical='False'
, following is obtained:Shift (\(K_{Dx}\))
Slide (\(K_{Dy}\))
Rise (\(K_{Dz}\))
Tilt (\(K_{\tau}\))
Roll (\(K_{\rho}\))
Twist (\(K_{\omega}\))
\(K_{Dx,Dy}\)
\(K_{Dy,Dz}\)
\(K_{Dz,\tau}\)
\(K_{\tau, \rho}\)
\(K_{\rho,\omega}\)
\(K_{Dx,Dz}\)
\(K_{Dy,\tau}\)
\(K_{Dz,\rho}\)
\(K_{\tau,\omega}\)
\(K_{Dx,\tau}\)
\(K_{Dy,\rho}\)
\(K_{Dz,\omega}\)
\(K_{Dx,\rho}\)
\(K_{Dy,\omega}\)
\(K_{Dx,\omega}\)
When
helical='True'
, following is obtained:Shift (\(K_{Dx}\))
Slide (\(K_{Dy}\))
Rise (\(K_{h}\))
Tilt (\(K_{\eta}\))
Roll (\(K_{\theta}\))
Twist (\(K_{\Omega}\))
\(K_{dx,dy}\)
\(K_{dy,h}\)
\(K_{h,\eta}\)
\(K_{\eta, \theta}\)
\(K_{\theta,\Omega}\)
\(K_{dx,h}\)
\(K_{dy,\eta}\)
\(K_{h,\theta}\)
\(K_{\tau,\Omega}\)
\(K_{dx,\eta}\)
\(K_{dy,\theta}\)
\(K_{h,\Omega}\)
\(K_{dx,\theta}\)
\(K_{dy,\Omega}\)
\(K_{dx,\Omega}\)
 Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frameGap (int) – How many frames to skip for next timeframe. Lower the number, slower will be the calculation.
helical (bool) – If
helical=True
, elastic matrix for helical basestep parameters are calculated. Otherwise, by default, elastic matrix for basestep parameters are calculated.unit (str) – Unit of energy. Allowed units are:
'kT', 'kJ/mol' and 'kcal/mol'
.outFile (str) – Output file in csv format.
 Returns:
time (numpy.ndarray) – 1D array containing time values of shape (nframes).
Elasticities (OrderedDict) – A ordered dictionary of 1D arrays of shape (nframes). The keys in dictionary are name of the elasticity in the same order as listed above. e.g.
Elasticities['shift']
will give elasticity along shift parameters as a function of time.
 getModulusByTime(bp, frameGap, masked=False, paxis='Z', outFile=None)[source]
Calculate moduli as a function of time for convergence check
It can be used to obtained elastic moduli as a function of time to check their convergence.
Note
Elastic properties cannot be calculated using a single frame because fluctuations are required. Therefore, here time means trajectory between zero time to given time.
When
esType='BST'
, following is obtained:bend1
bend2
stretch
twist
bend1bend2
bend2stretch
stretchtwist
bend1stretch
bend2twist
bend1twist
When
esType='ST'
, following is obtained:stretch
twist
stretchtwist
 Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frameGap (int) – How many frames to skip for next calculation. this option will determine the timegap between each calculation. Lower the number, slower will be the calculation.
masked (bool) –
Default=False
. To skip specific frames/snapshots.DNA.mask
array should be set to use this functionality. This array contains boolean (eitherTrue
orFalse
) value for each frame to mask the frames. Presently, mask array is automatically generated duringdnaMD.DNA.generate_smooth_axis()
to skip those frames where 3D fitting curve was not successful within the given criteria.paxis (str) – Axis parallel to global helicalaxis(
'X'
, or'Y'
or'Z'
). Only require when bending motions are included in the calculation.outFile (str) – Output file in csv format.
 Returns:
time (numpy.ndarray) – 1D array containing time values of shape (nframes).
Elasticities (OrderedDict) – A ordered dictionary of 1D arrays of shape (nframes). The keys in dictionary are name of the elasticity in the same order as listed above. e.g.
Elasticities['stretch']
will give elasticity along stretching as a function of time.
 getStretchTwistBendModulus(bp, frames=None, paxis='Z', masked=True, matrix=False)[source]
Calculate BendingStretchingTwisting matrix
It calculate elastic matrix and modulus matrix.
\[\begin{split}\text{modulus matrix} = 4.1419464 \times \begin{bmatrix} K_{Bx} & K_{Bx,By} & K_{Bx,S} & K_{Bx,T} \\ K_{Bx,By} & K_{By} & K_{By,S} & K_{By,T} \\ K_{Bx,S} & K_{By,S} & K_{S} & K_{S,T} \\ K_{Bx,T} & K_{Bx,T} & K_{S,T} & K_{T} \end{bmatrix} \times L_0\end{split}\] Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frames (list) – List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.paxis (str) – Axis parallel to global helicalaxis(
'X'
, or'Y'
or'Z'
). Only require when bending motions are included in the calculation.masked (bool) –
Default=False
. To skip specific frames/snapshots.DNA.mask
array should be set to use this functionality. This array contains boolean (eitherTrue
orFalse
) value for each frame to mask the frames. Presently, mask array is automatically generated duringdnaMD.DNA.generate_smooth_axis()
to skip those frames where 3D fitting curve was not successful within the given criteria.matrix (bool) – If it is
True
, elastic constant matrix will be returned. Otherwise, by default modulus matrix will be returned.
 Returns:
mean (numpy.ndarray) – Value of bending angles, contour length and twist angle (as 1D array) at which energy is zero. Minimum point on free energy landscape.
\[\begin{bmatrix} \theta^{x}_0 & \theta^{y}_0 & L_0 & \phi_0 \end{bmatrix}\]result (numpy.ndarray) – Either elastic matrix or modulus matrix depending on
matrix
value.
 getStretchTwistModulus(bp, frames=None, masked=False, matrix=False)[source]
Calculate StretchingTwisting matrix
It calculate elastic matrix and modulus matrix.
\[\begin{split}\text{modulus matrix} = 4.1419464 \times \begin{bmatrix} K_{S} & K_{S,T} \\ K_{S,T} & K_{T} \end{bmatrix} \times L_0\end{split}\] Parameters:
bp (list) – List of two basesteps forming the DNA segment. For example: with
bp=[5, 50]
, 550 basestep segment will be considered.frames (list) – List of two trajectory frames between which parameters will be extracted. It can be used to select portions of the trajectory. For example, with
frames=[100, 1000]
, 100th to 1000th frame of the trajectory will be considered.masked (bool) –
Default=False
. To skip specific frames/snapshots.DNA.mask
array should be set to use this functionality. This array contains boolean (eitherTrue
orFalse
) value for each frame to mask the frames. Presently, mask array is automatically generated duringdnaMD.DNA.generate_smooth_axis()
to skip those frames where 3D fitting curve was not successful within the given criteria.matrix (bool) – If it is
True
, elastic constant matrix will be returned. Otherwise, by default modulus matrix will be returned.
 Returns:
mean (numpy.ndarray) – Value of bending angles, contour length and twist angle (as 1D array) at which energy is zero. Minimum point on free energy landscape.
\[\begin{bmatrix} L_0 & \phi_0 \end{bmatrix}\]result (numpy.ndarray) – Either elastic matrix or modulus matrix depending on
matrix
value.