kaizhang / SnapATAC2

Single-cell epigenomics analysis tools
https://kzhang.org/SnapATAC2/
222 stars 24 forks source link

make_fragment_file output file is empty #288

Closed MaoxuWang closed 6 months ago

MaoxuWang commented 6 months ago

Hi Kai, thank you for this great software! However, I encountered a problem when running make_fragment_file

import snapatac2 as snap
snap.pp.make_fragment_file(
    "./GFK240321N711.sorted.bam",
    "./GFK.fragment.tsv.gz",
    is_paired = False,
    barcode_tag="CB")

This returns

FlagStat { read: 196247051, primary: 196247051, secondary: 0, supplementary: 0, duplicate: 0, primary_duplicate: 0, mapped: 196247051, primary_mapped: 196247051, paired: 0, read_1: 0, read_2: 0, proper_pair: 0, mate_mapped: 0, singleton: 0, mate_reference_sequence_id_mismatch: 0, mate_reference_sequence_id_mismatch_hq: 0 }

However, my output fragment file is empty ("/GFK.fragment.tsv.gz") I used SnapATAC2 version 2.5.3 (installed from conda), my bam is single-ended data, sorted without removing duplicates and it has CB tag. May you help me with this? Look forward to your reply :)

kaizhang commented 6 months ago

Thanks for using SnapATAC2. Is it possible to share the input file or a chunk of the file with me, so that I can debug it?

MaoxuWang commented 6 months ago

That's kind of you! I double checked my input file and found that my cell barcode tag is not "CB". The function works fine now after I corrected the tag name. Thanks for your reply!