muon
muon copied to clipboard
Count fragment function counts duplicates
Describe the bug
The muon.atac.tl.count_fragments_features function uses the score in the fragment file to count fragments:
https://github.com/scverse/muon/blob/31a45d76f7a1d97eee34866e525788f960e7d504/muon/_atac/tools.py#L860
This score also includes all duplicated read pairs: https://support.10xgenomics.com/single-cell-atac/software/pipelines/latest/output/fragments, but we only want to use the unique fragments for downstream analysis and not the duplicates.
Expected behaviour
Only count the unique fragments by having:
mx.data[i].append(int(1))