Question: How to compute average depth of coverage for expression matrix
0
gravatar for smartsean
3.5 years ago by
smartsean0
United States
smartsean0 wrote:

So I am trying to find the average depth of coverage of 100 genes from a given reference genome in a given time interval 1 - 10. 

I have 10 sorted, indexed bam files, and using samtools depth I was able to find each corresponding avg coverage for coverage base and the total base coverage, but how would I be able to find each gene's avg coverage from this data?

 

rna-seq sequence alignment genome • 1.7k views
ADD COMMENTlink modified 3.5 years ago by rohan100 • written 3.5 years ago by smartsean0

Check out bedtools: http://bedtools.readthedocs.org/en/latest/content/tools/coverage.html

ADD REPLYlink written 3.5 years ago by Ashutosh Pandey11k
0
gravatar for rohan
3.5 years ago by
rohan100
United States
rohan100 wrote:

1] To sort bam file: 

samtools sort file.bam file.sorted

2] Install and run bedtools to get coverage:

coverageBed -d -abam file.sorted.bam -b /path/to/.bed/file/ref.bed > output.cov

3] This will include names to the columns of the output: (reference, start position, end position, base, coverage at the position )

sed -i 1i" ref\tstart\tend\tbase\tcov " file.cov    

You can use the output to calculate average coverages.

 

ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by rohan100
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: 945 users visited in the last hour