Question: Coverage per gene
0
gravatar for gabri.mochales
3 months ago by
gabri.mochales30 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 3 months ago by ATpoint36k • written 3 months ago by gabri.mochales30
1

see How to calculate average coverage for all genes

ADD REPLYlink modified 3 months ago • written 3 months ago by Pierre Lindenbaum129k

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

ADD REPLYlink written 3 months ago by gabri.mochales30
2
gravatar for ATpoint
3 months ago by
ATpoint36k
Germany
ATpoint36k wrote:

Switch -a and -b.

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

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 3 months ago by gabri.mochales30

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 3 months ago by gabri.mochales30
1

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

ADD REPLYlink modified 3 months ago • written 3 months ago by genomax87k
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: 1369 users visited in the last hour