Skip to content

Commit bfb05c9

Browse files
committed
Merge remote-tracking branch 'origin/readthedocs-update' into readthedocs-update
2 parents c6b5252 + abf3527 commit bfb05c9

File tree

6 files changed

+127
-17
lines changed

6 files changed

+127
-17
lines changed

README.md

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,28 @@ However, the identification of Lo or Ld domains from coarse grained or atomistic
1616

1717
DomHMM is bound by a [Code of Conduct](https://github.com/BioMemPhys-FAU/domhmm/blob/main/CODE_OF_CONDUCT.md).
1818

19-
### Installation
19+
Features
20+
--------------
21+
22+
With DomHMM you can:
23+
24+
- Calculate the area per lipid for each lipid in every leaflet.
25+
- Compute the average S<sub>CC</sub> parameter for each acyl chain of every lipid.
26+
- Easily identify lateral nano- and microdomains in your membrane simulations.
27+
28+
Installation
29+
--------------
2030

2131
To build DomHMM from source,
2232
we highly recommend using virtual environments.
2333
If possible, we strongly recommend that you use
2434
[Anaconda](https://docs.conda.io/en/latest/) as your package manager.
25-
Below we provide instructions both for `conda` and
35+
Below we provide instructions both for `conda`/`mamba` and
2636
for `pip`.
2737

28-
First clone repository:
29-
```
30-
git clone https://github.com/BioMemPhys-FAU/domhmm
31-
cd domhmm
32-
```
33-
34-
#### With conda
38+
#### Virtual environment
3539

36-
Ensure that you have [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) installed.
40+
Ensure that you have [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) or [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) installed.
3741

3842
Create a virtual environment and activate it:
3943

@@ -42,7 +46,29 @@ conda create --name domhmm
4246
conda activate domhmm
4347
```
4448

45-
Install the development and documentation dependencies:
49+
Or,
50+
```
51+
mamba create --name domhmm
52+
mamba activate domhmm
53+
```
54+
55+
#### Installing directly from the repository without cloning
56+
57+
If you want to install the latest version of DomHMM directly from the repository (either from the `main` branch or any other branch), you can use the following command:
58+
59+
```
60+
python3 -m pip install git+https://github.com/BioMemPhys-FAU/domhmm@main
61+
```
62+
63+
#### Installing directly from the repository with cloning
64+
65+
First clone repository:
66+
```
67+
git clone https://github.com/BioMemPhys-FAU/domhmm
68+
cd domhmm
69+
```
70+
71+
Install the development and documentation dependencies (with conda or with mamba):
4672

4773
```
4874
conda env update --name domhmm --file devtools/conda-envs/test_env.yaml
@@ -76,6 +102,32 @@ the dependencies required for tests and docs with:
76102
pip install -e ".[test,doc]"
77103
```
78104

105+
Our test suite requires the installation of `pytest`. To install this package via `conda` or `mamba` run:
106+
107+
```
108+
conda install pytest
109+
```
110+
111+
Or,
112+
```
113+
mamba install pytest
114+
```
115+
116+
To run the test, first clone the repository
117+
```
118+
git clone https://github.com/BioMemPhys-FAU/domhmm
119+
```
120+
121+
Change into the directory and run `pytest`,
122+
123+
```
124+
cd domhmm
125+
pytest --pyargs domhmm
126+
```
127+
128+
Usage
129+
--------------
130+
79131
### Example Script
80132
You can use DomHMM library like in this example script
81133
```

docs/source/how-to-run.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ Let's dive into each parameter's details.
119119
Optional Parameters
120120
-------------------
121121

122+
* ``asymmetric_membrane``
123+
124+
It needs to be enabled if leaflets are not symmetric. With this option, models are fitted by separated data for each leaflets.
125+
122126
* ``frac``
123127

124128
Fraction of box length in x and y outside the unit cell considered for area per lipid calculation by Voronoi. It is an optimization process parameter which is set to 0.5 as default.
@@ -171,4 +175,17 @@ Parameter option for reusing past DomHMM HMM models. If there are several analys
171175
model_2 = domhmm.PropertyCalculation( ... ,
172176
trained_hmms=reuse_hmm_models)
173177
178+
* ``tmd_protein_list``
179+
180+
Transmembrane domain (tmd) protein list to include area per lipid calculation. Since tmd proteins are take up space in upper, lower or both leaflets, three backbone atoms of protein for each leaflet should be included as in this parameter to increase success of identification.
181+
182+
.. code-block::
183+
184+
# Selecting three backbone atoms that is touching to upper leaflet
185+
upBB = uni.select_atoms('name BB')[0:3]
186+
# Selecting three backbone atoms that is touching to lower leaflet
187+
loBB = uni.select_atoms('name BB')[-3:]
188+
# List can be expended with multiple dictionary objects as in more than one tmd protein scenarios.
189+
tmd_protein_list = [{"0": upBB, "1": loBB}]
190+
174191
We encourage to check :doc:`tips` section that may contain useful information for your progress.

domhmm/tests/test_domhmm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ def test_domhmm_imported(self):
183183
"""
184184
assert "domhmm" in sys.modules
185185

186-
def test_run(self, analysis):
187-
"""
188-
Demo run with standard options
189-
"""
190-
analysis.run(start=0, stop=100)
191-
self.result_parameter_check(analysis, "analysis")
186+
# def test_run(self, analysis):
187+
# """
188+
# Demo run with standard options
189+
# """
190+
# analysis.run(start=0, stop=100)
191+
# self.result_parameter_check(analysis, "analysis")
192192

193193
def test_run_reuse_hmm_model(self, analysis_reuse_hmm_model):
194194
"""

examples/tmd-protein-example/main.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import os
2+
3+
import MDAnalysis as mda
4+
5+
import domhmm
6+
7+
if __name__ == "__main__":
8+
# MDAnalysis universe for membrane simulation
9+
data_dir = os.path.dirname(__file__)
10+
path2xtc = os.path.join(data_dir, "md_center_mol.xtc")
11+
path2tpr = os.path.join(data_dir, "mem.tpr")
12+
uni = mda.Universe(path2tpr, path2xtc)
13+
14+
# Selecting three backbone atoms that is touching to upper leaflet
15+
upBB = uni.select_atoms('name BB')[0:3]
16+
# Selecting three backbone atoms that is touching to lower leaflet
17+
loBB = uni.select_atoms('name BB')[-3:]
18+
19+
tmd_protein_list = [{"0": upBB, "1": loBB}]
20+
membrane_select = "resname PUPC POPC CHOL"
21+
heads = {"PUPC": "PO4", "POPC": "PO4"}
22+
tails = {"POPC": [["C1B", "C2B", "C3B", "C4B"], ["C1A", "D2A", "C3A", "C4A"]],
23+
"PUPC": [["C1B", "C2B", "C3B", "C4B"], ["D1A", "D2A", "D3A", "D4A", "D5A"]]}
24+
sterol_heads = {"CHOL": "ROH"}
25+
sterol_tails = {"CHOL": ["ROH", "C1"]}
26+
27+
# leaflet_kwargs should contain all head group atoms/molecules of lipids for LeafletFinder function
28+
model = domhmm.PropertyCalculation(universe_or_atomgroup=uni,
29+
leaflet_kwargs={"select": "name P*", "pbc": True},
30+
membrane_select=membrane_select,
31+
leaflet_select="auto",
32+
heads=heads,
33+
sterol_heads=sterol_heads,
34+
sterol_tails=sterol_tails,
35+
tails=tails,
36+
result_plots=True,
37+
tmd_protein_list=tmd_protein_list,
38+
)
39+
40+
# Run option can be updated by parameters such as start=0, stop=100, step=5
41+
model.run(start=0, stop=100)
3.99 MB
Binary file not shown.

examples/tmd-protein-example/mem.tpr

3.89 MB
Binary file not shown.

0 commit comments

Comments
 (0)