make_fragment_file silently drops marked duplicates, making frac_duplicates always 0 and fragment counts always 1
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 323
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I am passing my BAM file, which has been pre-processed already, to the snap.pp.make_fragment_file and all duplicate-flagged reads are silently dropped before SnapATAC2's own dedup pass. The results that I got are the following:
frac_duplicatesin the returned stats is always0.0- Column 5 (
count) in the output fragments file is always1for every row
What can I do in order to retain the duplicates as well, not only the primary reads? Is there a parameter I missed, or a recommended workflow for users whose BAMs come from a pipeline that already runs MarkDuplicates? I'd like column 5 and frac_duplicates to reflect the real per-fragment read counts.
Environment
- SnapATAC2 2.9.0, Python 3.11
- Long-read single-end scATAC BAM file (ONT), Picard MarkDuplicates with
--BARCODE_TAG CB
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at snap.pp.make_fragment_file and trace how duplicate-flagged BAM reads are filtered, along with how frac_duplicates and output column 5 are computed. Done means the behavior for pre-marked duplicates is defined and the returned statistics and fragment counts reflect the retained reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100