Coverage per gene
1
1
Entering edit mode
4.0 years ago
gubrins ▴ 290

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! :)

gene-coverage bed bedtools • 2.1k views
ADD COMMENT
1
0
Entering edit mode

I'm also going to check that link, thanks!

ADD REPLY
3
Entering edit mode
4.0 years ago
ATpoint 81k

Switch -a and -b.

bedtools bamtobed -i WA01.bam | bedtools coverage -b - -a mit.bed > exons.mit.coverage
ADD COMMENT
0
Entering edit mode

Thank you very much!!! It worked!! Now I need to filter the reads per quality, because I had all of them together.

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
1
Entering edit mode

It is not possible to send private messages to Biostars users via this site.

ADD REPLY

Login before adding your answer.

Traffic: 2394 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6