Examples¶
18-sample synthetic cohorts demonstrating determined ABO calls, missing markers, undetermined/conflict cases, three genome builds, multiple marker notations, and phased VCF, plus a real 1000 Genomes EAS extract, a multi-ancestry --assume-bo check, and marker LD r².
Research use only
These examples are for software demos, not clinical typing.
Unit-test fixtures under tests/fixtures/synthetic/ remain a separate clean 6-sample set.
Prerequisites¶
# from repository root
pip install -e .
# regenerate synthetic data after editing generate_cohort.py:
python examples/generate_cohort.py
Layout¶
examples/data/
expected_calls.txt
hg38/ # GRCh38 — VCF/PGEN/PLINK1 + notation VCFs
hg19/ # GRCh37
chm13/ # CHM13v2
1kg_eas/ # 1000 Genomes 30x EAS four-marker extract (hg38)
1kg_ld/ # pairwise haplotype r² among the four ABO tag SNPs
Run all demos¶
Outputs land in examples/out/ (TSV + HTML run report: results, output, input, methods, citations, limitations, and marker determination).
| Page | What it covers |
|---|---|
| Synthetic cohort | Formats (VCF, PGEN, PLINK1), builds (hg19/hg38/chm13), phased VCF, marker notations |
| 1000 Genomes EAS | Real 504-sample four-marker extract, --phase auto vs --phase unphased |
1000 Genomes --assume-bo |
Phased AFR/AMR/EAS/EUR vs unphased --assume-bo (cis/trans, not serology) |
| Marker LD r² | Pairwise haplotype r² for the four tag SNPs in AFR/AMR/EAS/EUR |
Committed HTML snapshots of those two flagship runs:
Regenerate after changing the report renderer:
Equivalent CLI¶
genoabo examples/data/hg38/cohort.pgen \
--build hg38 --method three-marker \
-o examples/out/pgen_hg38
# writes pgen_hg38.abo.tsv, .qc.tsv, .summary.txt, .report.html
Python API¶
from genoabo import ABOCaller
from genoabo.visualize import write_report
result = ABOCaller(method="three-marker", build="hg38").call(
"examples/data/hg38/cohort.vcf"
)
write_report(result, "examples/out/api.report.html")
print(result.stats.n_input_samples, result.stats.n_ambiguous, result.stats.n_unknown)
BGEN is supported by genoABO but not bundled in these examples.