Skip to content

Commit

Permalink
Added images to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
NJ-Thomson committed Nov 29, 2024
1 parent a1c37e8 commit e9c6d35
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 7 deletions.
Empty file modified docs/create_docs.sh
100644 → 100755
Empty file.
Binary file added docs/images/Density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/JSD_pdb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SSI_pdb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Torsions.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/WaterFeatures.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Waters_and_Density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/bb-clusts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/bb-dists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added docs/images/receptor_sc-torsions_jsd.pdf
Binary file not shown.
Binary file added docs/images/receptor_sc-torsions_ssi.pdf
Binary file not shown.
Binary file added docs/images/sc-jsd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/sc-ssi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/tut-2-preprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ relatively rigid with sites that are spatially static, for example internal
water cavities in membrane proteins. Here we demonstrate the preprocessing for
water density, however the same procedure would be used for ions.

.. image:: images/Density.png
:height: 300px
:align: center
:alt: Density of protein

Files and Directories
---------------------
Expand Down Expand Up @@ -236,7 +240,7 @@ This helps us avoid memory errors with large python arrays.
out_name_water_a+".gro", out_name_water_a+"_aligned.xtc",
out_name_water_b+".gro", out_name_water_b+".xtc",
atomgroup="OH2", write_grid_as="TIP3P",
out_name="traj/water_grid_ab_",
out_name="ab_grid_",
use_memmap=True, memmap='traj/combined.mymemmap'
)
Expand Down
24 changes: 18 additions & 6 deletions docs/tut-3-featurization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Note that all reader functions load the names of the features and
their values separately.


.. image:: images/Torsions.jpg
:height: 300px
:align: center
:alt: Torsion angles.


Basic Example
*************

Expand Down Expand Up @@ -133,14 +139,20 @@ molecules occupy that are of interest. Water pocket featurization extracts
a distribution that represents whether or not a specific protein cavity is occupied
by a water molecule, and what that water molecule's orientation (polarisation) is.


.. image:: images/WaterFeatures.jpg
:width: 300px
:align: center
:alt: Water features derived from density.

.. code:: python
from pensa.features import read_water_features
For the pdb visualisation, the trajectory needs to be fit to the first frame of the simulation
so that the density and protein align with each other.

Here we featurize the top 3 most probable water sites (top_waters = 3).
Here we featurize the top 2 most probable water sites (top_waters = 2).
Orientation of the waters (water_data - spherical coordinates [radians]) is a
timeseries distribution. When water is not present at the site, the orientation
is recorded as 10000.0 to represent an empty state. If write=True, we can
Expand All @@ -161,7 +173,7 @@ water
water_feat, water_data = read_water_features(
structure_input = struc,
xtc_input = xtc,
top_waters = 1,
top_waters = 2,
atomgroup = "OH2",
write = True,
write_grid_as="TIP3P",
Expand All @@ -176,11 +188,11 @@ This way, sites are the same across both ensembles and can be compared.
struc = "traj/condition-a_water.gro"
xtc = "traj/condition-a_water_aligned.xtc"
grid = "traj/water_grid_ab_OH2_density.dx"
grid = "ab_grid_OH2_density.dx"
water_feat, water_data = read_water_features(
structure_input = struc,
xtc_input = xtc,
top_waters = 5,
top_waters = 2,
atomgroup = "OH2",
grid_input = grid
)
Expand All @@ -206,10 +218,10 @@ written (write=True) using the default density conversion "Angstrom^{-3}" in MDA
atom_feat, atom_data = read_atom_features(
structure_input = struc,
xtc_input = xtc,
top_atoms = 1,
top_atoms = 2,
atomgroup = "SOD",
element = "Na",
write = True,
out_name = "features/11426_dyn_151_sodium"
)
33 changes: 33 additions & 0 deletions docs/tut-4-comparison.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ distance per residue in the "B factor" field of a PDB file.
y_label='max. JS dist. of BB torsions'
)
.. image:: images/JSD_pdb.png
:height: 300px
:align: center
:alt: JSD pbd b-factor visualisaton file.


.. image:: images/sc-jsd.png
:height: 300px
:align: center
:alt: Jensen-Shannon Distance PDF output.


Let's now save the resulting data in CSV files.

.. code:: python
Expand Down Expand Up @@ -159,6 +172,18 @@ We can plot the results in the same way as we did for the backbone analysis.
)
.. image:: images/SSI_pdb.png
:height: 300px
:align: center
:alt: SSI pbd b-factor visualisaton file.

.. image:: images/sc-ssi.png
:height: 300px
:align: center
:alt: State-Specific Information PDF output.



Comparing Distances
-------------------

Expand Down Expand Up @@ -194,3 +219,11 @@ divergence, Kolmogorov-Smirnov statistic etc. instead).
names_bbdist, jsd_bbdist, "plots/receptor_jsd-bbdist.pdf",
vmin = 0.0, vmax = 1.0, cbar_label='JSD'
)
.. image:: images/bb-dists.png
:height: 300px
:align: center
:alt: JSD distances pbf plot.

8 changes: 8 additions & 0 deletions docs/tut-5-dimensionality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ We now perform the actual clustering on the combined data.
)
cidx, cond, oidx, wss, centroids = cc
.. image:: images/bb-clusts.png
:height: 300px
:align: center
:alt: BB torsion cluster pbf plot.

... and save the results to a CSV file.

.. code:: python
Expand Down

0 comments on commit e9c6d35

Please sign in to comment.