Thank you very much!!! It worked!! Now I need to filter the reads per quality, because I had all of them together.
Hey,
I'm working with bedtools trying to find out the coverage of several target regions. I have my bam files and my target regions in a .bed file and I'm running this:
bedtools bamtobed -i WA01.bam | bedtools coverage -a - -b mit.bed > exons.mit.coverage
When I open the exons.mit.coverage file, in the coverage section I just have 0s in the areas that are not matching my target genes and 1s in the areas of my target genes, as I have coverage per read.
My question: How can I obtain coverage per gene and not coverage per read?
I imagine I can filter this out, selecting the reads with a good quality score per gene, but I think this should be already implemented anywhere else that I don't know
Thanks for your help! :)
1 answer
Switch -a and -b.
bedtools bamtobed -i WA01.bam | bedtools coverage -b - -a mit.bed > exons.mit.coverage
I was trying to send you a private message @ATpoint but I don't know if it's possible to send them. Thanks for the help, I've seen that you have been replying to some of my messages lately and the help is really apreciated!
It is not possible to send private messages to Biostars users via this site.
Log in to answer this question.
see How to calculate average coverage for all genes
I'm also going to check that link, thanks!