Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sum duplicate rows in muon.atac.tl.count_fragments_features #125

Open
benjamin-james opened this issue Aug 31, 2023 · 0 comments
Open

Sum duplicate rows in muon.atac.tl.count_fragments_features #125

benjamin-james opened this issue Aug 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@benjamin-james
Copy link

Is your feature request related to a problem? Please describe.
When I am converting range counts to smaller integers (i8 to i1, for example), sums from count_fragments_features can overflow, even though all numbers are below the maximum value supported. Apparently many duplicate row, column pairs can be inserted in count_fragments_features which can lead to this error.

Describe the solution you'd like

mx = mx.tocsr().transpose()
mx.sum_duplicates()
return AnnData(X=mx, obs=adata.obs, var=features)

Describe alternatives you've considered
Simply calling sum_duplicates() after count_fragments_features is what I currently do.

Additional context
I generally use count_fragments_features to count peak sets from a fragments file, so finding correct values so that they can be clipped per-peak is important.

@benjamin-james benjamin-james added the enhancement New feature or request label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant