Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bedtools genomecov and non-primary alignments #1061

Open
awgymer opened this issue Aug 21, 2023 · 2 comments
Open

bedtools genomecov and non-primary alignments #1061

awgymer opened this issue Aug 21, 2023 · 2 comments

Comments

@awgymer
Copy link

awgymer commented Aug 21, 2023

Does genomecov use non-primary alignments (secondary/supplementary) from the BAM in it's calculations? If so is there any in-built way to exclude them?

@charlesfoster
Copy link

I've just come across this same query, and, from what I can tell, genomecov does use non-primary alignments. To figure this out, I compared it to calculations from mosdepth.

# 1. bedtools genomecov
bedtools genomecov -bga -ibam input.bam > bedtools.depth.tsv

# 2. mosdepth defaults: excluding non-primary, QC fail, unmapped reads, and duplicates = bitwise flag 1796
mosdepth default input.bam 

# 3. mosdepth: excluding QC fail, unmapped reads, and duplicates = bitwise flag 1540
mosdepth -F 1540 flag1540 input.bam

The results of (1) and (3) were identical.

@awgymer
Copy link
Author

awgymer commented Aug 29, 2023

Thank you for doing the work I didn't!
Do you have any thoughts on the best way to exclude non-primary reads when running genomecov?

Pre-filter with samtools view?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants