openproblems-bio / openproblems

Formalizing and benchmarking open problems in single-cell genomics
MIT License
287 stars 76 forks source link

Add reversed norm order for ALRA in Denoising Task #835

Closed wes-lewis closed 1 year ago

wes-lewis commented 1 year ago

Submission type

Testing

Submission guidelines

PR review checklist

This PR will be evaluated on the basis of the following checks:

github-actions[bot] commented 1 year ago

Current build status

wes-lewis commented 1 year ago

I tried to match the decorators and syntax of the MAGIC methods, to include log/sqrt + norm/reverse-norm for ALRA. There may be some bugs for me to work through!

wes-lewis commented 1 year ago

Seems to be dealing with a recursion depth issue I hadn't seen before. Re-running, and taking a look to see if I notice any obvious changing of data types or processing compared to the previous version.

Is happening in the log normalized, regular norm-order instance... which was previously merged. So something I changed probably broke this.

Current issue:

Traceback (most recent call last): File "/tmp/tmps3gbejjx/test_method.py", line 31, in <module> test_method(*('denoising', 'alra_log', 'openproblems-r-extras'), **{}) File "/tmp/tmps3gbejjx/test_method.py", line 12, in test_method adata = method(adata, test=True) File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tools/decorators.py", line 88, in apply_method adata = func(adata, *args, **kwargs) File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tasks/denoising/methods/alra.py", line 103, in alra_log return _alra(adata, normtype="log", reverse_norm_order=False, test=False) File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tasks/denoising/methods/alra.py", line 60, in _alra Y = _alra(adata) File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tasks/denoising/methods/alra.py", line 60, in _alra Y = _alra(adata) File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tasks/denoising/methods/alra.py", line 60, in _alra Y = _alra(adata) [Previous line repeated 963 more times] File "/__w/SingleCellOpenProblems/SingleCellOpenProblems/openproblems/tasks/denoising/methods/alra.py", line 48, in _alra adata.obsm["train"], libsize = scprep.normalize.library_size_normalize( File "/usr/local/lib/python3.8/site-packages/scprep/normalize.py", line 80, in library_size_normalize rescale, libsize = _get_scaled_libsize(data, rescale, calc_libsize) File "/usr/local/lib/python3.8/site-packages/scprep/normalize.py", line 14, in _get_scaled_libsize libsize = measure.library_size(data) File "/usr/local/lib/python3.8/site-packages/scprep/measure.py", line 23, in library_size library_size = utils.matrix_sum(data, axis=1) File "/usr/local/lib/python3.8/site-packages/scprep/utils.py", line 448, in matrix_sum sums = sum_fn(data, axis=axis) File "<__array_function__ internals>", line 180, in sum File "/usr/local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 2298, in sum return _wrapreduction(a, np.add, 'sum', axis, dtype, out, keepdims=keepdims, File "/usr/local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 84, in _wrapreduction return reduction(axis=axis, out=out, **passkwargs) File "/usr/local/lib/python3.8/site-packages/scipy/sparse/_compressed.py", line 611, in sum major_index, value = self._minor_reduce(np.add) File "/usr/local/lib/python3.8/site-packages/scipy/sparse/_compressed.py", line 645, in _minor_reduce major_index = np.flatnonzero(np.diff(self.indptr)) File "<__array_function__ internals>", line 180, in flatnonzero File "/usr/local/lib/python3.8/site-packages/numpy/core/numeric.py", line 669, in flatnonzero return np.nonzero(np.ravel(a))[0] File "<__array_function__ internals>", line 180, in nonzero File "/usr/local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 1[95](https://github.com/wes-lewis/SingleCellOpenProblems/actions/runs/4218354914/jobs/7322918626#step:13:96)8, in nonzero return _wrapfunc(a, 'nonzero') File "/usr/local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 52, in _wrapfunc bound = getattr(obj, method, None) RecursionError: maximum recursion depth exceeded while calling a Python object

codecov[bot] commented 1 year ago

Codecov Report

Base: 95.59% // Head: 95.53% // Decreases project coverage by -0.06% :warning:

Coverage data is based on head (f7beb44) compared to base (db800b7). Patch coverage: 90.62% of modified lines in pull request are covered.

:exclamation: Current head f7beb44 differs from pull request most recent head 15122b2. Consider uploading reports for the commit 15122b2 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #835 +/- ## ========================================== - Coverage 95.59% 95.53% -0.06% ========================================== Files 187 187 Lines 4968 4974 +6 Branches 271 272 +1 ========================================== + Hits 4749 4752 +3 - Misses 141 143 +2 - Partials 78 79 +1 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `95.53% <90.62%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openproblems-bio#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/openproblems-bio/openproblems/pull/835?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openproblems-bio) | Coverage Δ | | |---|---|---| | [openproblems/tasks/denoising/methods/alra.py](https://codecov.io/gh/openproblems-bio/openproblems/pull/835?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openproblems-bio#diff-b3BlbnByb2JsZW1zL3Rhc2tzL2Rlbm9pc2luZy9tZXRob2RzL2FscmEucHk=) | `93.61% <90.62%> (-6.39%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openproblems-bio). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openproblems-bio)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.