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

all figures updated #952

Closed Farnazmdi closed 2 years ago

Farnazmdi commented 2 years ago

This branch just updated all figures according to the new fitting. The only thing that I "changed" was that in the BIC figure, we were fitting and calculating for 1, 2, .., 7 states and pick the best number then run the model again with those number of states. What I did in this branch is that during the BIC fitting, I save the tHMMobjects and recall the one that we pick based on the BIC. This way the BIC value matches the tHMMobj we pick.

codecov[bot] commented 2 years ago

Codecov Report

Merging #952 (7995a40) into master (c3c75f8) will decrease coverage by 0.36%. The diff coverage is 9.09%.

@@            Coverage Diff             @@
##           master     #952      +/-   ##
==========================================
- Coverage   82.65%   82.29%   -0.37%     
==========================================
  Files          28       28              
  Lines        2243     2253      +10     
==========================================
  Hits         1854     1854              
- Misses        389      399      +10     
Flag Coverage Δ
unittests 82.29% <9.09%> (-0.37%) :arrow_down:

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

Impacted Files Coverage Δ
lineage/plotTree.py 0.00% <0.00%> (ø)
lineage/tests/test_BaumWelch.py 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

aarmey commented 2 years ago

@Farnazmdi this is failing because cell.state is None. Did you possibly pickle the tHMM objects before they were fit?

Farnazmdi commented 2 years ago

Sorry about this. I will fix it tonight. I saved all models created from BIC analysis (1, 2, 3, .. state tHMM objects) so we don't have to fit the model again with the optimal number of states. I have not assigned states to those tHMMobjs created from BIC fitting and pickled. This is failing probably in one or two figures that I forgot to add the state assignment code.

aarmey commented 2 years ago

That's reasonable. Just trying to help with where the problem lies.

I also think it's better to not commit these figure files. The pickle files now keep the results reproducible.

Farnazmdi commented 2 years ago

I removed all svg files that could be recreated. Had to make some changes to the functions to automatically generate those figures in the cartoon folder. This should be ready now. I will merge it if it is alright? The changes are mostly just to the figures, with a minor change to the BW test and the addition of a function to plotTree to create those samples of lineage trees we use in lapatinib and gemcitabine figures.

aarmey commented 2 years ago

Let me go through it carefully first. Will do so in a bit.

Farnazmdi commented 2 years ago

Thank you, merging..