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

Pre-calculate cell relationships #984

Closed aarmey closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Merging #984 (cc718b5) into master (4cbc7e6) will decrease coverage by 3.29%. The diff coverage is 51.67%.

@@            Coverage Diff             @@
##           master     #984      +/-   ##
==========================================
- Coverage   73.88%   70.60%   -3.29%     
==========================================
  Files          26       28       +2     
  Lines        2068     2075       +7     
==========================================
- Hits         1528     1465      -63     
- Misses        540      610      +70     
Flag Coverage Δ
unittests 70.60% <51.67%> (-3.29%) :arrow_down:

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

Impacted Files Coverage Δ
lineage/HMM/E_step.py 20.63% <20.63%> (ø)
lineage/states/stateCommon.py 78.68% <45.45%> (-21.32%) :arrow_down:
lineage/LineageTree.py 85.98% <55.88%> (-11.88%) :arrow_down:
lineage/Analyze.py 97.70% <66.66%> (+4.70%) :arrow_up:
lineage/BaumWelch.py 89.58% <100.00%> (+0.33%) :arrow_up:
lineage/HMM/M_step.py 100.00% <100.00%> (ø)
lineage/Viterbi.py 98.03% <100.00%> (-0.08%) :arrow_down:
lineage/tHMM.py 95.83% <100.00%> (-0.80%) :arrow_down:
lineage/tests/test_tHMM.py 100.00% <100.00%> (ø)

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

aarmey commented 1 year ago

@Farnazmdi please go through this carefully and let me know if anything isn't clear. This pre-calculates all of the indexing, and then uses numba to jit the backward/forward passes, to greatly speed everything up. I then also organized the code a bit more, making a separate file for the E and M steps, then putting both of these in a dedicated folder. There are a lot of changes here—I am pretty confident in them given that the tests pass, but it would be helpful to review the build figures also to make sure nothing is out of place.

Farnazmdi commented 1 year ago

Hi Dr. Meyer, Thank you so much, sorry that it is taking me long to read through and learn the changes. I will do it tomorrow hopefully. Thank you again, I really appreciate it.

Farnazmdi commented 1 year ago

I ran the plots and there was only one tiny typo that I edited. Everything is running fast the code is much more readible and the figures look great. Thank you so much.

aarmey commented 1 year ago

Ok great. Merging!