From bba5e6dc935424827b448f60c787c5c09e08f6c7 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Thu, 26 Sep 2024 17:26:10 +1000 Subject: [PATCH 01/21] change subtraction to avoid numpy type error --- helanal/helanal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helanal/helanal.py b/helanal/helanal.py index 2a97468..90d314e 100644 --- a/helanal/helanal.py +++ b/helanal/helanal.py @@ -249,9 +249,11 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): # get origins by subtracting radius from atom i+1 origins = positions[1:-1].copy() # (n_res-2, 3) - origins[:-1] -= (radii*local_helix_directions[:-1].T).T + #origins[:-1] -= (radii*local_helix_directions[:-1].T).T + origins[:-1] = origins[:-1] - (radii*local_helix_directions[:-1].T).T # subtract radius from atom i+2 in last one - origins[-1] -= radii[-1]*local_helix_directions[-1] + #origins[-1] -= radii[-1]*local_helix_directions[-1] + origins[-1] = origins[-1] - radii[-1]*local_helix_directions[-1] helix_axes = vector_of_best_fit(origins) screw = local_screw_angles(helix_axes, np.asarray(ref_axis), From d9bca90b4ffc4fd88005d9f086359b377e4a985f Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 00:02:22 +1000 Subject: [PATCH 02/21] fill in author --- docs/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b93b4e5..a5fb081 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,11 +24,11 @@ project = "helanal" copyright = ( - "2024, Your name (or your organization/company/team). " + "2024, MDAnalysis. " "Project structure based on the " "MDAnalysis Cookiecutter version 0.1" ) -author = "Your name (or your organization/company/team)" +author = "MDAnalysis" # The short X.Y version version = "" From b7596dd01d78df34083838479ea8d9989cdd21c4 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 00:04:01 +1000 Subject: [PATCH 03/21] update index page --- docs/source/index.rst | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 0e46402..421ad77 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -7,13 +7,24 @@ Welcome to helanal's documentation! ========================================================= This module contains code to analyse protein helices using the -HELANAL_ algorithm -([Bansal2000]_ , [Sugeta1967]_ ). +HELANAL_ algorithm ([Bansal2000]_, [Sugeta1967]_). HELANAL_ quantifies the geometry of helices in proteins on the basis of their Cα atoms. It can determine local structural features such as the local -helical twist and rise, virtual torsion angle, local helix origins and -bending angles between successive local helix axes. +helical twist and rise, local helix origins and bending angles along the +helix. + +.. toctree:: + :maxdepth: 1 + :caption: Contents + + getting_started + properties_computed + api + + +References +^^^^^^^^^^ .. _HELANAL: https://pubmed.ncbi.nlm.nih.gov/10798526/ @@ -25,20 +36,3 @@ bending angles between successive local helix axes. HELANAL - A program to characterise helix geometry in proteins. *J Biomol Struct Dyn.* 17(5):811-819. - -.. toctree:: - :maxdepth: 1 - :caption: Contents: - - getting_started - example - api - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` From a80ee424ecdb2886363c764cac4ac82b2c0c963e Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 00:59:10 +1000 Subject: [PATCH 04/21] change author --- docs/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a5fb081..b3642a3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,11 +24,11 @@ project = "helanal" copyright = ( - "2024, MDAnalysis. " + "2024, Fiona Naughton. " "Project structure based on the " "MDAnalysis Cookiecutter version 0.1" ) -author = "MDAnalysis" +author = "Fiona Naugton" # The short X.Y version version = "" From 32697b13b030f8b71263423cf53607e331cb3760 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 01:28:00 +1000 Subject: [PATCH 05/21] tidy api docs --- docs/source/api.rst | 3 +++ helanal/helanal.py | 41 ----------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 00a15bc..e5b1456 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -2,3 +2,6 @@ API Documentation ================= .. automodule:: helanal.helanal + :show-inheritance: + :members: + :inherited-members: diff --git a/helanal/helanal.py b/helanal/helanal.py index 90d314e..14c4451 100644 --- a/helanal/helanal.py +++ b/helanal/helanal.py @@ -22,47 +22,6 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -HELANAL --- analysis of protein helices -======================================= - -This module contains code to analyse protein helices using the -HELANAL_ algorithm -([Bansal2000]_ , [Sugeta1967]_ ). - -HELANAL_ quantifies the geometry of helices in proteins on the basis of their -Cα atoms. It can determine local structural features such as the local -helical twist and rise, virtual torsion angle, local helix origins and -bending angles between successive local helix axes. - -.. _HELANAL: https://pubmed.ncbi.nlm.nih.gov/10798526/ - -.. [Sugeta1967] Sugeta, H. and Miyazawa, T. 1967. General method for - calculating helical parameters of polymer chains from bond lengths, bond - angles and internal rotation angles. *Biopolymers* 5 673 - 679 - -.. [Bansal2000] Bansal M, Kumar S, Velavan R. 2000. - HELANAL - A program to characterise helix geometry in proteins. - *J Biomol Struct Dyn.* 17(5):811-819. - - -Classes -------- - -.. autoclass:: HELANAL - - -Functions ---------- - -.. autofunction:: helix_analysis - -.. autofunction:: vector_of_best_fit - -.. autofunction:: local_screw_angles - -""" - import warnings import numpy as np From f8818ab228b34643c4975c65ce9e0d90133b57c9 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 01:46:55 +1000 Subject: [PATCH 06/21] update geting started page --- docs/source/getting_started.rst | 86 +++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 7c955b8..9d2d041 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -6,33 +6,91 @@ Installation *TBA* -Example use +Basic Usage ----------- -Import MDAnalysis and helanal:: +helanal is used to calculate helix properties for helices with at least +9 residues. + +Here, we demonstrate the basic usage and options of helanal. First, import +MDAnalysis and helanal:: import MDAnalysis as mda - from MDAnalysis.tests.datafiles import PSF, DCD import helanal -You can pass in a single selection:: +For this example, we will use datafiles from the MDAnalysis tests:: + from MDAnalysis.tests.datafiles import PSF, DCD u = mda.Universe(PSF, DCD) - hel = helanl.HELANAL(u, select='name CA and resnum 161-187') + +To analyse a single helix, pass a selection with one atom per reside +(normally this will be the Cα atoms):: + + hel = helanal.HELANAL(u, select='name CA and resnum 161-187') hel.run() -All computed properties are available in ``.results``:: +All computed properties for each simulation frame will be available as +arrays in ``.results``, e.g.:: + + helix_tilt = hel.results.global_tilts + +For more details about the properties calculated and method used, +see :doc:`properties_computed`. + + +Further Options +--------------- + +- The **simulation frames** over which analysis is performed can be specified + using ``start``, ``stop``, and/or ``step``; or by providing a list + ``frames`` with which to slice the trajectory:: + + hel.run(start=5, step=10) - print(hel.results.summary) +- The **reference axis** to which helix tilts and screw angles are calculated + can be specified using ``ref_axis``:: -Alternatively, you can analyse several helices at once by passing -in multiple selection strings:: + hel_xaxis = helanal.HELANAL(u, select='name CA and resnum 161-187', + ref_axis=[1,0,0]) - hel2 = helanal.HELANAL(u, select=('name CA and resnum 100-160', - 'name CA and resnum 200-230')) +- To analyse **multiple helices** at once, pass in a list of selection + strings:: -The :func:`helix_analysis` function will carry out helix analysis on -atom positions, treating each row of coordinates as an alpha-carbon -equivalent:: + hel_multi = helanal.HELANAL(u, select=('name CA and resnum 100-160', + 'name CA and resnum 200-230')) + + Each property in ``.results`` will now be a list of arrays, one for + each helix. + +- By default, the results of a single-helix analysis are flattened, such + that each result is a single array, rather than a list-of-arrays of + length 1. This behaviour can be turned off (i.e. to be consistent + with the behaviour for multi-helix analysis) using + ``flatten_single_helix``:: + + hel_noflat = helanal.HELANAL(u, select='name CA and resnum 161-187', + flatten_single_helix=False) + +- Analysis can be carried out directly on a single set of positions using + the :func:`helix_analysis` function:: hel_xyz = helanal.helix_analysis(u.atoms.positions, ref_axis=[0, 0, 1]) + Results are returned as a dictionary. + + + +Citations +--------- + +helanal implements the HELANAL algorithm from [Bansal2000]_, which itself +uses the method of [Sugeta1967]_ to characterise each local axis. Please cite +them when using this module in published work. + +.. [Sugeta1967] Sugeta, H. and Miyazawa, T. 1967. General method for + calculating helical parameters of polymer chains from bond lengths, bond + angles and internal rotation angles. *Biopolymers* 5 673 - 679 + +.. [Bansal2000] Bansal M, Kumar S, Velavan R. 2000. + HELANAL - A program to characterise helix geometry in proteins. + *J Biomol Struct Dyn.* 17(5):811-819. + From 5f0be14f55366a470a18fcd0ba2dd603619d4d33 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 23:51:06 +1000 Subject: [PATCH 07/21] add properties computed section --- docs/source/images/axes.svg | 1 + docs/source/images/bends.svg | 1 + docs/source/images/global_axis.svg | 1 + docs/source/images/global_tilts.svg | 1 + docs/source/images/heights.svg | 1 + docs/source/images/helix_directions.svg | 1 + docs/source/images/origins.svg | 1 + docs/source/images/screw_angles.svg | 1 + docs/source/images/twists.svg | 1 + docs/source/images/window.svg | 1 + docs/source/properties_computed.rst | 114 ++++++++++++++++++++++++ 11 files changed, 124 insertions(+) create mode 100755 docs/source/images/axes.svg create mode 100755 docs/source/images/bends.svg create mode 100755 docs/source/images/global_axis.svg create mode 100755 docs/source/images/global_tilts.svg create mode 100755 docs/source/images/heights.svg create mode 100755 docs/source/images/helix_directions.svg create mode 100755 docs/source/images/origins.svg create mode 100755 docs/source/images/screw_angles.svg create mode 100755 docs/source/images/twists.svg create mode 100755 docs/source/images/window.svg create mode 100644 docs/source/properties_computed.rst diff --git a/docs/source/images/axes.svg b/docs/source/images/axes.svg new file mode 100755 index 0000000..811d34a --- /dev/null +++ b/docs/source/images/axes.svg @@ -0,0 +1 @@ +D2D1ci+1ci+2D1D2A \ No newline at end of file diff --git a/docs/source/images/bends.svg b/docs/source/images/bends.svg new file mode 100755 index 0000000..f01cff0 --- /dev/null +++ b/docs/source/images/bends.svg @@ -0,0 +1 @@ +Ai+3Aicici+1ci+2ci+3ci+4ci+5ci+6ci+7ci+8βci+9 \ No newline at end of file diff --git a/docs/source/images/global_axis.svg b/docs/source/images/global_axis.svg new file mode 100755 index 0000000..d858e36 --- /dev/null +++ b/docs/source/images/global_axis.svg @@ -0,0 +1 @@ +originsG \ No newline at end of file diff --git a/docs/source/images/global_tilts.svg b/docs/source/images/global_tilts.svg new file mode 100755 index 0000000..a8d4ba6 --- /dev/null +++ b/docs/source/images/global_tilts.svg @@ -0,0 +1 @@ +ref_axisγG \ No newline at end of file diff --git a/docs/source/images/heights.svg b/docs/source/images/heights.svg new file mode 100755 index 0000000..014ed27 --- /dev/null +++ b/docs/source/images/heights.svg @@ -0,0 +1 @@ +hB2ci+1ci+2 \ No newline at end of file diff --git a/docs/source/images/helix_directions.svg b/docs/source/images/helix_directions.svg new file mode 100755 index 0000000..1184794 --- /dev/null +++ b/docs/source/images/helix_directions.svg @@ -0,0 +1 @@ +ci+1D1D2 \ No newline at end of file diff --git a/docs/source/images/origins.svg b/docs/source/images/origins.svg new file mode 100755 index 0000000..9419744 --- /dev/null +++ b/docs/source/images/origins.svg @@ -0,0 +1 @@ +D2D1ci+1ci+2D1D2origin \ No newline at end of file diff --git a/docs/source/images/screw_angles.svg b/docs/source/images/screw_angles.svg new file mode 100755 index 0000000..21b7a92 --- /dev/null +++ b/docs/source/images/screw_angles.svg @@ -0,0 +1 @@ +ref_axisGD1αci+1 \ No newline at end of file diff --git a/docs/source/images/twists.svg b/docs/source/images/twists.svg new file mode 100755 index 0000000..312cbb9 --- /dev/null +++ b/docs/source/images/twists.svg @@ -0,0 +1 @@ +θD2D1ci+1ci+2 \ No newline at end of file diff --git a/docs/source/images/window.svg b/docs/source/images/window.svg new file mode 100755 index 0000000..227f81e --- /dev/null +++ b/docs/source/images/window.svg @@ -0,0 +1 @@ +D1D2B1B2B3cici+1ci+2ci+3D1cici+1ci+2ci+3D2 \ No newline at end of file diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst new file mode 100644 index 0000000..e2a135b --- /dev/null +++ b/docs/source/properties_computed.rst @@ -0,0 +1,114 @@ +Computed Properties +=================== + +helanal follows the procedure of Sugeta and Miyazawa ([Sugeta1967]_). +Properties are computed for a 'window' of four consecutive :math:`C_α` +atoms, and this window then slid along the length of the helix in +one-residue steps. + +For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, +:math:`c_{i+2}`, :math:`c_{i+3}`, the vectors :math:`\mathbf{B_1}`, +:math:`\mathbf{B_2}`, and :math:`\mathbf{B_3}` joining (respectively) +atoms :math:`c_i` - :math:`c_{i+1}`, :math:`c_{i+1}` - :math:`c_{i+2}` and +:math:`c_{i+2}` - :math:`c_{i+3}` are calculated, along with the vectors +:math:`\mathbf{D_1} = \mathbf{C_1} - \mathbf{C_2}` and +:math:`\mathbf{D_2} = \mathbf{C_2} - \mathbf{C_3}`. + +.. image:: images/window.svg + :width: 60% + :align: center + +From these, the helix properties below are computed in each simulation +frame. These properties are available in ``.results`` as arrays, the +shape of which depends on the number of residues :math:`n_{res}`. +**Note that each helix must contain at least 9 residues.** +If multiple helices are being analysed, the results are returned as +lists (of length :math:`n_{helices}`) of arrays of the indicated shape. + +All angles are in degrees. + +.. list-table:: + :widths: 40 30 20 + :header-rows: 1 + + * - Description + - + - Shape + * - ``local_helix_directions``: the normalised vector :math:`\mathbf{D_1}` + (or :math:`\mathbf{D_2}`) for each atom :math:`c_{i+1}` (or + :math:`c_{i+2}`). + + Assuming ~even spacing of the atoms, this vector will bisect the + angle formed by (:math:`c_i,c_{i+1},c_{i+2}`), lie approximately + in the plane perpendicular to the helix axis, and point from the + projected local helix centre to the atom :math:`c_{i+1}`. + - .. image:: images/helix_directions.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 + * - ``local_twists``: the approximate 'twist' of the helix between + atoms :math:`c_{i+1}` and :math:`c_{i+2}`, calculated as the + angle :math:`θ` between :math:`\mathbf{D_1}` and + :math:`\mathbf{D_2}`. + - .. image:: images/twists.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-3 + * - ``local_nres_per_turn``: the number of residues that fit in one + complete turn of the helix, based on `local_twist`. + - + - :math:`n_{frames}` * :math:`n_{res}`-3 + * - ``local_origins``: the projected centre of each 4-atom window, in + line with atom :math:`c_{i+1}`. + + Calculated as the approximate intersection of + :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}` projected on the + perpendicular plane, assuming ~even spacing of atoms. + - .. image:: images/origins.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 + * - ``local_axes``: the (normalised) central axis :math:`\mathbf{A}` + of the 4-atom window, calculated as the normal to the two vectors + :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. + - .. image:: images/axes.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-3 * 3 + * - ``local_heights``: the 'rise' :math:`h` of the helix (in the + direction of `local_axes`) between atoms :math:`c_{i+1}` and + :math:`c_{i+2}`. + - .. image:: images/heights.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-3 + * - ``local_bends``: the angle of bending of the helix between adjacent + 4-atom windows, i.e. the angle :math:`β` between the `local_axes` + for atoms (:math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and + (:math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). + - .. image:: images/bends.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-6 + * - ``all_bends``: pair-wise matrix of angles between all pairs of + `local_axes`. + - + - :math:`n_{frames}` * :math:`n_{res}`-3 * :math:`n_{res}`-3 + * - ``global_axis``: the length-wise axis :math:`\mathbf{G}` for the + overall helix, pointing from the end of the helix to the start. + Calculated as the vector of best fit through all `local_origins`. + - .. image:: images/global_axis.svg + :width: 100% + - :math:`n_{frames}` * 3 + * - ``global_tilts``: the angle :math:`γ` between the `global_axis` and + the reference axis (passed in using ``ref_axis``). If no axis + is specified, the z-axis is used. + - .. image:: images/global_tilts.svg + :width: 100% + - :math:`n_{frames}` + * - ``local_screw_angles``: The cylindrical azimuthal angle :math:`α` of + atom :math:`c_{i+1}` (in the range -pi to pi). + + This is measured as the angle from the `ref_axis` to the + `local_helix_directions` vector :math:`\mathbf{D}` when projected + on a plane perpendicular to `global_axis`. + - .. image:: images/screw_angles.svg + :width: 100% + - :math:`n_{frames}` * :math:`n_{res}`-2 + +A summary of the results, including mean, sample standard deviation and +mean absolute deviation is also provided in ``results.summary``. From ef83df74a77d3a8213dc5b88e8433ecd7485592b Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 27 Sep 2024 23:52:25 +1000 Subject: [PATCH 08/21] add in-code explanation for radii calculation --- helanal/helanal.py | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/helanal/helanal.py b/helanal/helanal.py index 14c4451..e6d0c4c 100644 --- a/helanal/helanal.py +++ b/helanal/helanal.py @@ -153,11 +153,11 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): # ^ ^ # \ / bi - # \ / + # \ Vi+1 / # CA_i+2 <----- CA_i+1 # / \ / ^ - # / r \ / \ - # V / \ θ / \ + # / r \ / \Vi + # Vi+2/ \ θ / \ # / \ / CA_i # v origin # CA_i+3 @@ -165,6 +165,8 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): # V: vectors # bi: approximate "bisectors" in plane of screen # Note: not real bisectors, as the vectors aren't normalised + # but assuming ~equal spacing of CA atoms, i.e. |Vi| ~ |Vi+1| + # should be approximately true. # θ: local_twists # origin: origins # local_axes: perpendicular to plane of screen. Orthogonal to "bisectors" @@ -173,6 +175,7 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): bisectors = vectors[:-1] - vectors[1:] # (n_res-2, 3) bimags = mdamath.pnorm(bisectors) # (n_res-2,) adjacent_mag = bimags[:-1] * bimags[1:] # (n_res-3,) + local_helix_directions = (bisectors.T/bimags).T # (n_res-2, 3) # find angle between bisectors for twist and n_residue/turn cos_theta = mdamath.pdot(bisectors[:-1], bisectors[1:])/adjacent_mag @@ -197,21 +200,38 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): local_bends = np.diagonal(bend_matrix, offset=3) # (n_res-6,) # radius of local cylinder + ## This appears to be calculated based on the following. + ## + ## CA_i+2 CA_i+1 + ## r / | \ / ^ + ## / | \Vi+1 / \ + ## / θ | \ / bi \ + ## origin-----------CA_i+1 ----->CA_i+1 + ## x | y / \ ^ + ## | /Vi \ / + ## | / \ / + ## CA_i CA_i + ## + ## If we assume atoms are ~evenly spaced around a circle, bi are ~bisectors + ## and their projections should meet at the centre of the circle + ## i.e. r ~= x + y + ## bi = Vi-Vi+1 is the digonal of a parallelogram formed by Vi and Vi+1. + ## A vector from CAi to CAi+2 is the other diangonal, so is perpendular + ## to and bisects bi - i.e. x = rcos0 and y = |bi|/2 + ## Solve for r and substitute |bi| -> adjacent_mag**0.5 to take into account + ## some difference. radii = (adjacent_mag**0.5) / (2*(1.0-cos_theta)) # (n_res-3,) + # special case: angle b/w bisectors is 0 (should virtually never happen) # guesstimate radius = half bisector magnitude radii = np.where(cos_theta != 1, radii, (adjacent_mag**0.5)/2) # height of local cylinder heights = np.abs(mdamath.pdot(vectors[1:-1], local_axes)) # (n_res-3,) - local_helix_directions = (bisectors.T/bimags).T # (n_res-2, 3) - # get origins by subtracting radius from atom i+1 origins = positions[1:-1].copy() # (n_res-2, 3) - #origins[:-1] -= (radii*local_helix_directions[:-1].T).T origins[:-1] = origins[:-1] - (radii*local_helix_directions[:-1].T).T # subtract radius from atom i+2 in last one - #origins[-1] -= radii[-1]*local_helix_directions[-1] origins[-1] = origins[-1] - radii[-1]*local_helix_directions[-1] helix_axes = vector_of_best_fit(origins) From e0432c9729b7f46e6eca57f1f031bb780153752c Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 18 Oct 2024 14:24:12 +1100 Subject: [PATCH 09/21] minor updates --- docs/source/properties_computed.rst | 97 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index e2a135b..917cc66 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -1,16 +1,15 @@ Computed Properties =================== -helanal follows the procedure of Sugeta and Miyazawa ([Sugeta1967]_). -Properties are computed for a 'window' of four consecutive :math:`C_α` -atoms, and this window then slid along the length of the helix in -one-residue steps. +Helanal follows the procedure of Sugeta and Miyazawa [Sugeta1967]_. Properties +are computed for a 'window' of four consecutive :math:`C_α` atoms, and this +window then slid along the length of the helix in one-residue steps. -For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, +For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, :math:`c_{i+2}`, :math:`c_{i+3}`, the vectors :math:`\mathbf{B_1}`, -:math:`\mathbf{B_2}`, and :math:`\mathbf{B_3}` joining (respectively) -atoms :math:`c_i` - :math:`c_{i+1}`, :math:`c_{i+1}` - :math:`c_{i+2}` and -:math:`c_{i+2}` - :math:`c_{i+3}` are calculated, along with the vectors +:math:`\mathbf{B_2}`, and :math:`\mathbf{B_3}` joining (respectively) atoms +:math:`c_i`--:math:`c_{i+1}`, :math:`c_{i+1}`--:math:`c_{i+2}` and +:math:`c_{i+2}`--:math:`c_{i+3}` are calculated, along with the vectors :math:`\mathbf{D_1} = \mathbf{C_1} - \mathbf{C_2}` and :math:`\mathbf{D_2} = \mathbf{C_2} - \mathbf{C_3}`. @@ -18,12 +17,13 @@ atoms :math:`c_i` - :math:`c_{i+1}`, :math:`c_{i+1}` - :math:`c_{i+2}` and :width: 60% :align: center -From these, the helix properties below are computed in each simulation -frame. These properties are available in ``.results`` as arrays, the -shape of which depends on the number of residues :math:`n_{res}`. -**Note that each helix must contain at least 9 residues.** -If multiple helices are being analysed, the results are returned as -lists (of length :math:`n_{helices}`) of arrays of the indicated shape. +From these, the helix properties below are computed in each simulation frame. +These properties are available in ``.results`` as arrays, the shape of which +depends on the number of residues :math:`n_{res}` (and the property being +calculated). **Note that each helix must contain at least 9 residues.** + +If multiple helices are being analysed, the results are returned as lists (of +length :math:`n_{helices}`) of arrays of the indicated shape. All angles are in degrees. @@ -38,77 +38,76 @@ All angles are in degrees. (or :math:`\mathbf{D_2}`) for each atom :math:`c_{i+1}` (or :math:`c_{i+2}`). - Assuming ~even spacing of the atoms, this vector will bisect the - angle formed by (:math:`c_i,c_{i+1},c_{i+2}`), lie approximately - in the plane perpendicular to the helix axis, and point from the - projected local helix centre to the atom :math:`c_{i+1}`. + Assuming ~even spacing of the atoms, this vector will bisect the angle + formed by (:math:`c_i,c_{i+1},c_{i+2}`), lie approximately in the plane + perpendicular to the helix axis, and point from the projected local + helix centre to the atom :math:`c_{i+1}`. - .. image:: images/helix_directions.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 - * - ``local_twists``: the approximate 'twist' of the helix between - atoms :math:`c_{i+1}` and :math:`c_{i+2}`, calculated as the - angle :math:`θ` between :math:`\mathbf{D_1}` and - :math:`\mathbf{D_2}`. + * - ``local_twists``: the approximate 'twist' of the helix between atoms + :math:`c_{i+1}` and :math:`c_{i+2}`, calculated as the angle :math:`θ` + between :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/twists.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-3 - * - ``local_nres_per_turn``: the number of residues that fit in one - complete turn of the helix, based on `local_twist`. + * - ``local_nres_per_turn``: the number of residues that fit in one complete + turn of the helix, based on `local_twist`. - - :math:`n_{frames}` * :math:`n_{res}`-3 - * - ``local_origins``: the projected centre of each 4-atom window, in - line with atom :math:`c_{i+1}`. + * - ``local_origins``: the projected centre of each 4-atom window, in line + with atom :math:`c_{i+1}`. - Calculated as the approximate intersection of - :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}` projected on the - perpendicular plane, assuming ~even spacing of atoms. + Calculated as the approximate intersection of :math:`\mathbf{D_1}` and + :math:`\mathbf{D_2}` projected on the perpendicular plane, assuming ~even + spacing of atoms. - .. image:: images/origins.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 - * - ``local_axes``: the (normalised) central axis :math:`\mathbf{A}` - of the 4-atom window, calculated as the normal to the two vectors + * - ``local_axes``: the (normalised) central axis :math:`\mathbf{A}` of the + 4-atom window, calculated as the normal to the two vectors :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/axes.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-3 * 3 - * - ``local_heights``: the 'rise' :math:`h` of the helix (in the - direction of `local_axes`) between atoms :math:`c_{i+1}` and - :math:`c_{i+2}`. + * - ``local_heights``: the 'rise' :math:`h` of the helix (in the direction + of `local_axes`) between atoms :math:`c_{i+1}` and :math:`c_{i+2}`. - .. image:: images/heights.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-3 * - ``local_bends``: the angle of bending of the helix between adjacent 4-atom windows, i.e. the angle :math:`β` between the `local_axes` - for atoms (:math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and - (:math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). + :math:`\mathfb{A_i}` (of atoms :math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and + :math:`\mathfb{A_(i+3)` (of atoms + :math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). - .. image:: images/bends.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-6 - * - ``all_bends``: pair-wise matrix of angles between all pairs of + * - ``all_bends``: pair-wise matrix of angles between all pairs of `local_axes`. - - :math:`n_{frames}` * :math:`n_{res}`-3 * :math:`n_{res}`-3 - * - ``global_axis``: the length-wise axis :math:`\mathbf{G}` for the - overall helix, pointing from the end of the helix to the start. - Calculated as the vector of best fit through all `local_origins`. + * - ``global_axis``: the length-wise axis :math:`\mathbf{G}` for the overall + helix, pointing from the end of the helix to the start. Calculated as the + vector of best fit through all `local_origins`. - .. image:: images/global_axis.svg :width: 100% - :math:`n_{frames}` * 3 - * - ``global_tilts``: the angle :math:`γ` between the `global_axis` and - the reference axis (passed in using ``ref_axis``). If no axis - is specified, the z-axis is used. + * - ``global_tilts``: the angle :math:`γ` between the `global_axis` + :math:`\mathbf{G}` and the reference axis (specified by the ``ref_axis`` + option). If no axis is specified, the z-axis is used. - .. image:: images/global_tilts.svg :width: 100% - :math:`n_{frames}` - * - ``local_screw_angles``: The cylindrical azimuthal angle :math:`α` of + * - ``local_screw_angles``: The cylindrical azimuthal angle :math:`α` of atom :math:`c_{i+1}` (in the range -pi to pi). - This is measured as the angle from the `ref_axis` to the - `local_helix_directions` vector :math:`\mathbf{D}` when projected - on a plane perpendicular to `global_axis`. + This is measured as the angle between the `ref_axis` to the + `local_helix_directions` vector :math:`\mathbf{D}`, when both are + projected on a plane perpendicular to `global_axis`. - .. image:: images/screw_angles.svg :width: 100% - :math:`n_{frames}` * :math:`n_{res}`-2 -A summary of the results, including mean, sample standard deviation and -mean absolute deviation is also provided in ``results.summary``. +A summary of the results, including mean, sample standard deviation and mean +absolute deviation is also provided in ``results.summary``. From 78f14389a91ae670dd8cc5c3c80295d480cfe916 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 18 Oct 2024 16:37:10 +1100 Subject: [PATCH 10/21] remove nbsphinx --- docs/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b3642a3..cd61fff 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,6 @@ "sphinx.ext.intersphinx", "sphinx.ext.extlinks", "mdanalysis_sphinx_theme", - "nbsphinx", ] autosummary_generate = True From f41d437dd6bb08067fdd5482375b8f2afc031cd5 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 25 Oct 2024 19:57:08 +1100 Subject: [PATCH 11/21] fix typos --- docs/source/properties_computed.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index 917cc66..aca3f94 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -77,8 +77,8 @@ All angles are in degrees. - :math:`n_{frames}` * :math:`n_{res}`-3 * - ``local_bends``: the angle of bending of the helix between adjacent 4-atom windows, i.e. the angle :math:`β` between the `local_axes` - :math:`\mathfb{A_i}` (of atoms :math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and - :math:`\mathfb{A_(i+3)` (of atoms + :math:`\mathbf{A_i}` (of atoms :math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and + :math:`\mathbf{A_{i+3}` (of atoms :math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). - .. image:: images/bends.svg :width: 100% From e1c58393a03ec2c14d960120cc5251b53d2e86e1 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Mon, 28 Oct 2024 17:14:35 +1100 Subject: [PATCH 12/21] revert to -= and replace double transposition --- helanal/helanal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helanal/helanal.py b/helanal/helanal.py index e6d0c4c..bc398a1 100644 --- a/helanal/helanal.py +++ b/helanal/helanal.py @@ -230,9 +230,9 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): # get origins by subtracting radius from atom i+1 origins = positions[1:-1].copy() # (n_res-2, 3) - origins[:-1] = origins[:-1] - (radii*local_helix_directions[:-1].T).T + origins[:-1] -= radii[:,None]*local_helix_directions[:-1] # subtract radius from atom i+2 in last one - origins[-1] = origins[-1] - radii[-1]*local_helix_directions[-1] + origins[-1] -= radii[-1]*local_helix_directions[-1] helix_axes = vector_of_best_fit(origins) screw = local_screw_angles(helix_axes, np.asarray(ref_axis), From 8061f1a9095c311a12f049dfa186567bc978119e Mon Sep 17 00:00:00 2001 From: Fiona Naughton Date: Wed, 30 Oct 2024 00:00:26 +1100 Subject: [PATCH 13/21] Update docs/source/getting_started.rst Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- docs/source/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 9d2d041..496d61f 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -22,7 +22,7 @@ For this example, we will use datafiles from the MDAnalysis tests:: from MDAnalysis.tests.datafiles import PSF, DCD u = mda.Universe(PSF, DCD) -To analyse a single helix, pass a selection with one atom per reside +To analyse a single helix, pass a selection with one atom per residue (normally this will be the Cα atoms):: hel = helanal.HELANAL(u, select='name CA and resnum 161-187') From 035d861ae028f0c837a200a650fed8cb2b3569aa Mon Sep 17 00:00:00 2001 From: Fiona Naughton Date: Wed, 30 Oct 2024 00:01:01 +1100 Subject: [PATCH 14/21] Update docs/source/getting_started.rst Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- docs/source/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 496d61f..e9d83dc 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -41,7 +41,7 @@ Further Options --------------- - The **simulation frames** over which analysis is performed can be specified - using ``start``, ``stop``, and/or ``step``; or by providing a list + using ``start``, ``stop``, and/or ``step``, or by providing a list ``frames`` with which to slice the trajectory:: hel.run(start=5, step=10) From a59f6e1210d934aa6eeb91948fdf4cf2b47dcedf Mon Sep 17 00:00:00 2001 From: Fiona Naughton Date: Wed, 30 Oct 2024 00:01:32 +1100 Subject: [PATCH 15/21] Update docs/source/properties_computed.rst Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- docs/source/properties_computed.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index aca3f94..1b3991a 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -3,7 +3,7 @@ Computed Properties Helanal follows the procedure of Sugeta and Miyazawa [Sugeta1967]_. Properties are computed for a 'window' of four consecutive :math:`C_α` atoms, and this -window then slid along the length of the helix in one-residue steps. +window is then slid along the length of the helix in one-residue steps. For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, :math:`c_{i+2}`, :math:`c_{i+3}`, the vectors :math:`\mathbf{B_1}`, From 55da3318a08d7833bbae40a5482b5b77f3a8dc80 Mon Sep 17 00:00:00 2001 From: Fiona Naughton Date: Wed, 30 Oct 2024 00:02:10 +1100 Subject: [PATCH 16/21] Update docs/source/conf.py Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index cd61fff..f8fbc9b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,7 +28,7 @@ "Project structure based on the " "MDAnalysis Cookiecutter version 0.1" ) -author = "Fiona Naugton" +author = "Fiona Naughton" # The short X.Y version version = "" From ad05daa59fb6b3608c5070d2082de32a3905aa25 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Wed, 30 Oct 2024 05:14:03 +1100 Subject: [PATCH 17/21] new window img --- docs/source/images/window.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/images/window.svg b/docs/source/images/window.svg index 227f81e..d828c7c 100755 --- a/docs/source/images/window.svg +++ b/docs/source/images/window.svg @@ -1 +1 @@ -D1D2B1B2B3cici+1ci+2ci+3D1cici+1ci+2ci+3D2 \ No newline at end of file +D1D2B1B2B3cici+1ci+2ci+3D1cici+1ci+2ci+3D2top viewside view \ No newline at end of file From a75c33bc75a8f58c6a4a4f69049cf41734679888 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Wed, 30 Oct 2024 05:14:35 +1100 Subject: [PATCH 18/21] vector fixes --- docs/source/properties_computed.rst | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index aca3f94..6d403ef 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -8,10 +8,10 @@ window then slid along the length of the helix in one-residue steps. For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, :math:`c_{i+2}`, :math:`c_{i+3}`, the vectors :math:`\mathbf{B_1}`, :math:`\mathbf{B_2}`, and :math:`\mathbf{B_3}` joining (respectively) atoms -:math:`c_i`--:math:`c_{i+1}`, :math:`c_{i+1}`--:math:`c_{i+2}` and -:math:`c_{i+2}`--:math:`c_{i+3}` are calculated, along with the vectors -:math:`\mathbf{D_1} = \mathbf{C_1} - \mathbf{C_2}` and -:math:`\mathbf{D_2} = \mathbf{C_2} - \mathbf{C_3}`. +:math:`c_i` → :math:`c_{i+1}`, :math:`c_{i+1}` → :math:`c_{i+2}` and +:math:`c_{i+2}` → :math:`c_{i+3}` are calculated, along with the vectors +:math:`\mathbf{D_1} = \mathbf{B_1} - \mathbf{B_2}` and +:math:`\mathbf{D_2} = \mathbf{B_2} - \mathbf{B_3}`. .. image:: images/window.svg :width: 60% @@ -44,17 +44,17 @@ All angles are in degrees. helix centre to the atom :math:`c_{i+1}`. - .. image:: images/helix_directions.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 + - :math:`(n_{frames}, n_{res}-2, 3)` * - ``local_twists``: the approximate 'twist' of the helix between atoms :math:`c_{i+1}` and :math:`c_{i+2}`, calculated as the angle :math:`θ` between :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/twists.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-3 + - :math:`(n_{frames}, n_{res}-3)` * - ``local_nres_per_turn``: the number of residues that fit in one complete turn of the helix, based on `local_twist`. - - - :math:`n_{frames}` * :math:`n_{res}`-3 + - :math:`(n_{frames}, n_{res}-3)` * - ``local_origins``: the projected centre of each 4-atom window, in line with atom :math:`c_{i+1}`. @@ -63,18 +63,18 @@ All angles are in degrees. spacing of atoms. - .. image:: images/origins.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-2 * 3 + - :math:`(n_{frames}, n_{res}-2, 3)` * - ``local_axes``: the (normalised) central axis :math:`\mathbf{A}` of the 4-atom window, calculated as the normal to the two vectors :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/axes.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-3 * 3 + - :math:`(n_{frames}, n_{res}-3, 3)` * - ``local_heights``: the 'rise' :math:`h` of the helix (in the direction of `local_axes`) between atoms :math:`c_{i+1}` and :math:`c_{i+2}`. - .. image:: images/heights.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-3 + - :math:`(n_{frames}, n_{res}-3)` * - ``local_bends``: the angle of bending of the helix between adjacent 4-atom windows, i.e. the angle :math:`β` between the `local_axes` :math:`\mathbf{A_i}` (of atoms :math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and @@ -82,23 +82,23 @@ All angles are in degrees. :math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). - .. image:: images/bends.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-6 + - :math:`(n_{frames}, n_{res}-6)` * - ``all_bends``: pair-wise matrix of angles between all pairs of `local_axes`. - - - :math:`n_{frames}` * :math:`n_{res}`-3 * :math:`n_{res}`-3 + - :math:`(n_{frames}, n_{res}-3, n_{res}-3)` * - ``global_axis``: the length-wise axis :math:`\mathbf{G}` for the overall helix, pointing from the end of the helix to the start. Calculated as the vector of best fit through all `local_origins`. - .. image:: images/global_axis.svg :width: 100% - - :math:`n_{frames}` * 3 + - :math:`(n_{frames}, 3)` * - ``global_tilts``: the angle :math:`γ` between the `global_axis` :math:`\mathbf{G}` and the reference axis (specified by the ``ref_axis`` option). If no axis is specified, the z-axis is used. - .. image:: images/global_tilts.svg :width: 100% - - :math:`n_{frames}` + - :math:`(n_{frames},)` * - ``local_screw_angles``: The cylindrical azimuthal angle :math:`α` of atom :math:`c_{i+1}` (in the range -pi to pi). @@ -107,7 +107,7 @@ All angles are in degrees. projected on a plane perpendicular to `global_axis`. - .. image:: images/screw_angles.svg :width: 100% - - :math:`n_{frames}` * :math:`n_{res}`-2 + - :math:`(n_{frames}, n_{res}-2)` A summary of the results, including mean, sample standard deviation and mean absolute deviation is also provided in ``results.summary``. From b31695dbcf6d2af19742e4cfb8ab9d00f1800382 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Wed, 30 Oct 2024 05:15:44 +1100 Subject: [PATCH 19/21] fix lable --- helanal/helanal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helanal/helanal.py b/helanal/helanal.py index bc398a1..3977093 100644 --- a/helanal/helanal.py +++ b/helanal/helanal.py @@ -202,7 +202,7 @@ def helix_analysis(positions, ref_axis=[0, 0, 1]): # radius of local cylinder ## This appears to be calculated based on the following. ## - ## CA_i+2 CA_i+1 + ## CA_i+2 CA_i+2 ## r / | \ / ^ ## / | \Vi+1 / \ ## / θ | \ / bi \ From 84f5e98cad5b36307db37f313b356ab526c46bae Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 1 Nov 2024 12:16:28 +1100 Subject: [PATCH 20/21] split array shapes to allow wrapping --- docs/source/properties_computed.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index 01c42f9..c50251e 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -28,7 +28,7 @@ length :math:`n_{helices}`) of arrays of the indicated shape. All angles are in degrees. .. list-table:: - :widths: 40 30 20 + :widths: 40 20 20 :header-rows: 1 * - Description @@ -44,17 +44,17 @@ All angles are in degrees. helix centre to the atom :math:`c_{i+1}`. - .. image:: images/helix_directions.svg :width: 100% - - :math:`(n_{frames}, n_{res}-2, 3)` + - :math:`(n_{frames},` :math:`n_{res}-2, 3)` * - ``local_twists``: the approximate 'twist' of the helix between atoms :math:`c_{i+1}` and :math:`c_{i+2}`, calculated as the angle :math:`θ` between :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/twists.svg :width: 100% - - :math:`(n_{frames}, n_{res}-3)` + - :math:`(n_{frames},` :math:`n_{res}-3)` * - ``local_nres_per_turn``: the number of residues that fit in one complete turn of the helix, based on `local_twist`. - - - :math:`(n_{frames}, n_{res}-3)` + - :math:`(n_{frames},` :math:`n_{res}-3)` * - ``local_origins``: the projected centre of each 4-atom window, in line with atom :math:`c_{i+1}`. @@ -63,36 +63,36 @@ All angles are in degrees. spacing of atoms. - .. image:: images/origins.svg :width: 100% - - :math:`(n_{frames}, n_{res}-2, 3)` + - :math:`(n_{frames},` :math:`n_{res}-2,` :math:`3)` * - ``local_axes``: the (normalised) central axis :math:`\mathbf{A}` of the 4-atom window, calculated as the normal to the two vectors :math:`\mathbf{D_1}` and :math:`\mathbf{D_2}`. - .. image:: images/axes.svg :width: 100% - - :math:`(n_{frames}, n_{res}-3, 3)` + - :math:`(n_{frames},` :math:`n_{res}-3,` :math:`3)` * - ``local_heights``: the 'rise' :math:`h` of the helix (in the direction of `local_axes`) between atoms :math:`c_{i+1}` and :math:`c_{i+2}`. - .. image:: images/heights.svg :width: 100% - - :math:`(n_{frames}, n_{res}-3)` + - :math:`(n_{frames},` :math:`n_{res}-3)` * - ``local_bends``: the angle of bending of the helix between adjacent 4-atom windows, i.e. the angle :math:`β` between the `local_axes` :math:`\mathbf{A_i}` (of atoms :math:`c_i,c_{i+1},c_{i+2},c_{i+3}`) and - :math:`\mathbf{A_{i+3}` (of atoms + :math:`\mathbf{A_{i+3}}` (of atoms :math:`c_{i+3},c_{i+4},c_{i+5},c_{i+6}`). - .. image:: images/bends.svg :width: 100% - - :math:`(n_{frames}, n_{res}-6)` + - :math:`(n_{frames},` :math:`n_{res}-6)` * - ``all_bends``: pair-wise matrix of angles between all pairs of `local_axes`. - - - :math:`(n_{frames}, n_{res}-3, n_{res}-3)` + - :math:`(n_{frames},` :math:`n_{res}-3,` :math:`n_{res}-3)` * - ``global_axis``: the length-wise axis :math:`\mathbf{G}` for the overall helix, pointing from the end of the helix to the start. Calculated as the vector of best fit through all `local_origins`. - .. image:: images/global_axis.svg :width: 100% - - :math:`(n_{frames}, 3)` + - :math:`(n_{frames},` :math:`3)` * - ``global_tilts``: the angle :math:`γ` between the `global_axis` :math:`\mathbf{G}` and the reference axis (specified by the ``ref_axis`` option). If no axis is specified, the z-axis is used. @@ -107,7 +107,7 @@ All angles are in degrees. projected on a plane perpendicular to `global_axis`. - .. image:: images/screw_angles.svg :width: 100% - - :math:`(n_{frames}, n_{res}-2)` + - :math:`(n_{frames},` :math:`n_{res}-2)` A summary of the results, including mean, sample standard deviation and mean absolute deviation is also provided in ``results.summary``. From 5aa06c09d1e7134745d11772dbe644ea9444f2a2 Mon Sep 17 00:00:00 2001 From: fiona-naughton Date: Fri, 1 Nov 2024 13:00:27 +1100 Subject: [PATCH 21/21] add archive links for original fortran helanal --- docs/source/getting_started.rst | 4 +++- docs/source/properties_computed.rst | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index e9d83dc..cd05103 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -82,7 +82,7 @@ Further Options Citations --------- -helanal implements the HELANAL algorithm from [Bansal2000]_, which itself +helanal is based on the `HELANAL algorithm`_ from [Bansal2000]_, which itself uses the method of [Sugeta1967]_ to characterise each local axis. Please cite them when using this module in published work. @@ -94,3 +94,5 @@ them when using this module in published work. HELANAL - A program to characterise helix geometry in proteins. *J Biomol Struct Dyn.* 17(5):811-819. +.. _`HELANAL algorithm`: + https://web.archive.org/web/20090226192455/http://www.ccrnp.ncifcrf.gov/users/kumarsan/HELANAL/helanal.f diff --git a/docs/source/properties_computed.rst b/docs/source/properties_computed.rst index c50251e..8ad0d69 100644 --- a/docs/source/properties_computed.rst +++ b/docs/source/properties_computed.rst @@ -1,9 +1,10 @@ Computed Properties =================== -Helanal follows the procedure of Sugeta and Miyazawa [Sugeta1967]_. Properties -are computed for a 'window' of four consecutive :math:`C_α` atoms, and this -window is then slid along the length of the helix in one-residue steps. +Helanal follows the procedure of Sugeta and Miyazawa [Sugeta1967]_ and is based +on the `Fortran HELANAL implementation`_ by [Bansal2000]_. +Properties are computed for a 'window' of four consecutive :math:`C_α` atoms, +and this window is then slid along the length of the helix in one-residue steps. For each window consisting of atoms :math:`c_i`, :math:`c_{i+1}`, :math:`c_{i+2}`, :math:`c_{i+3}`, the vectors :math:`\mathbf{B_1}`, @@ -111,3 +112,6 @@ All angles are in degrees. A summary of the results, including mean, sample standard deviation and mean absolute deviation is also provided in ``results.summary``. + +.. _`Fortran HELANAL implementation`: + https://web.archive.org/web/20090226192455/http://www.ccrnp.ncifcrf.gov/users/kumarsan/HELANAL/helanal.f