dnaMD.dnaEY class

dnaMD.dnaEY class

dnaEY.extractGlobalParameters(dna, bp[, ...])

Extract the parameters for calculations

dnaEY.getStretchTwistBendModulus(bp[, ...])

Calculate Bending-Stretching-Twisting matrix

dnaEY.getStretchTwistModulus(bp[, frames, ...])

Calculate Stretching-Twisting matrix

dnaEY.getModulusByTime(bp, frameGap[, ...])

Calculate moduli as a function of time for convergence check

dnaEY.getGlobalDeformationEnergy(bp, complexDna)

Deformation energy of the input DNA using Global elastic properties

dnaEY.extractLocalParameters(dna, bp[, ...])

Extract the local parameters for calculations

dnaEY.calculateLocalElasticity(bp[, frames, ...])

Calculate local elastic matrix or stiffness matrix for local DNA segment

dnaEY.getLocalElasticityByTime(bp, frameGap)

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

dnaEY.calculateLocalElasticitySegments(bp[, ...])

Calculate local elastic properties of consecutive overlapped DNA segments

dnaEY.getLocalDeformationEnergy(bp, complexDna)

Deformation energy of the input DNA using local elastic properties

dnaEY.getLocalDeformationEnergySegments(bp, ...)

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 base-pairs in DNA

  • esType (str) –

    Elastic Properties type: 'BST' or 'ST'

    1. 'BST': Bending-Stretching-Twisting — All motions are considered

    2. 'ST' : Stretching-Twisting — 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 by dnaMD.generate_smooth_axis() or ‘dnaMD axisCurv’).

  • startBP (int) – Number ID of first basepair.

num_bp

Number of base-pairs in DNA

Type:

int

esType

Elastic Properties type: 'BST' or 'ST'

  1. 'BST': Bending-Stretching-Twisting — All motions are considered

  2. 'ST' : Stretching-Twisting — 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 by dnaMD.generate_smooth_axis() or dnaMD 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 in dnaEY.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 in dnaEY.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 in dnaEY.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 base-pair long.

In case of Base-step parameters: Shift (\(Dx\)), Slide (\(Dy\)), Rise (\(Dz\)), Tilt (\(\tau\)), Roll (\(\rho\)) and Twist (\(\omega\)), following elastic matrix is calculated.

\[\begin{split}\mathbf{K}_{base-step} = \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 Base-step parameters: x-displacement (\(dx\)), y-displacement (\(dy\)), h-rise (\(h\)), inclination (\(\eta\)), tip (\(\theta\)) and twist (\(\Omega\)), following elastic matrix is calculated.

\[\begin{split}\mathbf{K}_{helical-base-step} = \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 base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 base-step parameters are calculated. Otherwise, by default, elastic matrix for base-step 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 base-steps forming the global DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 time-frame. Lower the number, slower will be the calculation.

  • helical (bool) – If helical=True, elastic matrix for helical base-step parameters are calculated. Otherwise, by default, elastic matrix for base-step 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 method err_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:
  • dna (dnaMD.DNA) – Input dnaMD.DNA instance.

  • bp (list) – List of two base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 helical-axis('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 (either True or False) value for each frame to mask the frames. Presently, mask array is automatically generated during dnaMD.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:
  • dna (dnaMD.DNA) – Input dnaMD.DNA instance.

  • bp (list) – List of two base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 base-step parameters are extracted. Otherwise, by default, base-step 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 base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step segment will be considered.

  • complexDna (dnaMD.DNA) – Input dnaMD.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 helical-axis('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 bending-1 motion

    • 'b2' : Only bending-2 motion

    • 'stretch' : Only stretching motion

    • 'twist' : Only Twisting motions

    • 'st_coupling' : Only stretch-twist coupling motion

    • 'bs_coupling' : Only Bending and stretching coupling

    • 'bt_coupling' : Only Bending and Twisting coupling

    • 'bb_coupling' : Only bending-1 and bending-2 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 (either True or False) value for each frame to mask the frames. Presently, mask array is automatically generated during dnaMD.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 base-step/s for probe DNA object with reference to the same base-step/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}_{base-step}\]
\[\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}_{helical-base-step}\]
\[\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 base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step segment will be considered.

  • complexDna (dnaMD.DNA) – Input dnaMD.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 base-step parameters are calculated. Otherwise, by default, elastic matrix for base-step 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 'x-disp'

    • 'slide' or 'y-idsp'

    • 'rise' or 'h-rise'

    • 'tilt' or 'inclination'

    • 'roll' or 'tip'

    • 'twist' or 'h-twist'

  • 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 base-step/s from input DNA object with reference to the same base-step/s DNA present in the current DNA object.

For local deformation energy calculation see dnaEY.getLocalDeformationEnergy().

Parameters:
  • bp (list) – List of two base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step segment will be considered.

  • span (int) – Length of overlapping (local) DNA segments. It should be less than four.

  • complexDna (dnaMD.DNA) – Input dnaMD.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 base-step parameters are calculated. Otherwise, by default, elastic matrix for base-step 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 'x-disp'

    • 'slide' or 'y-idsp'

    • 'rise' or 'h-rise'

    • 'tilt' or 'inclination'

    • 'roll' or 'tip'

    • 'twist' or 'h-twist'

  • err_type (str) – Error estimation by autocorrelation method err_type='acf' or block averaging method err_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 energy-terms 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:

  1. Shift (\(K_{Dx}\))

  2. Slide (\(K_{Dy}\))

  3. Rise (\(K_{Dz}\))

  4. Tilt (\(K_{\tau}\))

  5. Roll (\(K_{\rho}\))

  6. Twist (\(K_{\omega}\))

  7. \(K_{Dx,Dy}\)

  8. \(K_{Dy,Dz}\)

  9. \(K_{Dz,\tau}\)

  10. \(K_{\tau, \rho}\)

  11. \(K_{\rho,\omega}\)

  12. \(K_{Dx,Dz}\)

  13. \(K_{Dy,\tau}\)

  14. \(K_{Dz,\rho}\)

  15. \(K_{\tau,\omega}\)

  16. \(K_{Dx,\tau}\)

  17. \(K_{Dy,\rho}\)

  18. \(K_{Dz,\omega}\)

  19. \(K_{Dx,\rho}\)

  20. \(K_{Dy,\omega}\)

  21. \(K_{Dx,\omega}\)

When helical='True', following is obtained:

  1. Shift (\(K_{Dx}\))

  2. Slide (\(K_{Dy}\))

  3. Rise (\(K_{h}\))

  4. Tilt (\(K_{\eta}\))

  5. Roll (\(K_{\theta}\))

  6. Twist (\(K_{\Omega}\))

  7. \(K_{dx,dy}\)

  8. \(K_{dy,h}\)

  9. \(K_{h,\eta}\)

  10. \(K_{\eta, \theta}\)

  11. \(K_{\theta,\Omega}\)

  12. \(K_{dx,h}\)

  13. \(K_{dy,\eta}\)

  14. \(K_{h,\theta}\)

  15. \(K_{\tau,\Omega}\)

  16. \(K_{dx,\eta}\)

  17. \(K_{dy,\theta}\)

  18. \(K_{h,\Omega}\)

  19. \(K_{dx,\theta}\)

  20. \(K_{dy,\Omega}\)

  21. \(K_{dx,\Omega}\)

Parameters:
  • bp (list) – List of two base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step segment will be considered.

  • frameGap (int) – How many frames to skip for next time-frame. Lower the number, slower will be the calculation.

  • helical (bool) – If helical=True, elastic matrix for helical base-step parameters are calculated. Otherwise, by default, elastic matrix for base-step 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:

  1. bend-1

  2. bend-2

  3. stretch

  4. twist

  5. bend-1-bend-2

  6. bend-2-stretch

  7. stretch-twist

  8. bend-1-stretch

  9. bend-2-twist

  10. bend-1-twist

When esType='ST', following is obtained:

  1. stretch

  2. twist

  3. stretch-twist

Parameters:
  • bp (list) – List of two base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step segment will be considered.

  • frameGap (int) – How many frames to skip for next calculation. this option will determine the time-gap 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 (either True or False) value for each frame to mask the frames. Presently, mask array is automatically generated during dnaMD.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 helical-axis('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 Bending-Stretching-Twisting 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 base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 helical-axis('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 (either True or False) value for each frame to mask the frames. Presently, mask array is automatically generated during dnaMD.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 Stretching-Twisting 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 base-steps forming the DNA segment. For example: with bp=[5, 50], 5-50 base-step 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 (either True or False) value for each frame to mask the frames. Presently, mask array is automatically generated during dnaMD.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.