nf-core/abotyper
A pipeline for characterising the Human Blood Group and Red Cell Antigens using Oxford Nanopore third-generation sequencing data.
ABO blood typing using Oxford Nanopore MinION sequencing
nf-core/abotyper is a bioinformatics pipeline that analyses data obtained from Third Generation Sequencing of the Homo sapiens ABO, alpha 1-3-N-acetylgalactosaminyltransferase and alpha 1-3-galactosyltransferase (ABO) gene to deduce the ABO blood type.
It takes a samplesheet and FASTQ files as input, performs quality control (QC), mapping to the reference sequences, variant characterisation, and finally deduce the Blood Group Statistics based on known ABO-related Single nucleotide variants (SVNs).
Research use only. This pipeline has not been validated for clinical diagnosis or transfusion decisions. Results must be confirmed by an accredited method before any clinical use. See the intended use statement.

ABO sequences were acquired from the NCBI RefSeq and dbRBC databases:
- ABO RefSeqGene (NG_006669.2) - single combined reference used for alignment
- dbMHC and IHWG data
Pipeline steps
If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with -profile test before running the workflow on actual data.
- Read quality control - Quality assessment of the long-read input FASTQ files using NanoPlot (
NANOPLOT) - Read alignment - Align reads to a single combined ABO reference (NG_006669.2) using Minimap2 (
MINIMAP2_ALIGN) - Alignment statistics - Generate comprehensive alignment metrics including coverage, flagstat, and detailed statistics:
- Coverage analysis (
SAMTOOLS_COVERAGE) - Flagstat metrics (
SAMTOOLS_FLAGSTAT) - Detailed statistics (
SAMTOOLS_STATS)
- Coverage analysis (
- Variant calling - Call small variants (with phasing) directly from the aligned BAM using Clair3 (
CLAIR3) - Variant quantification - Convert Clair3βs gVCF and phased VCF into per-position allele frequencies and per-read-equivalent haplotypes (
ABO_CLAIR2METRICS,ABO_CLAIR2HAPLOTYPES) - Independent BAM pileup - Count bases at every panel position directly from the aligned BAM, as a second line of evidence (
ABO_PILEUP) - Evidence combination - Compare Clair3 and the BAM pileup at every panel position, fill positions Clair3 had no evidence for, and flag disagreement (
ABO_EVIDENCE) - SNP extraction - Extract and analyze ABO-relevant single nucleotide variants using the panel-driven coordinate system (
ABO_GETABOSNPS) - Phenotype prediction - Predict ABO blood group phenotype from combined SNP and haplotype patterns, with ISBT-style allele names and QC flags (
ABO_SNPS2PHENO) - Quality control reporting - Compile a QC report with read, alignment and evidence metrics (
MULTIQC)
The pipeline uses NG_006669.2 (RefSeqGene, LRG_792) as a single combined ABO reference. Variant marker positions and coordinate calibration are defined in assets/refs/abo_variant_panel.yaml (see bin/README.md for details).
Summary of tools and version used in the pipeline
The pipeline makes use of the following core dependencies:
| Dependency | Minimum version | Used for |
|---|---|---|
| Core Tools | ||
| nanoplot | 1.48.0 | long-read quality control |
| minimap2 | 2.30 | long-read alignment |
| samtools | 1.23 | BAM sort, index, alignment QC |
| clair3 | 2.0.0 | variant calling, phasing |
| bcftools | 1.23.1 | VCF normalize, filter (QC export) |
| multiqc | 1.35 | aggregate QC report |
| Python Environment | ||
| python | 3.13.5 | runtime for bin/ scripts |
| pandas | 2.3.1 | tabular data handling |
| pyyaml | 6.0 | variant panel YAML parsing |
| xlsxwriter | 3.2.5 | final Excel report output |
bin/rename_samples.py is a standalone lab-export utility, not wired into any pipeline process β if you run it manually it needs its own pandas + numpy environment, separate from the above.
Required input files structure
Ensure that all input fastq files have a naming convention that matches this regular expression (regex)
## python regex for matching samplespattern = r"^[A-Z0-9]+(-[A-Z0-9]+){0,2}_barcode\d+$"The regex does the following:
^[A-Z0-9]+allows a sample name that starts with any combination of lettersA-to-Zand digits0-to-9(matching is case-insensitive).(-[A-Z0-9]+){0,2}handles up to two optional segments of letters or digits separated by a dash(-)._barcode\d+$ensures the filename ends with_barcode followed by digits to denote barcode numbers.
There is a file handling logic in the code filename.split("_") that assumes the barcode is always the last part of the filename.
The names are split into basename and barcode which are then used in later reporting.Please Adjust this if necessary based on actual filename structure in your assays.
Here are a few examples of acceptable input file names:
POSCTRL_barcode13.fastqNEGCTRL_barcode12.fastqCONTROLPOS_barcode19.fastq2025705_barcode14.fastqSample-45-44874_barcode25.fastqSample1-2024-12345_barcode22.fastqSequencing platform compatibility
This pipeline was originally developed to process amplicon sequencing data from Oxford Nanopore Technologies platforms where multiple samples are expected to be barcoded. The pipeline has been extensively validated using Oxford Nanopore MinION data targeting ABO exons 6 and 7, which are the primary regions containing clinically relevant polymorphisms for ABO blood group determination.
While we recommend using the above naming convention for optimal compatibility, the pipeline can also handle FASTQ files from other sequencing platforms including:
- PacBio (currently undergoing testing)
- Ion Torrent (currently undergoing testing)
- Illumina (currently undergoing testing)
The pipeline will attempt to extract the sample name and barcode from the filenames using standard genomic sequence naming conventions, but will fall back to a default barcode00 if filenames lack the expected barcode format. For non-Nanopore platforms, ensure your FASTQ files contain reads spanning the ABO exon 6 and exon 7 regions (within the combined NG_006669.2 reference) for accurate genotyping.
Running nf-core/abotyper
This pipeline has been extensively tested using conda, docker, and singularity profiles. Other containerisation methods are being improved,tested and documented. It is adisable to run a minimal test run to check your environment before submitting big jobs.
To run this pipeline, use:
# Quick testnextflow run nf-core-abotyper/main.nf --outdir test_working -profile test,conda -resume
# Complete runnextflow nf-core/abotyper \ -resume \ -profile <docker/singularity/.../institute> \ --input samplesheet.csv \ --outdir <OUTDIR>Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters; see docs.
The code by permits renaming of samples using a tab-delimited file with sequencingID and sampleName (see nextflow.config file under $params.renaming_file).
This option is controlled by the parameter $params.skip_renaming and can be overridden via the commandline using option --skip_renaming true to skip the process.
Output
For each sample, the pipeline aligns reads once against a single combined ABO reference (NG_006669.2, 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.htmlABO_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.
Credits
nf-core/abotyper was originally written by Fredrick M. Mobegi: @fmobegi at the Department of Clinical Immunology, PathWest Laboratory Medicine WA.
We thank the following people for their extensive assistance in the development and testing of this pipeline:
Maintenance and future developements will be led by Fredrick Mobegi.
Acknowledgements
Contributions and Support
If you would like to contribute to this pipeline, please see the contributing guidelines.
For further information or help, donβt hesitate to get in touch on the Slack #abotyper channel (you can join with this invite).
Further reading
Results generated from this pipeline should be interpreted together with the corresponding publication and literature on ABO genotyping.
To get up to speed with ABO genotyping, there is detailed reading material here.
Verified SNVs relevant to ABO blood group genotyping have also been documented extensively here
Citations
If you use nf-core/abotyper for your analysis, please cite it using the following publication:
Characterisation of the ABO Blood Group Phenotypes Using Third-Generation Sequencing.
Fredrick M. Mobegi, Samuel Bruce, Naser El-Lagta, Felipe Ayora, Benedict M. Matern, Mathijs Groeneweg, Lloyd J. DβOrsogna & Dianne De Santis.
Int. J. Mol. Sci. 2025 Jun 06. doi: 10.3390/ijms26125443.
An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.
You can cite the nf-core publication as follows:
The nf-core framework for community-curated bioinformatics pipelines.
Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.
Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.
Int. J. Mol. Sci. 2025 Jun 06. doi: 10.3390/ijms26125443.
An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.
You can cite the nf-core publication as follows:
The nf-core framework for community-curated bioinformatics pipelines.
Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.
Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.
