Skip to content

Commit 7ec6513

Browse files
committed
Made documentation
1 parent 21ac7ff commit 7ec6513

41 files changed

Lines changed: 24532 additions & 257 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
# to supply options, put them in 'env', like:
2323
env:
2424
CIBW_SKIP: '*musllinux* pp*'
25-
# CIBW_TEST_REQURES: pytest
26-
# CIBW_TEST_COMMAND: pytest {package}/tests
25+
CIBW_TEST_REQURES: pytest, numpy==1.20.1
26+
CIBW_TEST_COMMAND: pytest {package}/tests
2727
- uses: actions/upload-artifact@v2
2828
with:
2929
path: ./wheelhouse/*.whl

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build/
55
*.egg-info
66
*.whl
77
tests/__pycache__
8+
/docs/build

H2MM_C/H2MM_C.pyx

Lines changed: 319 additions & 253 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# H2MM_C
22

3+
![Build and Test](https://github.com/harripd/H2MMpythonlib/actions/workflows/build_wheels.yml/badge.svg)
4+
35
## Project Desciption
46
H2MM_C is a python extension module that implements the H<sup>2</sup>MM algorithm originally developed by [Pirchi et. al. J. Phys. Chem B. 2016, 120, 13065-12075](http://dx.doi.org/10.1371/journal.pone.0160716) in a highly efficent and multithreaded manner, along with functions for posterior analysis with the *Viterbi* algorithm.
57

dist/H2MM_C-0.9.1.tar.gz

4.86 KB
Binary file not shown.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/AboutH2MM.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
About |H2MM|
2+
============
3+
4+
What is |H2MM|?
5+
---------------
6+
7+
|H2MM| is an extension of hiddenm Markov modeling, a broad set of methods for finding underlying behavior in noisy systems.
8+
The basic assumptions of hidden Markov models are:
9+
10+
#. The system is described by a Markvov model
11+
a. The data describes a system that transitions between a set of states.
12+
b. When the system is in a given state, it has a distinct set of probabilities to transition to each of the other states
13+
c. The system is memoryless, that is the probability to transition to another state is only influenced by the current state, and not any of the previous states
14+
#. The model is hidden, meaning
15+
a. The states cannot be directly observed, rather
16+
b. Each state has a certain probability to produce certain observable results, with each state having a different set of probabilities
17+
18+
The earliest applications of HMM were towards language processing, for which it was not very successful, but has found much greater use in signal processing.
19+
HMM has also found extensive use in analyzing TIRF based smFRET trajectories.
20+
All of these applications however, assume that there is a constant data rate, for a camera with a set frame rate so that there is an image every ms.
21+
22+
This is not the case for single molecule confocal based data using single photon detectors.
23+
Here, data comes in sparsely, as individual photons, with varying interphoton times.
24+
|H2MM| extends the HMM algorithm to accept these variable interphoton times, allowing application of the HMM machinery with confocal data without implementing an external time bin.
25+
26+
HMM methods use the Baum-Welch algorithm in an optimization process which finds the model of a set number of states that best describes the data.
27+
Now since the number of states is fixed, other optimizations must be conducted with different numbers of states.
28+
Then the different optimized models must be compared, and the best one choosen, and the ones with too many (overfit) and too few (underfit) states regected.
29+
30+
A final thing to understand about |H2MM|, is the use of indeces.
31+
In |H2MM|, data comes in a set of detetector chanels, in the first iterations, these were exclusively the |DD| and |DA| channels, but with mp |H2MM|, this was extended to the |AA| channel, and was even suggested to be able to include the parralel and perpendicular channels in anisotropy based measurments.
32+
A comparison to the original application of HMM methods is apt here: originally HMM was developed to anlayze word paterns, so each word was a unique index, and each state had a given probability to produce each word.
33+
So in |H2MM| each photon can be compared to a word, each photon recieves a set of a limited nubmer of indeces.
34+
35+
36+
A Brief History of |H2MM|
37+
-------------------------
38+
39+
Application to confocal single molecule data started with `Gopich and Szabo 2009 <https://doi.org/10.1021/jp903671p>`_ who established the maximum likelihood estimator to calculated the likelihood of a model of transition rates and emission probabilities for a set of data.
40+
`Pirchi and Tsukanov et. al. 2016 <https://doi.org/10.1021/acs.jpcb.6b10726>`_ then integrated the Baum-Welch algorithm, with some reformulation of Gopich and Szabo's original equations, which allowed for an optimization procedure ensuring that the likelihood of each iteration improves.
41+
This made finding the ideal model a feasible undertaking.
42+
However, discrimination between over and underfit models (models with too many or too few states), `Lerner et. al. 2018 <https://doi.org/10.1063/1.5004606>`_ introduced the first attempt at this, with the modified Bayes Information Criterion, and finally the Integrated Complete Likelihood was introduced in `Harris et. al. 2022 <https://doi.org/10.1038/s41467-022-28632-x>`_, which proved a more reliable statistical discriminator.
43+
`Harris et. al. 2022 <https://doi.org/10.1038/s41467-022-28632-x>`_ also introduced the multiparameter approach, where the |AA| stream was integrated allowing discrimination of photophysical and FRET dynamics.
44+
45+
.. |H2MM| replace:: H\ :sup:`2`\ MM
46+
.. |DD| replace:: D\ :sub:`ex`\ D\ :sub:`em`
47+
.. |DA| replace:: D\ :sub:`ex`\ A\ :sub:`em`
48+
.. |AA| replace:: A\ :sub:`ex`\ A\ :sub:`em`

0 commit comments

Comments
 (0)