wbaopaul / scATAC-pro

A comprehensive tool for processing, analyzing and visulizing single cell chromatin accessibility sequencing data
MIT License
66 stars 24 forks source link

single-end bam has zero 0x1 lines #62

Closed Puriney closed 1 year ago

Puriney commented 1 year ago

https://github.com/wbaopaul/scATAC-pro/blob/4564c508205996e189ab8c4c65d9b2b928da6ae3/scripts/mapping.sh#L52-L57

Hello,

I found that -f 0x1 will always give zero lines of a single-end bam file though my bam file has lines with quality >=30.

$ samtools view x.positionsort.bam | cut -f5 | head
3
3
3
3
42
3
3
3
42
42

In the pair-end bam file, -f 0x1 and -f 0x2 will give two different numbers as they mean differently.

See: https://broadinstitute.github.io/picard/explain-flags.html

Puriney commented 1 year ago

I set isSingleEnd = TRUE in the config because my input is single-end fastq read. It contains no pair-end at all.

Puriney commented 1 year ago

I suggest probably deleting the flag filtering operation for singleEnd mode. Keep the -f 0x2 for the pair-end mode.

Using the -F won't help.

$ samtools view -c  x.positionsort.bam
205987838
$ samtools view -c -F 0x1 x.positionsort.bam
205987838
$ samtools view -c -F 0x2 x.positionsort.bam
205987838
wbaopaul commented 1 year ago

Thanks for the suggestion. Fixed! See https://github.com/wbaopaul/scATAC-pro/commit/a381e9d01acf272d6347110d64d469b82ab27199