Question: Coverage per gene
0
gravatar for gubrins
9 months ago by
gubrins60
gubrins60 wrote:

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

ADD COMMENTlink modified 9 months ago by ATpoint44k • written 9 months ago by gubrins60
1

see How to calculate average coverage for all genes

ADD REPLYlink modified 9 months ago • written 9 months ago by Pierre Lindenbaum132k

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

ADD REPLYlink written 9 months ago by gubrins60
2
gravatar for ATpoint
9 months ago by
ATpoint44k
ATpoint44k wrote:

Switch -a and -b.

bedtools bamtobed -i WA01.bam | bedtools coverage -b - -a mit.bed > exons.mit.coverage
ADD COMMENTlink written 9 months ago by ATpoint44k

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

ADD REPLYlink written 9 months ago by gubrins60

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 REPLYlink written 9 months ago by gubrins60
1

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

ADD REPLYlink modified 9 months ago • written 9 months ago by GenoMax94k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 927 users visited in the last hour