3.5.2. Generation and Analysis of X3DNA helicoidal parameter profiles — MDAnalysis.analysis.x3dna
¶
Author: | Elizabeth Denning |
---|---|
Year: | 2013-2014 |
Copyright: | GNU Public License v2 |
With the help of this module, X3DNA can be run on frames in a trajectory. Data can be combined and analyzed. X3DNA [Lu2003] [Lu2008] must be installed separately.
References
[Lu2003] | Xiang-Jun Lu & Wilma K. Olson (2003). 3DNA: a software package for the analysis, rebuilding and visualization for three-dimensional nucleic acid structure Nucleic Acids Res. 31(17), 5108-21. |
[Lu2008] | Xiang-Jun Lu & Wilma K. Olson (2008). 3DNA: a versatile, integrated software system for the analysis, rebuilding and visualization of three-dimensional nucleic-acid structures. Nat Protoc. 3(7), 1213-27. |
Examples
3.5.2.1. Single structure¶
B-DNA structure:
from MDAnalysis.analysis.x3dna import X3DNA, X3DNAtraj
from MDAnalysis.tests.datafiles import PDB_X3DNA
# set path to your x3dna binary in bashrc file
H = X3DNA(PDB_X3DNA, executable="x3dna_ensemble analyze -b 355d.bps -p pdbfile")
H.run()
H.collect()
H.plot()
3.5.2.2. Trajectory¶
Analyzing a trajectory:
u = MDAnalysis.Universe(psf, trajectory)
H = X3DNAtraj(u, ...)
H.run()
H.plot()
H.save()
The profiles are available as the attribute X3DNAtraj.profiles
(H.profiles
in the example) and are indexed by frame number but
can also be indexed by an arbitrary order parameter as shown in the
next example.
3.5.2.2.1. Analysis¶
-
class
MDAnalysis.analysis.x3dna.
X3DNA
(filename, **kwargs)[source]¶ Run X3DNA on a single frame or a DCD trajectory.
Only a subset of all X3DNA control parameters is supported and can be set with keyword arguments. For further details on X3DNA see the X3DNA docs.
Running X3DNA with the
X3DNA
class is a 3-step process:- set up the class with all desired parameters
- run X3DNA with
X3DNA.run()
- collect the data from the output file with
X3DNA.collect()
The class also provides some simple plotting functions of the collected data such as
X3DNA.plot()
orX3DNA.plot3D()
.New in version 0.8.
Set up parameters to run X3DNA on PDB filename.
Parameters: *filename* – The filename is used as input for X3DNA in the “xdna_ensemble” command. It specifies the name of a PDB coordinate file to be used. This must be in Brookhaven protein databank format or something closely approximating this. Both ATOM and HETATM records are read. Note that if water molecules or ions are present in the channel these can be ignored on read by the use of the ignore_residues keyword.
Keywords: executable
Path to the xdna_ensemble executable directories (e.g.
/opt/x3dna/2.1 and /opt/x3dna/2.1/bin
) must be set and then added to export in bashrc file. See X3DNA documentation for set-up instructions.x3dna_param
Determines whether base step or base pair parameters will be calculated. If True then stacked base step parameters will be analyzed [Default is True]. If False then stacked base pair parameters will be analyzed.
-
profiles
¶ x3dna_ensemble analyze -b 355d.bps -p pdbfile attribute
: After runningX3DNA.collect()
, this dict contains all the X3DNA profiles, indexed by the frame number. If only a single frame was analyzed then this will beX3DNA.profiles[0]
. Note that the order is random; one needs to sort the keys first.
-
__delattr__
¶ x.__delattr__(‘name’) <==> del x.name
-
__format__
()¶ default object formatter
-
__getattribute__
¶ x.__getattribute__(‘name’) <==> x.name
-
__hash__
¶
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶
-
__setattr__
¶ x.__setattr__(‘name’, value) <==> x.name = value
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶
-
collect
(**kwargs)[source]¶ Parse the output from a X3DNA run into numpy recarrays.
Can deal with outputs containing multiple frames. Output format:
The method saves the result as
X3DNA.profiles
, a dictionary indexed by the frame number. Each entry is anp.recarray
.If the keyword outdir is supplied (e.g. ”.”) then each profile is saved to a gzipped data file.
Keywords: - run
identifier, free form [1]
- outdir
save output data under outdir/run if set to any other value but
None
[None
]
-
mean
()¶ H.mean() returns the mean value for the base parameters (order of base parameters:Shear,Stretch,Stagger, Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
-
mean_std
()¶ H.mean_std() returns the mean and standard deviation of base parameters (order of base parameters:Shear, Stretch,Stagger,Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
-
plot
(**kwargs)¶ - Plot base parameter profiles in a 1D graph
- (plotting of the mean and standard deviation parameter value for each individual base pair).
Keywords: Not available at this time
-
save
(filename='x3dna.pickle')¶ Save
profiles
as a Python pickle file filename.Load profiles dictionary with
import cPickle profiles = cPickle.load(open(filename))
-
sorted_profiles_iter
()¶ Return an iterator over profiles sorted by frame/order parameter q.
The iterator produces tuples
(q, profile)
.
-
std
()¶ H.std() returns the standard deviation of base parameters (order of base parameters:Shear,Stretch,Stagger, Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
-
class
MDAnalysis.analysis.x3dna.
X3DNAtraj
(universe, **kwargs)[source]¶ Analyze all frames in a trajectory.
The
X3DNA
class provides a direct interface to X3DNA. X3DNA itself has limited support for analysing trajectories but cannot deal with all the trajectory formats understood by MDAnalysis. This class can take any universe and feed it to X3DNA. By default it sequentially creates a PDB for each frame and runs X3DNA on the frame.Set up the class.
Parameters: - *universe* – The input trajectory as part of a
Universe
. trajectory is converted to a sequence of PDB files and X3DNA is run on each individual file. (Use the start, stop, and step keywords to slice the trajectory.) - stop, step (*start*,) – frame indices to slice the trajectory as
universe.trajectory[start, stop, step]
- *x3dna_param* – indicates whether stacked bases or stacked base-pairs will be analyzed. True is bases or False is stacked base-pairs [Default is True].
- *kwargs* – All other keywords are passed on to
X3DNA
(see there for description).
-
profiles
¶ After running
X3DNA.collect()
, this dict contains all the X3DNA profiles, indexed by the frame number.
-
__delattr__
¶ x.__delattr__(‘name’) <==> del x.name
-
__format__
()¶ default object formatter
-
__getattribute__
¶ x.__getattribute__(‘name’) <==> x.name
-
__hash__
¶
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶
-
__setattr__
¶ x.__setattr__(‘name’, value) <==> x.name = value
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶
-
mean
()¶ H.mean() returns the mean value for the base parameters (order of base parameters:Shear,Stretch,Stagger, Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
-
mean_std
()¶ H.mean_std() returns the mean and standard deviation of base parameters (order of base parameters:Shear, Stretch,Stagger,Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
-
plot
(**kwargs)¶ - Plot base parameter profiles in a 1D graph
- (plotting of the mean and standard deviation parameter value for each individual base pair).
Keywords: Not available at this time
-
run
(**kwargs)[source]¶ Run X3DNA on the whole trajectory and collect profiles.
Keyword arguments start, stop, and step can be used to only analyse part of the trajectory.
-
save
(filename='x3dna.pickle')¶ Save
profiles
as a Python pickle file filename.Load profiles dictionary with
import cPickle profiles = cPickle.load(open(filename))
-
sorted_profiles_iter
()¶ Return an iterator over profiles sorted by frame/order parameter q.
The iterator produces tuples
(q, profile)
.
-
std
()¶ H.std() returns the standard deviation of base parameters (order of base parameters:Shear,Stretch,Stagger, Buckle,Propeller,Opening,Shift,Slide,Rise,Tilt,Roll,Twist) for each nucleic acid pair.
- *universe* – The input trajectory as part of a