This repository provides a minimal workflow to compute genome coverage from sequencing reads and visualize it.
The workflow has two steps:
- Python script (
coverage) – maps reads to a reference genome and calculates per-base coverage. - Shiny web app – visualizes coverage across the genome and allows exporting the plot.
The Python script requires:
bwasamtools- Python ≥ 3
Example installation (conda):
conda install -c bioconda bwa samtoolsReads are mapped to a reference genome using BWA, and coverage is calculated using samtools.
coverage -i READS -r REFERENCE| Argument | Description |
|---|---|
-i |
Input reads (FASTA / FASTQ / FASTQ.GZ) |
-r |
Reference genome (FASTA) |
coverage -i sample.fastq.gz -r reference.fastaTwo files are produced:
sample.bam
sample.bam.baisample.coverageFormat:
Reference Position Coverage
Example:
Genome1 1 42
Genome1 2 38
Genome1 3 41
This file is used for visualization in the Shiny app.
Coverage can be visualized using the Shiny application:
http://172.23.210.220:3838/NGS/Coverage/
- Open the link in a browser.
- Upload the
.coveragefile generated by the Python script. - The app will display a coverage plot across the genome.
The plot shows:
- Genome position (x-axis)
- Coverage depth (log scale)
- Horizontal coverage (percentage of positions with coverage > 0)
- Mean vertical coverage (average read depth)
Click “Download PDF” to export the figure.
Output example:
plot_YYYY-MM-DD.pdf
# compute coverage
coverage -i reads.fastq.gz -r reference.fasta
# upload output file
reads.coverageThen open:
http://172.23.210.220:3838/NGS/Coverage/
and upload the .coverage file to generate the plot.