Back to Research Notes and Tutorials
Tutorials

From FASTQ to public-health report: a viral genomics workflow

A tutorial-style guide for turning raw reads into consensus genomes, lineage calls, mutation summaries, phylogeny, and a report that non-bioinformaticians can use.

FASTQ QC Reporting

A workflow should preserve decisions

Raw sequencing reads do not become public-health evidence automatically. Between FASTQ and report, the analyst makes decisions about read quality, trimming, host screening, mapping, assembly, variant calling, consensus masking, lineage assignment, and visualization. A good workflow records those decisions as outputs.

For viral surveillance, I prefer a design where each step produces both a file for downstream analysis and a small quality artifact for review. That means the analyst can explain why a sample passed, why a sample failed, and which parts of the genome should be trusted.

Core checkpoints

  • Read QC: raw read counts, quality distribution, adapter content, and per-sample yield.
  • Trimming: adapter and primer handling, minimum length, and quality thresholds.
  • Mapping or assembly: reference choice, percent mapped, breadth, depth, and off-target reads.
  • Consensus: masking threshold, ambiguous bases, low-coverage regions, and final FASTA naming.
  • Interpretation: lineage, clade, mutation table, phylogenetic placement, and limitations.

A minimal command pattern

fastqc sample_R1.fastq.gz sample_R2.fastq.gz
trimmomatic PE sample_R1.fastq.gz sample_R2.fastq.gz R1.trim.fq.gz R1.unpaired.fq.gz R2.trim.fq.gz R2.unpaired.fq.gz ILLUMINACLIP:adapters.fa:2:30:10 SLIDINGWINDOW:4:20 MINLEN:50
bwa mem -t 4 reference.fasta R1.trim.fq.gz R2.trim.fq.gz | samtools sort -o sample.sorted.bam
samtools depth -a sample.sorted.bam > sample.depth.txt
bcftools mpileup -f reference.fasta sample.sorted.bam | bcftools call -mv -Oz -o sample.vcf.gz
nextclade run --input-dataset dataset sample.consensus.fasta --output-all nextclade/

The report is a translation layer

A report should not dump every file into a PDF. It should translate the analysis into decisions: whether the sample has enough genome recovery, whether the lineage or genotype call is reliable, whether mutations require follow-up, and whether the result belongs in a public dashboard, manuscript, or internal memo.

I like reports that include one compact table, one coverage figure, one tree or lineage summary when appropriate, and a short paragraph that states confidence and caveats. The analyst should be able to defend every sentence from the underlying files.

From files to decisions

The important shift in a surveillance workflow is moving from file production to decision support. A FASTQ file becomes useful only after the workflow can show read quality, trimming behavior, mapping performance, depth, consensus uncertainty, lineage support, and an interpretation that a non-specialist can follow.

I like to design the output folder so it mirrors the conversation I expect to have with a laboratory or response team. First, what was the sample and how good was the run? Second, what genome or region was recovered? Third, what classification or phylogenetic placement is supported? Fourth, what caveats should travel with the result?

What belongs in the final report

A final public-health genomics report should be concise but not thin. It should include the dataset, tools and versions, reference used, masking threshold, coverage summary, lineage or genotype result, mutation highlights where relevant, and a short interpretation paragraph. The report should also say what was not resolved.

This is where automated outputs and human judgment meet. MultiQC can help reveal batch effects, Nextclade can organize quality flags and mutation calls, Pangolin can support SARS-CoV-2 lineage assignment, and tree-building tools can provide context. None of those outputs should replace the analyst's explanation.

  • Start with QC and sample status before biological interpretation.
  • Include versioned tool names and reference accessions.
  • State whether the result is complete genome, partial genome, VP1-only, or target-region limited.
  • Link interpretation to coverage and metadata rather than to a tree alone.

References and Further Reading

  1. ARTIC Network: pathogen genomics from sample to response
  2. Nextclade documentation
  3. Pangolin SARS-CoV-2 lineage assignment software
  4. MultiQC: summarize analysis results for multiple tools and samples
  5. IQ-TREE 2: new models and efficient methods for phylogenetic inference