4.5.2. Updated nucleic acid analysis — MDAnalysis.analysis.nucleicacids

Author:

Alia Lescoulie

Year:

2022

copyright:

GNU Public Licence v3

The module provides classes for analyzing nucleic acids structures. This is an updated, higher performance version of previous nucleic acid tools. For applications see [1][2].

References

4.5.2.1. Distances

class MDAnalysis.analysis.nucleicacids.NucPairDist(selection1: List[AtomGroup], selection2: List[AtomGroup], **kwargs)[source]

Atom Pair distance calculation base class.

Takes two lists of AtomGroup and computes the distances between them over a trajectory. Used as a superclass for the other nucleic acid distances classes. The distance will be measured between atoms sharing an index in the two lists of AtomGroup.

Parameters:
  • selection1 (List[AtomGroup]) – List of AtomGroup containing an atom of each nucleic acid being analyzed.

  • selection2 (List[AtomGroup]) – List of AtomGroup containing an atom of each nucleic acid being analyzed.

  • kwargs (dict) – Arguments for AnalysisBase

times

Simulation times for analysis.

Type:

numpy.ndarray

results.pair_distances

2D array of pair distances. First dimension is simulation time, second dimension contains the pair distances for each each entry pair in selection1 and selection2.

New in version 2.4.0.

Type:

numpy.ndarray

Raises:

ValueError – If the selections given are not the same length

Changed in version 2.5.0: The ability to access by passing selection indices to results is is now removed as of MDAnalysis version 2.5.0. Please use results.pair_distances instead. The results.times was deprecated and is now removed as of MDAnalysis 2.5.0. Please use the class attribute times instead.

run(start=None, stop=None, step=None, frames=None, verbose=None, *, progressbar_kwargs={})

Perform the calculation

Parameters:
  • start (int, optional) – start frame of analysis

  • stop (int, optional) – stop frame of analysis

  • step (int, optional) – number of frames to skip between each analysed frame

  • frames (array_like, optional) –

    array of integers or booleans to slice trajectory; frames can only be used instead of start, stop, and step. Setting both frames and at least one of start, stop, step to a non-default value will raise a ValueError.

    New in version 2.2.0.

  • verbose (bool, optional) – Turn on verbosity

  • progressbar_kwargs (dict, optional) – ProgressBar keywords with custom parameters regarding progress bar position, etc; see MDAnalysis.lib.log.ProgressBar for full list.

Changed in version 2.2.0: Added ability to analyze arbitrary frames by passing a list of frame indices in the frames keyword argument.

Changed in version 2.5.0: Add progressbar_kwargs parameter, allowing to modify description, position etc of tqdm progressbars

class MDAnalysis.analysis.nucleicacids.WatsonCrickDist(strand1: List[Residue], strand2: List[Residue], n1_name: str = 'N1', n3_name: str = 'N3', g_name: str = 'G', a_name: str = 'A', u_name: str = 'U', t_name: str = 'T', c_name: str = 'C', **kwargs)[source]

Watson-Crick basepair distance for selected residues over a trajectory.

Takes two lists of Residue objects and calculates the Watson-Crick distance between them over the trajectory. Bases are matched by their index in the lists given as arguments.

Parameters:
  • strand1 (List[Residue]) – First list of bases

  • strand2 (List[Residue]) – Second list of bases

  • n1_name (str (optional)) – Name of Nitrogen 1 of nucleic acids, by default assigned to N1

  • n3_name (str (optional)) – Name of Nitrogen 3 of nucleic acids, by default assigned to N3

  • g_name (str (optional)) – Name of Guanine in topology, by default assigned to G

  • a_name (str (optional)) – Name of Adenine in topology, by default assigned to A

  • u_name (str (optional)) – Name of Uracil in topology, by default assigned to U

  • t_name (str (optional)) – Name of Thymine in topology, by default assigned to T

  • c_name (str (optional)) – Name of Cytosine in topology, by default assigned to C

  • **kwargs (dict) – arguments for AnalysisBase

times

Simulation times for analysis.

Type:

numpy.ndarray

results.pair_distances

2D array of Watson-Crick basepair distances. First dimension is simulation time, second dimension contains the pair distances for each each entry pair in strand1 and strand2.

New in version 2.4.0.

Type:

numpy.ndarray

Raises:
  • ValueError – If the residues given are not amino acids

  • ValueError – If the selections given are not the same length

Changed in version 2.5.0: Accessing results by passing strand indices to results is was deprecated and is now removed as of MDAnalysis version 2.5.0. Please use results.pair_distances instead. The results.times was deprecated and is now removed as of MDAnalysis 2.5.0. Please use the class attribute times instead.

run(start=None, stop=None, step=None, frames=None, verbose=None, *, progressbar_kwargs={})

Perform the calculation

Parameters:
  • start (int, optional) – start frame of analysis

  • stop (int, optional) – stop frame of analysis

  • step (int, optional) – number of frames to skip between each analysed frame

  • frames (array_like, optional) –

    array of integers or booleans to slice trajectory; frames can only be used instead of start, stop, and step. Setting both frames and at least one of start, stop, step to a non-default value will raise a ValueError.

    New in version 2.2.0.

  • verbose (bool, optional) – Turn on verbosity

  • progressbar_kwargs (dict, optional) – ProgressBar keywords with custom parameters regarding progress bar position, etc; see MDAnalysis.lib.log.ProgressBar for full list.

Changed in version 2.2.0: Added ability to analyze arbitrary frames by passing a list of frame indices in the frames keyword argument.

Changed in version 2.5.0: Add progressbar_kwargs parameter, allowing to modify description, position etc of tqdm progressbars