Introduction

This document describes the output produced by the pipeline. Most of the plots are taken from the MultiQC report, which summarises results at the end of the pipeline.

The directories listed below will be created in the results directory after the pipeline has finished. All paths are relative to the top-level results directory.

For each sample, the pipeline aligns reads once against a single combined ABO reference (spanning exons 2–7) and generates BAM files, BAM metrics, and per-position variant statistics.

The output directory generated by this Nextflow pipeline will look something like this:

OUTDIR/
β”œβ”€β”€ ABO_result.xlsx
β”œβ”€β”€ ABO_result.txt
β”œβ”€β”€ ABO_results.log
β”œβ”€β”€ ABO_run_qc.txt
β”œβ”€β”€ ABO_evidence_summary_mqc.tsv
β”œβ”€β”€ final_export.csv
β”œβ”€β”€ per_sample_processing
β”‚ └── SAMPLE1_barcode01
β”‚ β”œβ”€β”€ alignment
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.bam
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.bam.bai
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.coverage.txt
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.flagstat
β”‚ β”‚ └── SAMPLE1_barcode01.stats
β”‚ β”œβ”€β”€ clair3
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01_clair3.merge_output.gvcf.gz
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01_clair3.merge_output.vcf.gz
β”‚ β”‚ └── SAMPLE1_barcode01_clair3.phased_merge_output.vcf.gz
β”‚ β”œβ”€β”€ clair2metrics
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.AlignmentStatistics.tsv
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.Haplotypes.tsv
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.concordance.tsv
β”‚ β”‚ β”œβ”€β”€ SAMPLE1_barcode01.evidence_status.tsv
β”‚ β”‚ └── SAMPLE1_barcode01.pileup_metrics.tsv
β”‚ β”œβ”€β”€ SAMPLE1_barcode01.ABOPhenotype.txt
β”‚ └── SAMPLE1_barcode01.log.txt
β”œβ”€β”€ pipeline_info
β”‚ β”œβ”€β”€ abo_variant_panel.bed
β”‚ β”œβ”€β”€ abotyper_software_mqc_versions.yml
β”‚ β”œβ”€β”€ execution_report_DATETIME.html
β”‚ β”œβ”€β”€ execution_timeline_DATETIME.html
β”‚ β”œβ”€β”€ execution_trace_DATETIME.txt
β”‚ β”œβ”€β”€ params_DATETIME.json
β”‚ └── pipeline_dag_DATETIME.html
└── qc_and_preprocessing
β”œβ”€β”€ nanoplot
β”‚ β”œβ”€β”€ SAMPLE1_barcode01_NanoPlot-report.html
β”‚ └── SAMPLE1_barcode01_NanoStats.txt
└── multiqc
β”œβ”€β”€ multiqc_data
β”œβ”€β”€ multiqc_plots
β”‚ β”œβ”€β”€ pdf
β”‚ β”œβ”€β”€ png
β”‚ └── svg
└── multiqc_report.html

ABO_result.xlsx has three sheets: Typing (one row per sample with read, mapping and depth metrics, the evidence source, the ISBT-style typing result, phenotype, genotype, the variants detected, a depth check and QC status), Variants (one column per panel position with the call and depth, for example A 50% (215x), ref (215x) or no data; the rare positions marked report: detected in the panel appear only when a sample carries them; the full pileup counts are in ABO_result.txt) and About (script, panel and ISBT-table versions and the research-use statement).

A summary of the ABO typing results is provided in final_export.csv

Feel free to raise an issue or reach out if you need any support getting this tool running, or with suggestions for improvement.

Pipeline overview

The pipeline is built using Nextflow and processes data using the following steps:

  • NanoPlot – Raw long-read quality control
  • Alignment and alignment statistics – minimap2 alignment to the ABO reference, with samtools coverage, flagstat and stats
  • Variant calling and evidence – Clair3 calls and phasing, the BAM pileup, and both converted into per-position evidence
  • ABO typing – Per-sample phenotype prediction and the run’s result tables (abotyper-core)
  • MultiQC – Aggregate report describing results and QC from the whole pipeline

NanoPlot

Output files
  • qc_and_preprocessing/nanoplot/
    • <sample>_NanoPlot-report.html: NanoPlot report with read length and quality distributions.
    • <sample>_NanoStats.txt: Summary statistics (number of reads, mean and median read length, N50, mean and median read quality).

NanoPlot (part of NanoPack) provides quality metrics designed for long reads, including the read length distribution, mean read quality, and the number of reads and bases. The NanoStats files are also read by MultiQC. Because the sequencing is an amplicon of the ABO gene, read lengths cluster around the amplicon size; a very different distribution, or few reads, points to a library or run problem before alignment. A sample with no reads (for example a clean negative control) has no NanoPlot report; it is still typed.

Alignment and alignment statistics

Output files
  • per_sample_processing/<sample>/alignment/
    • <sample>.bam and <sample>.bam.bai: reads aligned to NG_006669.2 with minimap2, and their index.
    • <sample>.coverage.txt: samtools coverage of the ABO reference (reads, covered bases, mean depth).
    • <sample>.flagstat: samtools flagstat summary (total, mapped, secondary and supplementary reads).
    • <sample>.stats: samtools stats (read lengths, mapping and base qualities, error rates).

minimap2 aligns the Nanopore reads to the single combined ABO reference (--minimap2_preset, map-ont by default). The samtools coverage, flagstat and stats files feed the read and depth metrics of the Typing sheet and the MultiQC report.

Variant calling and evidence

Output files
  • per_sample_processing/<sample>/clair3/
    • <sample>_clair3.merge_output.vcf.gz: Clair3’s PASS-filtered small-variant calls.
    • <sample>_clair3.merge_output.gvcf.gz: Clair3’s gVCF, including non-variant reference blocks.
    • <sample>_clair3.phased_merge_output.vcf.gz: Clair3’s phased small-variant calls (GT and PS tags).
    • <sample>_norm.vcf.gz: the Clair3 calls normalised with bcftools norm.
    • <sample>.panel.vcf.gz and <sample>.panel.tsv: the normalised calls restricted to the ABO panel positions, and a flat table of the same, for manual review.
    • Each .vcf.gz has a .tbi index.
  • per_sample_processing/<sample>/clair2metrics/
    • <sample>.AlignmentStatistics.tsv: per-position nucleotide frequencies and depth, from Clair3, with positions Clair3 had no evidence for filled from the BAM pileup.
    • <sample>.Haplotypes.tsv: haplotype table built from Clair3’s phased calls (phase-set allele depths, not per-read observations).
    • <sample>.pileup_metrics.tsv: the same per-position table from the BAM pileup alone.
    • <sample>.concordance.tsv: Clair3 and the BAM pileup compared at every panel position.
    • <sample>.evidence_status.tsv: the evidence source of the sample (Clair3 and BAM, Clair3 only, BAM only or none) and the number of positions that disagree.

Clair3 (--gvcf --enable_phasing, restricted to the ABO exon 2-7 region) calls small variants from the aligned BAM. abotyper-clair2metrics and abotyper-clair2haplotypes (modules ABOTYPERCORE_CLAIR2METRICS and ABOTYPERCORE_CLAIR2HAPLOTYPES) convert its gVCF and phased VCF into per-position frequencies and a haplotype table. An independent pileup of the BAM (nf-core samtools/mpileup) is the second line of evidence: abotyper-pileup2metrics (ABOTYPERCORE_PILEUP2METRICS) combines the two, fills positions Clair3 had no evidence for, and records where they disagree.

ABO typing

Output files
  • per_sample_processing/<sample>/
    • <sample>.ABOPhenotype.txt: the sample’s per-position calls and its predicted phenotype, genotype and allele names (abotyper-predict-phenotype, ABOTYPERCORE_PREDICTPHENOTYPE).
    • <sample>.log.txt: the log of that step.
  • The output directory itself (abotyper-aggregate, ABOTYPERCORE_AGGREGATE):
    • ABO_result.xlsx: the Typing, Variants and About sheets described above.
    • ABO_result.txt: one row per sample with the full per-position counts and the QC notes.
    • final_export.csv: the typing results for laboratory information systems.
    • ABO_run_qc.txt: run-level QC summary.
    • ABO_evidence_summary_mqc.tsv: per-sample evidence summary, also shown in the MultiQC report.
    • ABO_results.log: the log of the aggregation.

The typing steps come from the abotyper-core package. They score the panel positions against the panel’s thresholds, resolve phenotype, genotype and ISBT-style allele names (per haplotype when the Clair3 phasing is clean), and add the depth, evidence, control and replicate checks that decide each sample’s QC status (PASS or REVIEW).

MultiQC

Output files
  • qc_and_preprocessing/multiqc/
    • multiqc_report.html: A standalone HTML file that can be viewed in your web browser.
    • multiqc_data/: Directory containing parsed statistics from the different tools used in the pipeline.
    • multiqc_plots/: Directory containing static images from the report in various formats.

MultiQC aggregates results from NanoPlot and samtools, plus the per-sample ABO evidence summary table, into a single interactive report. It also includes software version tracking for reproducibility.

Pipeline information

Output files
  • pipeline_info/
    • Reports generated by Nextflow: execution_report_<date>.html, execution_timeline_<date>.html, execution_trace_<date>.txt and pipeline_dag_<date>.html.
    • Software versions of every step: abotyper_software_mqc_versions.yml.
    • Parameters used by the pipeline run: params_<date>.json.
    • The panel positions as a BED file: abo_variant_panel.bed.

Nextflow provides excellent functionality for generating various reports relevant to the running and execution of the pipeline. This will allow you to troubleshoot errors with the running of the pipeline, and also provide you with other information such as launch commands, run times and resource usage.