meyer-lab / tHMM

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

edits to the import function #884

Closed Farnazmdi closed 2 years ago

Farnazmdi commented 2 years ago

I added a test function to the test_import_lineage and now I am only importing the first file (of the three files) of EGF data that fails. Here is the error:

`> output = run_Analyze_over(dataFull, desired_num_states, atonce=True)

lineage/tests/test_import_lineage.py:75:


lineage/Analyze.py:78: in run_Analyze_over output = [prom.result() for prom in prom_holder] lineage/Analyze.py:78: in output = [prom.result() for prom in prom_holder] /usr/lib/python3.9/concurrent/futures/_base.py:445: in result return self.__get_result()


self = None

def __get_result(self):
    if self._exception:
        try:
          raise self._exception

E FloatingPointError: invalid value encountered in true_divide

/usr/lib/python3.9/concurrent/futures/_base.py:390: FloatingPointError `

Farnazmdi commented 2 years ago

The more accurate place or error is this:

Traceback (most recent call last): File "/usr/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker r = call_item.fn(*call_item.args, *call_item.kwargs) File "/home/farnazm/tHMM/lineage/Analyze.py", line 28, in Analyzelist , , , _, LL = fit_list(tHMMobj_list) File "/home/farnazm/tHMM/lineage/tHMM.py", line 223, in fit_list MSD_list, NF_list, betas_list, gammas_list = map(list, zip([do_E_step(tHMM) for tHMM in tHMMobj_list])) File "/home/farnazm/tHMM/lineage/tHMM.py", line 223, in MSD_list, NF_list, betas_list, gammas_list = map(list, zip(*[do_E_step(tHMM) for tHMM in tHMMobj_list])) File "/home/farnazm/tHMM/lineage/BaumWelch.py", line 36, in do_E_step get_nonleaf_NF_and_betas(tHMMobj, MSD, EL, NF, betas) File "/home/farnazm/tHMM/lineage/UpwardRecursion.py", line 203, in get_nonleaf_NF_and_betas betas[num][pii, :] = fac1 / NF[num][pii] FloatingPointError: invalid value encountered in true_divide

Farnazmdi commented 2 years ago

I caught a mistake in the importing function in the order of cells... I think there is no point in looking into this before I fix that..

Farnazmdi commented 2 years ago

right now, we are ignoring the lineages that have 1 or 3 children, and for those cells that appear at the very end, I set their lifetime = 0.5 instead of 0.

codecov[bot] commented 2 years ago

Codecov Report

Merging #884 (24e0209) into master (70a42d0) will increase coverage by 7.48%. The diff coverage is 98.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #884      +/-   ##
==========================================
+ Coverage   73.76%   81.25%   +7.48%     
==========================================
  Files          26       26              
  Lines        2150     2160      +10     
==========================================
+ Hits         1586     1755     +169     
+ Misses        564      405     -159     
Flag Coverage Δ
unittests 81.25% <98.07%> (+7.48%) :arrow_up:

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

Impacted Files Coverage Δ
lineage/import_lineage.py 97.12% <97.50%> (+0.74%) :arrow_up:
lineage/tests/test_import_lineage.py 100.00% <100.00%> (ø)
lineage/states/stateCommon.py 93.33% <0.00%> (-1.12%) :arrow_down:
lineage/Analyze.py 87.20% <0.00%> (+1.16%) :arrow_up:
lineage/LineageInputOutput.py 92.00% <0.00%> (+18.00%) :arrow_up:
lineage/Lineage_collections.py 100.00% <0.00%> (+100.00%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 70a42d0...24e0209. Read the comment docs.