Bug Fix for SingleCellMemap Concat Function #339
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR contains a bug fix for the row index creation in the
concatfunction of the SingleCellMemap Dataset. This bug occurs in the use case when a user is collating multiple h5ad files into a SingleCellMemmap dataset via a SingleCellCollection/the flatten function.Details
Previously, the
concatfunction was initializing the number of elements in the cumulative row index incorrectly for more than one dataset since it was incrementing the cumulative elements using the number of rows rather than the number of non zero elements thus far. This resulted in cases where the row index was no longer accurate (and no longer monotonically increasing), and thus the gene data retrieved by using these row pointers via functions like scmemmap.get_row was incorrect.Usage
There are no changes to how the user interacts with the changed code.
Testing
We add a regression unit test for the specific case on the val data that was failing previously.
Tests for these changes can be run via:
SKIP_CIlabel to your PR?PYTEST_NOT_REQUIREDlabel to your PR?JET_NOT_REQUIREDlabel to your PR?