Skip to content

Usage

Run genoABO from the command line or Python, then inspect the outputs. See Assumptions and limitations before interpreting the calls.

Install

pip install genoabo

Quick start

Run this from the repository root with the bundled synthetic VCF. See Outputs for the files it writes.

genoabo examples/data/hg38/cohort.vcf --build hg38 --method three-marker --out abo

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

See Method selection for the automatic order and strict-mode behavior, and Double-heterozygote resolution for the --assume-bo rule.

Genotype and phase options

--geno-mode auto uses the first available valid source in this order: GP, DS, then GT. GP and DS can be used when GT is absent or missing. They replace GT and its phase. A valid but low-confidence value remains uncertain.

--phase auto and --phase phased use phase when the sample's contributing markers support it. VCF heterozygotes must share the same phase set if either has a PS value. Samples with insufficient phase evidence use copy counts, as do all samples with --phase unphased. The run summary shows mixed when both modes are used.

Genome build

--build auto uses marker coordinates and VCF ##reference= / similar header tokens when present; conflicting evidence is an error and requires explicit --build. See build detection in the pipeline for the evidence the caller uses.

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 + optional .sample Unphased diploid genotype probabilities

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)

Per-sample 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 genoABO diplotype code inspired by UK Biobank Field 23165 (ukb method only)
isbt_alleles Legacy column reserved for subtype calls. Current runs write NA

QC TSV

.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.

Summary and HTML report

The plain-text summary lists marker availability and cohort counts. The HTML report adds charts, run settings, a column dictionary, method rules, citations, and limitations. See the synthetic cohort report for an example.

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)

To inspect markers, pass inspect_only=True. To write an HTML report after inference, pass the full call result to write_report().

from genoabo.visualize import write_report

inspection = caller.call("ukb.pgen", inspect_only=True)
print(inspection.build, inspection.method, inspection.inspect)
write_report(result, "abo.report.html")

See also