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
β”‚ β”œβ”€β”€ combined
β”‚ β”œβ”€β”€ 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
  • Minimap2 – Mapping reads to the combined ABO reference
  • SAMtools Coverage – Coverage metrics
  • SAMtools Flagstat – Alignment summary statistics
  • SAMtools Stats – Detailed alignment metrics
  • Clair3 – Small-variant calling and phasing, converted into per-position nucleotide frequencies and a haplotype table
  • ABO SNP Interpretation – Custom logic to infer ABO phenotype
  • 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.

Minimap2

Output files
  • alignment/
    • *.bam: Aligned reads in BAM format.
    • *.bai: BAM index files.

Minimap2 is used to align Nanopore reads to the single combined ABO reference FASTA. It supports long-read data and is optimized for speed and accuracy.

SAMtools Modules

This set of modules use SAMtools and its subtools to extract key metrics and data from aligned BAM files. These outputs are used for quality control and coverage analysis.

Output subtool files
  • coverage/
    • *.coverage.txt: Coverage metrics per sample.
  • flagstat/
    • *.flagstat.txt: Summary of alignment flags.
  • stats/
    • *.stats.txt: Detailed alignment statistics.

Coverage: Calculates per-base and overall coverage statistics to assess sequencing depth and uniformity.

Flagstat: Provides a quick summary of alignment quality, including total reads, mapped reads, duplicates, and other key metrics.

Stats: Generates comprehensive metrics such as insert size distributions, read lengths, and mapping quality.

Variant Calling and Quantification

Output files
  • clair3/
    • *.merge_output.vcf.gz: Clair3’s PASS-filtered small-variant calls.
    • *.merge_output.gvcf.gz: Clair3’s gVCF, including non-variant reference blocks.
    • *.phased_merge_output.vcf.gz: Clair3’s phased small-variant calls (GT + PS tags).
    • *.panel.vcf.gz / *.panel..tsv: normalized calls restricted to the ABO panel positions, and a flat TSV of the same, for manual review (VARIANTS_QC).
  • clair2metrics/
    • *.AlignmentStatistics.tsv: Per-position nucleotide frequency and coverage table, converted from Clair3’s gVCF.
    • *.Haplotypes.tsv: Haplotype table, synthesized from Clair3’s phased-VCF phase-set allele depths (not literal per-read observations).

Clair3 (--gvcf --enable_phasing) calls small variants directly from the aligned BAM, with phasing. clair2metrics.py (the ABO_CLAIR2METRICS module) and clair2haplotypes.py (the ABO_CLAIR2HAPLOTYPES module) then convert its gVCF and phased VCF into per-position nucleotide frequencies and a haplotype table respectively, in the same formats the retired BAM-pileup-based HAPLOSCAN module used to produce, so downstream phenotype prediction needs no changes.

ABO SNP Interpretation

Output files
  • phenotype/
    • *.snp_summary.txt: Summary of ABO-related SNPs.
    • *.phenotype.txt: Predicted ABO phenotype per sample.

This custom module interprets SNP data to infer ABO blood group phenotypes using curated reference profiles and decision rules.

MultiQC

Output files
  • 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, SAMtools, and other modules, 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.html, execution_timeline.html, execution_trace.txt and pipeline_dag.dot/pipeline_dag.svg.
    • Reports generated by the pipeline: pipeline_report.html, pipeline_report.txt and software_versions.yml. The pipeline_report* files will only be present if the --email / --email_on_fail parameter’s are used when running the pipeline.
    • Reformatted samplesheet files used as input to the pipeline: samplesheet.valid.csv.
    • Parameters used by the pipeline run: params.json.

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.