meyer-lab / tHMM

A general Python framework for using hidden Markov models on binary trees or cell lineage trees.
https://asmlab.org
MIT License
9 stars 1 forks source link

Generations and parents by index array #964

Closed aarmey closed 1 year ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #964 (1edc369) into master (1a407c1) will decrease coverage by 0.90%. The diff coverage is 97.66%.

@@            Coverage Diff             @@
##           master     #964      +/-   ##
==========================================
- Coverage   74.74%   73.84%   -0.90%     
==========================================
  Files          26       26              
  Lines        2138     2065      -73     
==========================================
- Hits         1598     1525      -73     
  Misses        540      540              
Flag Coverage Δ
unittests 73.84% <97.66%> (-0.90%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lineage/Analyze.py 92.78% <ø> (ø)
lineage/CellVar.py 100.00% <ø> (ø)
lineage/tests/test_CrossVal.py 100.00% <ø> (ø)
lineage/LineageTree.py 97.91% <94.64%> (-2.09%) :arrow_down:
lineage/Viterbi.py 98.11% <97.05%> (-1.89%) :arrow_down:
lineage/states/StateDistributionGaPhs.py 100.00% <100.00%> (+3.66%) :arrow_up:
lineage/states/StateDistributionGamma.py 93.96% <100.00%> (-1.18%) :arrow_down:
lineage/states/stateCommon.py 100.00% <100.00%> (ø)
lineage/tHMM.py 96.62% <100.00%> (-0.11%) :arrow_down:
lineage/tests/test_BaumWelch.py 100.00% <100.00%> (ø)
... and 1 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

aarmey commented 1 year ago

This one's quite a bit of work to follow. It removes many of the list.index() operations for speed. Potentially some of these functions could now be wrapped with numba to speed them up later, too.

aarmey commented 1 year ago

Sure. Let me merge this, then we can put new docstrings on a new branch.

The next step more generally should be allowing rand_init to take a random number generator as an option. This then has to be passed along to all the random substeps, such as randomly generating the emissions, transitions, etc.

https://numpy.org/doc/stable/reference/random/index.html