How to compute average depth of coverage for expression matrix
1
0
Entering edit mode
10.6 years ago
smartsean • 0

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?

alignment RNA-Seq sequence genome • 3.9k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
0
Entering edit mode
10.6 years ago
rohan ▴ 110
  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 COMMENT

Login before adding your answer.

Traffic: 2031 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