This is a test version of Biostars. For the public version, visit https://www.biostars.org.
coverage on exons with bedtools genomecov

Hello everyone,

I would like to have per-base coverage of a bam file of an RNAseq experiment, but only on exons.

I know how to do that on all genome with bedtools:

bedtools genomecov -d -ibam aligned_reads.bam -g genome.fa > cov.txt

And I have a gff file giving me the position of exons on my species.

Does anyone know a way to have the same result, but only on given exon positions?

Thanks,

Guillaume

bedtools rna-seq exons coverage

1 answer

From the gff extract those lines of exons only. something like below

awk<file.gff -F'\t' '$3==“exon”{print}' >exons.gff

Now use bedtools coverage with the above gff and your bam file with -d and other options that suits your purpose

Thank for the tip. Works fine :)

Log in to answer this question.