Lesson 6 of 13 · 10 min
Reads, Depth, and Coverage
A DNA sequencing machine cannot read a whole chromosome from one end to the other. Instead it chops the DNA into millions of tiny fragments and reports the letters of each fragment as a read, which is a short string of the bases A, C, G, and T. The read length is simply how many bases are in one read, for example 150 bp, where bp stands for base pairs.
Depth And Coverage
Because the fragments overlap, most positions in the genome end up being read more than once. Sequencing depth, also called coverage, is the average number of times each base in the genome is read. A depth written as 30x means every base was read about 30 times on average.
Tip: Higher coverage means each base is supported by more independent reads, so a random sequencing error in one or two reads gets outvoted by the majority. This is why a human whole genome is usually sequenced to about 30x, which gives enough confidence to tell a real variant apart from noise.
Estimating Coverage
You can estimate the average coverage before doing any mapping with a simple formula: coverage equals the number of reads times the read length, divided by the genome size. Genome size is the total number of bases in the genome you are sequencing. The command below estimates coverage for one million 150 bp reads of the E. coli genome, which is about 4.6 million bases.
# reads = how many reads, read_length = bases per read, genome_size = bases
reads=1000000
read_length=150
genome_size=4600000
# coverage = reads x read_length / genome_size
awk -v r="$reads" -v l="$read_length" -v g="$genome_size" \
'BEGIN { printf "%.1fx\n", (r * l) / g }'32.6x
Average depth alone does not tell you whether the coverage is spread out evenly. Breadth of coverage is the percentage of the genome that is covered by at least one read, while depth is how deep that coverage is on average. A genome can have high average depth but poor breadth if some regions are read hundreds of times and other regions are never read at all.
# a BAM file holds your reads after they have been aligned to the genome
# samtools coverage prints both breadth and depth per reference sequence
samtools coverage sample.bam#rname startpos endpos numreads covbases coverage meandepth meanbaseq meanmapq
NC_000913.3 1 4641652 1000000 4640500 99.9752 32.3 36.4 59.6
Try it yourself: A small bacterial genome is 5,000,000 bases long. You sequenced 2,000,000 reads that are each 100 bp long. Using coverage = reads x read length / genome size, what average depth did you achieve? Change the three variables in the awk command above and run it to check your answer.