scverse / muon

muon is a multimodal omics Python framework
https://muon.scverse.org/
BSD 3-Clause "New" or "Revised" License
218 stars 31 forks source link

Count fragment function counts duplicates #110

Open lauradmartens opened 1 year ago

lauradmartens commented 1 year ago

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))