Skip to content

Commit

Permalink
update notes to include path finding
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium committed Jan 23, 2024
1 parent fb6d238 commit e5da715
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Getting Started
===============

This page details how to get started with ``mdahole2``.
Note that ``mdahole2`` is only supported on Linux or macOS.
Note that ``mdahole2`` is currently only supported on Linux or macOS.

Documentation
~~~~~~~~~~~~~
Expand Down
40 changes: 30 additions & 10 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@ This toolkit contains the tools to interface with HOLE_
:cite:p:`Smart1993,Smart1996` to analyse an ion channel pore or transporter
pathway :cite:p:`Stelzl2014`.

Finding your hole executable
----------------------------

The first step is to find your HOLE executable. If you have installed HOLE
through ``conda-forge``, then you can find the executable path by searching
``which hole``, e.g.:

.. code-block:: bash
$ which hole
/home/username/miniforge3/envs/mdahole2/bin/hole
If you have installed HOLE from the original source, the executable
may be in your home directory instead, e.g. a path such as ``~/hole2/exe/hole``.

Throughout the rest of this documentation, we will assume that your executable
is at ``~/miniforge3/envs/mdahole2/bin/hole``.


Using HOLE on a PDB file
------------------------

Use the ``hole`` function to run `HOLE`_ on a single PDB file. For example,
the code below runs the `HOLE`_ program installed at `~/hole2/exe/hole`::
the code below runs the `HOLE`_ program installed at `~/miniforge3/envs/mdahole2/bin/hole`::

from MDAnalysis.tests.datafiles import PDB_HOLE
from MDAnalysis.analysis import hole2
profiles = hole2.hole(PDB_HOLE, executable='~/hole2/exe/hole')
from mdahole2.analysis import hole

profiles = hole(PDB_HOLE, executable='~/miniforge3/envs/mdahole2/bin/hole')
# to create a VMD surface of the pore
hole2.create_vmd_surface(filename='hole.vmd')

Expand Down Expand Up @@ -55,11 +75,11 @@ The class can be set-up and run like a normal MDAnalysis analysis class::

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import MULTIPDB_HOLE
from MDAnalysis.analysis import hole2
from mdahole2.analysis import HoleAnalysis

u = mda.Universe(MULTIPDB_HOLE)

ha = hole2.HoleAnalysis(u, executable='~/hole2/exe/hole') as h2:
ha = HoleAnalysis(u, executable='~/miniforge3/envs/mdahole2/bin/hole') as h2:
ha.run()
ha.create_vmd_surface(filename='hole.vmd')

Expand All @@ -80,7 +100,7 @@ call :meth:`~HoleAnalysis.delete_temporary_files`::
Alternatively, you can use HoleAnalysis as a context manager that deletes
temporary files when you are finished with the context manager::

with hole2.HoleAnalysis(u, executable='~/hole2/exe/hole') as h2:
with HoleAnalysis(u, executable='~/miniforge3/envs/mdahole2/bin/hole') as h2:
h2.run()
h2.create_vmd_surface()

Expand All @@ -104,14 +124,14 @@ To analyze a full trajectory and write pore surfaces for all frames to file
:file:`hole_surface.vmd`, use ::

import MDAnalysis as mda
from MDAnalysis.analysis import hole2
from mdahole2.analysis import HoleAnalysis

# load example trajectory MULTIPDB_HOLE
from MDAnalysis.tests.datafiles import MULTIPDB_HOLE

u = mda.Universe(MULTIPDB_HOLE)

with hole2.HoleAnalysis(u, executable='~/hole2/exe/hole') as h2:
with HoleAnalysis(u, executable='~/miniforge3/envs/mdahole2/bin/hole') as h2:
h2.run()
h2.create_vmd_surface(filename="hole_surface.vmd")

Expand All @@ -135,7 +155,7 @@ For example, if we want to start displaying at frame 1 (i.e., skip frame
0), stop at frame 7, and only show every other frame (step 2) then the HOLE
analysis will be ::

with hole2.HoleAnalysis(u, executable='~/hole2/exe/hole') as h2:
with HoleAnalysis(u, executable='~/miniforge3/envs/mdahole2/bin/hole') as h2:
h2.run(start=1, stop=9, step=2)
h2.create_vmd_surface(filename="hole_surface_subsampled.vmd")

Expand Down Expand Up @@ -238,7 +258,7 @@ You can now animate your molecule together with the surface and render it.
.. [#create_vmd_surface_function] If you use the :class:`hole` class to run
:program:`hole` on a single PDB file then you can use
:func:`MDAnalysis.analysis.hole2.utils.create_vmd_surface`
:func:`mdahole2.analysis.utils.create_vmd_surface`
function to manually run :program:`sph_process` and
:program:`sos_triangle` on the output files andcr eate a surface
file.
Expand Down

0 comments on commit e5da715

Please sign in to comment.