Skip to content

Commit 1527d7a

Browse files
committed
Major update and organisation of docs.
1 parent 159c990 commit 1527d7a

File tree

13 files changed

+502
-38
lines changed

13 files changed

+502
-38
lines changed

docs/source/_templates/module.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,29 @@
1414
{% endif %}
1515
{% endblock %}
1616

17-
{% block functions %}
18-
{% if functions %}
19-
.. rubric:: {{ _('Functions') }}
17+
{% block classes %}
18+
{% if classes %}
19+
.. rubric:: {{ _('Classes') }}
2020

2121
.. autosummary::
2222
:toctree:
23+
:template: class.rst
2324
:nosignatures:
24-
{% for item in functions %}
25+
{% for item in classes %}
2526
{{ item }}
2627
{%- endfor %}
2728
{% endif %}
2829
{% endblock %}
2930

30-
{% block classes %}
31-
{% if classes %}
32-
.. rubric:: {{ _('Classes') }}
31+
32+
{% block functions %}
33+
{% if functions %}
34+
.. rubric:: {{ _('Functions') }}
3335

3436
.. autosummary::
3537
:toctree:
36-
:template: class.rst
3738
:nosignatures:
38-
{% for item in classes %}
39+
{% for item in functions %}
3940
{{ item }}
4041
{%- endfor %}
4142
{% endif %}

docs/source/analysis.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
Analysis
3+
========
4+
5+
A package of the classes for analysing molecules in :mod:`.CGExplore`.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
Analysis module <_autosummary/cgexplore.analysis>
11+
12+
Geometry
13+
--------
14+
15+
To analyse the geometry of CG molecules (including size and pore metrics),
16+
see:
17+
18+
.. toctree::
19+
:maxdepth: 1
20+
21+
GeomMeasure <_autosummary/cgexplore.analysis.GeomMeasure>
22+
23+
To calculate torsions:
24+
25+
.. toctree::
26+
:maxdepth: 1
27+
28+
get_dihedral <_autosummary/cgexplore.analysis.get_dihedral>
29+
30+
Shape
31+
-----
32+
33+
We have a series of functions (moving into one class
34+
:class:`cgexplore.analysing.ShapeMeasure`) for interfacing with
35+
`Shape <https://www.iqtc.ub.edu/uncategorised/program-for-the-stereochemical-analysis-of-molecular-fragments-by-means-of-continous-shape-measures-and-associated-tools/>`_.
36+
I recommend using what is in this class:
37+
38+
.. toctree::
39+
:maxdepth: 1
40+
41+
ShapeMeasure <_autosummary/cgexplore.analysis.ShapeMeasure>
42+
43+
Old utility functions (will be removed one day):
44+
45+
.. toctree::
46+
:maxdepth: 1
47+
48+
fill_position_matrix_molecule <_autosummary/cgexplore.analysis.fill_position_matrix_molecule>
49+
fill_position_matrix <_autosummary/cgexplore.analysis.fill_position_matrix>
50+
get_shape_molecule_byelement <_autosummary/cgexplore.analysis.get_shape_molecule_byelement>
51+
get_shape_molecule_ligands <_autosummary/cgexplore.analysis.get_shape_molecule_ligands>
52+
get_shape_molecule_nodes <_autosummary/cgexplore.analysis.get_shape_molecule_nodes>
53+
known_shape_vectors <_autosummary/cgexplore.analysis.known_shape_vectors>
54+
test_shape_mol <_autosummary/cgexplore.analysis.test_shape_mol>
55+
56+

docs/source/cgexplore.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
# -- Options for HTML output -------------------------------------------------
4242
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4343

44-
html_theme = "furo"
44+
html_theme = "sphinx_rtd_theme"
4545
html_static_path = ["_static"]

docs/source/first_paper_example.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
First Paper Example
2+
===================
3+
4+
.. attention::
5+
6+
This page is very much underdevelopment.
7+
8+
.. important::
9+
10+
**Warning**: If you have a CUDA-capable GPU and attempt to use CUDA in the
11+
first example, you may get `NaN` errors due to the torsion restriction for
12+
angles at 180 degrees, which cause problematic forces. This will be handled
13+
in future versions of the code. And logically, I would suggest removing the
14+
torsion restriction for those angles. The `platform` can be handled through
15+
this argument in `build_building_blocks` and `build_populations`, which I
16+
currently set to `None`, meaning `OpenMM` will decide for itself.
17+
18+
19+
:mod:`.CGExplore` is a library that can be used very broadly on many systems.
20+
However, my first usage on the systematic modelling of cage molecules is
21+
described here and the code is available in the directory `first_paper_example`.
22+
This code should reproduce the data in `10.1039/D3SC03991A <https://doi.org/10.1039/D3SC03991A>`_.
23+
However, as :mod:`.CGExplore` is updated, some deviations may occur.
24+
With each pull request a test is run as a GitHub Action connected to this
25+
`repository <https://github.com/andrewtarzia/cg_model_test>`_. This ensures that
26+
the results obtained for a subset of the original data set do not change with
27+
changes to this library. Additionally, the naming convention has changed and
28+
forcefield `.xml` files should provide the appropriate information for mapping
29+
angles to models.
30+
31+
.. note::
32+
The main change is the use of `Atomlite` databasing!
33+
34+
35+
I recommend installing the :mod:`.CGExplore` with the following instructions
36+
and then using the example directory in a separate repository or code base of
37+
your own.
38+
39+
Download the source code from `first_paper_example - presubmission` release
40+
from `Releases <https://github.com/andrewtarzia/CGExplore/releases>`_ instead
41+
of the `main` repository. Then follow the instructions on the main page.
42+
43+
44+
The workflow:
45+
46+
* `generate_XX.py` generates cage structures for different topology sets
47+
* `env_set.py` sets a specific environment for file outputs
48+
* `plot_XX.py` produces images and figures, and performs analysis
49+
50+

docs/source/forcefields.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
Forcefields
2+
===========
3+
4+
A package of defining the forcefields used in `CGExplore`.
5+
All of these forcefields interface with `OpenMM`.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
Forcefields module <_autosummary/cgexplore.forcefields>
11+
12+
13+
There is a lot of flexibility in how this code is used, however, `OpenMM`
14+
requires a :class:`cgexplore.forcefields.ForcedSystem`.
15+
16+
.. note::
17+
18+
Actually use :class:`cgexplore.forcefields.AssignedSystem` or
19+
:class:`cgexplore.forcefields.MartiniSystem`.
20+
21+
22+
23+
Libraries
24+
---------
25+
26+
These classes allow the user to automatically define a series of forcefields
27+
that vary some parameters in a systematic way in a brute-force combinatorial
28+
way.
29+
30+
.. toctree::
31+
:maxdepth: 1
32+
33+
ForceFieldLibrary <_autosummary/cgexplore.forcefields.ForceFieldLibrary>
34+
MartiniForceFieldLibrary <_autosummary/cgexplore.forcefields.MartiniForceFieldLibrary>
35+
36+
37+
Forcefields
38+
-----------
39+
40+
Classes defining the forcefield before it is assigned to any molecule. This
41+
provides an interface for the user to set the target terms of the forcefield
42+
that can then be assigned to any molecule.
43+
44+
.. toctree::
45+
:maxdepth: 1
46+
47+
ForceField <_autosummary/cgexplore.forcefields.ForceField>
48+
MartiniForceField <_autosummary/cgexplore.forcefields.MartiniForceField>
49+
50+
51+
Forced systems
52+
--------------
53+
54+
Here, the user creates the object that interfaces between a forcefield and an
55+
`OpenMM` simulation.
56+
57+
.. toctree::
58+
:maxdepth: 1
59+
60+
ForcedSystem <_autosummary/cgexplore.forcefields.ForcedSystem>
61+
AssignedSystem <_autosummary/cgexplore.forcefields.AssignedSystem>
62+
MartiniSystem <_autosummary/cgexplore.forcefields.MartiniSystem>
63+
64+
65+
Custom forces
66+
-------------
67+
68+
.. toctree::
69+
:maxdepth: 1
70+
71+
cosine_periodic_angle_force <_autosummary/cgexplore.forcefields.cosine_periodic_angle_force>
72+
custom_excluded_volume_force <_autosummary/cgexplore.forcefields.custom_excluded_volume_force>
73+
74+
75+
Utilities
76+
---------
77+
78+
.. toctree::
79+
:maxdepth: 1
80+
81+
angle_between <_autosummary/cgexplore.forcefields.angle_between>
82+
unit_vector <_autosummary/cgexplore.forcefields.unit_vector>
83+
MartiniTopology <_autosummary/cgexplore.forcefields.MartiniTopology>
84+
get_martini_mass_by_type <_autosummary/cgexplore.forcefields.get_martini_mass_by_type>
85+
86+
87+
.. toctree::
88+
:maxdepth: 1
89+

docs/source/index.rst

Lines changed: 87 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
:caption: CGExplore
44
:maxdepth: 2
55

6-
cgexplore <cgexplore>
6+
Analysis <analysis>
7+
Forcefields <forcefields>
8+
Molecular <molecular>
9+
Optimisation <optimisation>
10+
Terms <terms>
11+
Utilities <utilities>
12+
First Paper Example <first_paper_example>
713

814
.. toctree::
915
:hidden:
@@ -12,38 +18,111 @@
1218

1319
Modules <modules>
1420

15-
============
21+
1622
Introduction
17-
============
23+
------------
1824

1925
| GitHub: https://www.github.com/andrewtarzia/CGExplore
2026
2127

22-
:mod:`.CGExplore` is a Python library for doing something...
23-
28+
:mod:`.CGExplore` is a Python library for for working with
29+
coarse-grained models.
2430

31+
The library is built off of `stk <https://stk.readthedocs.io/en/stable/>`_,
32+
which comes with the pip install.
2533

34+
.. important::
35+
**Warning**: This package is still very much underdevelopment and many changes
36+
are expected.
2637

2738
Installation
2839
------------
2940

30-
TODO
41+
To get :mod:`.CGExplore`, you need to follow these steps:
42+
43+
Clone :mod:`.CGExplore` from `here <https://github.com/andrewtarzia/CGExplore>`_
44+
45+
Create a `conda` or `mamba` environment::
46+
47+
$ mamba create -n NAME python=3.11
48+
49+
Activate the environment::
50+
51+
$ conda activate NAME
52+
53+
54+
From :mod:`.CGExplore` directory, install pip environment::
55+
56+
$ pip install .
57+
58+
or for development, use `just <https://github.com/casey/just>`_ to install a
59+
dev environment with::
60+
61+
$ just dev
62+
63+
64+
Install `OpenMM` `docs <https://openmm.org/>`_::
65+
66+
$ mamba install openmm
67+
68+
or::
69+
70+
$ conda install -c conda-forge openmm
71+
72+
73+
Install `openmmtools` `docs <https://openmmtools.readthedocs.io/en/stable/gettingstarted.html>`_::
74+
75+
$ mamba install openmmtools
76+
77+
or::
78+
79+
$ conda config --add channels omnia --add channels conda-forge
80+
$ conda install openmmtools
81+
82+
83+
Then, update directory structure in `env_set.py` if using example code.
84+
85+
The library implements some analysis that uses `Shape 2.1`. Follow the
86+
instructions to download and installed at
87+
`Shape <https://www.iqtc.ub.edu/uncategorised/program-for-the-stereochemical-analysis-of-molecular-fragments-by-means-of-continous-shape-measures-and-associated-tools/>`_
3188

3289

3390
Examples
3491
--------
3592

36-
TODO
93+
94+
The main series of examples are in `First Paper Example`_. In that page you
95+
will find all the information necessary to reproduce the work in
96+
`10.1039/D3SC03991A <https://doi.org/10.1039/D3SC03991A>`_
97+
98+
With each pull request a test is run as a GitHub Action connected to this
99+
`repository <https://github.com/andrewtarzia/cg_model_test>`_.
100+
This ensures that the results obtained for a subset of the original data set do
101+
not change with changes to this library.
102+
103+
.. note::
104+
105+
`cg_model_test <https://github.com/andrewtarzia/cg_model_test>`_ is a good
106+
example of usage too!
107+
108+
109+
New works done with :mod:`.CGExplore`:
110+
111+
* TBC.
37112

38113

39114
Acknowledgements
40115
----------------
41116

42-
I developed much of this code when working in the Pavan group (https://www.gmpavanlab.com/).
117+
This work was completed during my time as a postdoc, and then research fellow
118+
in the Pavan group at PoliTO (https://www.gmpavanlab.com/).
43119

44120
Indices and tables
45121
------------------
46122

47123
* :ref:`genindex`
48124
* :ref:`modindex`
49125
* :ref:`search`
126+
127+
128+
.. _`First Paper Example`: first_paper_example.html

0 commit comments

Comments
 (0)