diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..53f5d96 --- /dev/null +++ b/404.html @@ -0,0 +1,641 @@ + + + +
+ + + + + + + + + + + + + + +Provides functions to calculate the radial distribution function (RDF) between +two groups of particles for specified windows along a trajectory g(r,t). +Groups can also consist of single particles.
+ + + +trrdf(
+ traj,
+ g1,
+ g2,
+ top=None,
+ pbc="ortho",
+ n_windows=100,
+ window_size=200,
+ skip=1,
+ stride=10,
+ r_range=(0.0, 2.0),
+ nbins=400,
+)
+
Calculate g(r,t) for two groups given in a trajectory. g(r) is +calculated for each frame in the trajectory, then averaged over +specified windows of time, returning g(r,t) (where t represents +the window time along the trajectory).
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
traj |
+
+
+
+ String pointing to the location of a trajectory that MDTraj is +able to load +
+
+ TYPE:
+ |
+
g1 |
+
+
+
+ List of numpy arrays of atom indices representing the group to +calculate G(r,t) for +
+
+ TYPE:
+ |
+
g2 |
+
+
+
+ List of numpy arrays of atom indices representing the group to +calculate G(r,t) with +
+
+ TYPE:
+ |
+
top |
+
+
+
+ Topology object. Needed if trajectory given as a path to lazy-load. +
+
+ TYPE:
+ |
+
pbc |
+
+
+
+ String representing the periodic boundary conditions of the +simulation cell. Currently, only 'ortho' for orthogonal simulation cells +is implemented. +
+
+ TYPE:
+ |
+
n_windows |
+
+
+
+ Number of windows in which to split the trajectory (if a whole +trajectory is supplied). +
+
+ TYPE:
+ |
+
window_size |
+
+
+
+ Number of frames in each window. +
+
+ TYPE:
+ |
+
skip |
+
+
+
+ Number of frames to skip at the beginning if giving a path as +trajectory. +
+
+ TYPE:
+ |
+
stride |
+
+
+
+ Number of frames in the original trajectory to skip between each +calculation. E.g. stride = 10 means calculate distances only every +10th frame. +
+
+ TYPE:
+ |
+
r_range |
+
+
+
+ Tuple over which r in g(r,t) is defined. +
+
+ TYPE:
+ |
+
nbins |
+
+
+
+ Number of bins (points in r to consider) in g(r,t) +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ r
+ |
+
+
+
+ bin centers of g(r,t) +
+
+ TYPE:
+ |
+
+ g_rt
+ |
+
+
+
+ averaged function values of g(r,t) for each time from t=0 considered +
+
+ TYPE:
+ |
+
Examples:
+First, import both MDTraj
and SPEADI
together.
Then, point to a particle simulation topology and trajectory (e.g. a Molecular Dynamics Simulation using Gromacs
).
Next, load the topology file using MDTraj
and start defining reference and target groups.
>>> top = md.load_topology(topology)
+>>> na = top.select('name NA')
+>>> cl = top.select('name CL')
+>>> protein_by_atom = [top.select(f'index {ix}') for
+>>> ix in top.select('protein and not type H')]
+
Finally, run the Time-Resolved Radial Distribution Function (TRRDF) by calling trrdf()
.
>>> r, g_rt = sp.trrdf(trajectory, protein_by_atom, [na, cl], top=top,
+>>> n_windows=1000, window_size=500, skip=0,
+>>> pbc='general', stride=1, nbins=400)
+
The outputs are
+the centre points of the radial bins r
the \(g(r,t)\) function with shape \(N\)(reference groups)\(\times N\)(target groups)\(\times N\)(windows)\(\times N\)(radial bins)
+speadi/time_resolved_rdf/trrdf.py
11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 |
|
Provides functions to calculate the integral of theradial distribution +function (RDF) between two groups of particles for specified windows +along a trajectory n(r,t). Groups can also consist of single particles.
+ + + +int_trrdf(
+ traj,
+ g1,
+ g2,
+ top=None,
+ pbc="ortho",
+ n_windows=100,
+ window_size=200,
+ skip=1,
+ stride=10,
+ r_range=(0.0, 2.0),
+ nbins=400,
+)
+
Calculate n(r,t) for two groups given in a trajectory. n(r) is +calculated for each frame in the trajectory, then averaged over +specified windows of time, returning n(r,t) (where t represents +the window time along the trajectory).
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
traj |
+
+
+
+ String pointing to the location of a trajectory that MDTraj is +able to load +
+
+ TYPE:
+ |
+
g1 |
+
+
+
+ List of numpy arrays of atom indices representing the group to +calculate G(r,t) for +
+
+ TYPE:
+ |
+
g2 |
+
+
+
+ List of numpy arrays of atom indices representing the group to +calculate G(r,t) with +
+
+ TYPE:
+ |
+
top |
+
+
+
+ Topology object. Needed if trajectory given as a path to lazy-load. +
+
+ TYPE:
+ |
+
pbc |
+
+
+
+ String representing the periodic boundary conditions of the +simulation cell. Currently, only 'ortho' for orthogonal simulation cells +is implemented. +
+
+ TYPE:
+ |
+
n_windows |
+
+
+
+ Number of windows in which to split the trajectory (if a whole +trajectory is supplied). +
+
+ TYPE:
+ |
+
window_size |
+
+
+
+ Number of frames in each window. +
+
+ TYPE:
+ |
+
skip |
+
+
+
+ Number of frames to skip at the beginning if giving a path as +trajectory. +
+
+ TYPE:
+ |
+
stride |
+
+
+
+ Number of frames in the original trajectory to skip between each +calculation. E.g. stride = 10 means calculate distances only every +10th frame. +
+
+ TYPE:
+ |
+
r_range |
+
+
+
+ Tuple over which r in n(r,t) is defined. +
+
+ TYPE:
+ |
+
nbins |
+
+
+
+ Number of bins (points in r to consider) in n(r,t) +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ r
+ |
+
+
+
+ bin centers of n(r,t) +
+
+ TYPE:
+ |
+
+ n_rt
+ |
+
+
+
+ averaged function values of n(r,t) for each time from t=0 considered +
+
+ TYPE:
+ |
+
Examples:
+First, import both MDTraj
and SPEADI
together.
Then, point to a particle simulation topology and trajectory (e.g. a Molecular Dynamics Simulation using Gromacs
).
Next, load the topology file using MDTraj
and start defining reference and target groups.
>>> top = md.load_topology(topology)
+>>> na = top.select('name NA')
+>>> cl = top.select('name CL')
+>>> protein_by_atom = [top.select(f'index {ix}') for
+>>> ix in top.select('protein and not type H')]
+
Finally, run the Time-Resolved Radial Distribution Function (TRRDF) by calling trrdf()
.
>>> r, n_rt = sp.int_trrdf(trajectory, protein_by_atom, [na, cl], top=top,
+>>> n_windows=1000, window_size=500, skip=0,
+>>> pbc='general', stride=1, nbins=400)
+
The outputs are
+the centre points of the radial bins r
the \(n(r,t)\) function with shape \(N\)(reference groups)\(\times N\)(target groups)\(\times N\)(windows)\(\times N\)(radial bins)
+speadi/int_trrdf/int_trrdf.py
11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 |
|