Skip to content

Usage

Install genoABO and infer ABO blood group from a genotype file. For pipeline internals see Workflow; for haplotype rules see Inference methods.

Research use only

genoABO is intended for population-genetics, epidemiology, GWAS, PheWAS, and biobank research. Genotype-inferred ABO groups do not capture all rare, weak, cis-AB, structural, or otherwise atypical ABO alleles and must not be used for transfusion or clinical decision-making.

Install

pip install genoabo

Quick start

genoabo cohort.pgen --out abo
# writes: abo.abo.tsv, abo.qc.tsv, abo.summary.txt, abo.report.html

If --out is omitted, the prefix is the input path with its last suffix stripped (cohort.pgen → cohort; cohort.vcf.gz → cohort.vcf).

Command-line reference

genoabo DATA [options]
Flag Default Meaning
DATA required Input genotype file
-o / --out stem of DATA Output prefix
--format auto auto, vcf, bcf, bgen, pgen, or plink1
--build auto auto, hg19, hg38, or chm13
--method auto auto, common, three-marker, ukb, or extended
--geno-mode auto auto, hardcall, dosage, or probability
--phase auto auto, phased, or unphased
--assume-bo / --no-assume-bo bo on Unphased double-het (O_DEL/NON_O × A/B): assign B/O (default) or leave ambiguous
--min-genotype-prob 0.90 Minimum max(GP) for a probability hardcall
--dosage-hardcall-threshold 0.1 Dosage rounding window around 0 / 1 / 2
--strict-method off Error if a user-selected method's min_markers are missing, or if --method auto matches no entry. Does not fall back to another method
--inspect off Probe markers and recommended method; do not write calls
--methods — List methods (no data file)
--method-info NAME — Print citations for a method (no data file)
--report PREFIX.report.html HTML run report path

--method auto picks the first method whose required markers are present: three-marker (rs8176719, rs8176746, rs8176747) → common (rs8176719, rs8176746) → ukb (rs8176746, rs505922; proxy mode, confidence capped). extended is never auto-selected. --strict-method does not change that order and does not substitute a smaller method when you pass --method NAME; it only errors on missing min_markers (or on auto with no match). Without --strict-method, --method auto with no match still proceeds as common (samples then get MISSING_MARKER). See Inference methods.

Default --assume-bo applies the common-allele rule that the O deletion arose on an A background, so an unphased double heterozygote is taken as B/O. --no-assume-bo leaves those samples ambiguous. The flag has no effect when phase is used. On phased 1000 Genomes 30x GRCh38, unphased double-hets were B/O in AMR/EAS/EUR and 105/113 in AFR (8/113 were A/O). For unphased African-ancestry data, --no-assume-bo is recommended. See 1000 Genomes --assume-bo check.

--geno-mode auto uses GP, then DS, then hardcall GT (GP/DS replace leftover phased GT). --phase auto is cohort-wide: if any fetched genotype is phased, every sample is run in phased mode. --build auto uses marker coordinates and VCF ##reference= / similar header tokens when present; conflicting evidence is an error and requires explicit --build. Chromosome-length matching is implemented in detect_build but is not wired from the caller.

Inspect and method metadata

genoabo cohort.pgen --inspect
genoabo --methods
genoabo --method-info three-marker

--inspect reports which ABO tags were found, call rates, and the recommended method. --methods and --method-info do not require an input file.

Input formats

Format Extensions Notes
VCF/BCF .vcf, .vcf.gz, .bcf GT, phased GT, DS, GP
PLINK2 .pgen + .pvar + .psam Auto-locates companion files
PLINK1 .bed + .bim + .fam --format plink1
BGEN .bgen + .sample Dosage/probability support

GRCh37/hg19, GRCh38/hg38, and T2T-CHM13v2 are supported.

Outputs

A successful call writes four files:

File Contents
PREFIX.abo.tsv Per-sample ABO calls
PREFIX.qc.tsv Run-level QC metrics
PREFIX.summary.txt Human-readable summary
PREFIX.report.html HTML run report (--report overrides the path)

.abo.tsv columns:

Column Description
FID Family or cohort identifier from the input file
IID Individual sample identifier
ABO_group Inferred phenotype: A, B, AB, or O. Unassigned values are NA in the TSV (HTML reports may display unknown)
ABO_genotype Diplotype label (for example A/O), ambiguous, or NA
ABO_allele1 First haplotype allele after alphabetical sort (A < B < O)
ABO_allele2 Second haplotype allele after alphabetical sort
haplotype1 Chromosome copy 1 when phase_mode=phased; otherwise the same sorted allele as ABO_allele1 (not a chromosomal haplotype)
haplotype2 Chromosome copy 2 when phase_mode=phased; otherwise the same sorted allele as ABO_allele2
method Inference method used for this sample
geno_mode Requested genotype mode (hardcall, dosage, probability, or auto); not the resolved GP/DS/GT source
phase_mode Whether haplotypes used phase (phased) or copy-count rules (unphased)
build Genome assembly used for marker coordinates
confidence high, medium, low, or none (not a calibrated probability)
qc_status PASS, AMBIGUOUS, MISSING_MARKER, CONFLICT, or LOW_CONFIDENCE
qc_reason Free-text explanation of QC status
possible_diplotypes Compatible diplotypes when ABO_genotype is ambiguous
ukb_haplotype UK Biobank Field 23165 haplotype code (ukb method only)
isbt_alleles Matched ISBT allele IDs (extended method only)

See Workflow for how genotypes move from file load to these files.

.qc.tsv is a metric/value table. Besides sample counts and marker call rates it includes group counts (n_A, n_B, n_AB, n_O), n_unknown (no phenotype: TSV NA or unknown), n_ambiguous (ABO_genotype = ambiguous; those rows are also in n_unknown), n_low_confidence, and percentages.

Python API

ABOCaller constructor kwargs match the CLI. call() returns a CallerResult; iterate result.calls for per-sample fields.

from genoabo import ABOCaller

caller = ABOCaller(
    method="auto",
    build="auto",
    genotype_mode="auto",
    phase="auto",
    format="auto",
    dosage_threshold=0.1,
    min_genotype_prob=0.9,
    strict_method=False,
    assume_bo=True,
)
result = caller.call("ukb.pgen")
for call in result.calls:
    print(call.sample.iid, call.abo_group, call.abo_genotype)

Inspect without writing calls:

result = caller.call("ukb.pgen", inspect_only=True)
print(result.build, result.method, result.inspect)

See also