Hello everyone,
I need to calculate the average coverage and average depth for an Oxford Nanopore (ONT) sequencing run. Is there any method, tool, or pipeline to calculate the average coverage and average depth of an ONT run?
Thank you
1 answer
To calculate the average coverage and average depth for an Oxford Nanopore (ONT) sequencing run, note that these terms are often used interchangeably in genomics, where depth refers to the average number of times each base in the genome is sequenced (i.e., average coverage). You will need a reference genome or an estimate of the genome size. If you lack a reference, a rough estimate is total sequenced bases divided by genome size, but for accurate values, align the reads first.
Assuming you have FASTQ files from the ONT run, follow this pipeline:
- Align the reads to your reference genome using minimap2, which is suitable for long reads.
minimap2 -a -x map-ont reference.fasta reads.fastq > aligned.sam
- Convert the SAM to BAM, sort, and index it with samtools.
samtools view -bS aligned.sam > aligned.bam
samtools sort aligned.bam -o aligned.sorted.bam
samtools index aligned.sorted.bam
- Calculate coverage and depth using mosdepth for genome-wide averages (install via conda if needed:
conda install -c bioconda mosdepth). It outputs a summary file with mean depth.
mosdepth -n aligned aligned.sorted.bam
cat aligned.mosdepth.summary.txt
The last line of the summary file gives the genome-wide mean, min, and max depth.
Alternatively, use samtools coverage for per-contig statistics, then compute the overall average manually if required.
samtools coverage aligned.sorted.bam
For quality control, NanoPlot can provide additional read statistics, including estimated coverage if you supply the genome size.
NanoPlot --fastq reads.fastq --loglength -o nanoplot_output
Provide more details on your data (e.g., species, genome size) for tailored advice.
Kevin
Log in to answer this question.
Hi,
what you done/tried already? Have you looked around to see what or how other people do this?
Do also include some more info to your question: which species, what kind of data, is there a reference genome available (or estimate of genome size)? ... Perhaps also indicate what you understand by coverage and/or depth (these are often used interchangeable and interpreted differently by people)
Very basically: you need to sum the total amount of bases sequenced (== produced by your sequencing run) and divide that by the total length of the genome.
You can also use
PanDepth(https://github.com/HuiyangYu/PanDepth ) in addition tomosdepththat has already been covered in answer below.