Metadata-Version: 2.5
Name: genoabo
Version: 0.2.0
Summary: Genetically determined ABO blood group inference from genotype datasets
Project-URL: Homepage, https://github.com/cloufield/genoABO
Project-URL: Repository, https://github.com/cloufield/genoABO
Author: Yunye He
License-Expression: MIT
License-File: LICENSE
Keywords: ABO,GWAS,biobank,bioinformatics,blood-group,genotype
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.11
Requires-Dist: bgen-reader>=4.0
Requires-Dist: cyvcf2>=0.30
Requires-Dist: numpy>=1.24
Requires-Dist: pgenlib>=0.94
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.9
Provides-Extra: bgenix
Requires-Dist: bgenix>=1.1; extra == 'bgenix'
Provides-Extra: dev
Requires-Dist: mypy>=1.5; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: zensical; extra == 'docs'
Description-Content-Type: text/markdown

# genoABO

**genoABO** infers genetically determined ABO blood group from VCF, BGEN, PGEN, and PLINK genotype datasets.

```bash
pip install genoabo
genoabo biobank.pgen --out bloodgroup
```

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

## Quick start

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

See [docs/workflow.md](docs/workflow.md) for the full load-to-output pipeline.

See [examples/](examples/) for VCF (unphased and phased), PGEN, and PLINK1 demos across builds and marker notations, a 1000 Genomes EAS four-marker example (phased `--phase auto`, or forced unphased), a multi-ancestry `--assume-bo` check against phased 1KG AFR/AMR/EAS/EUR, and marker LD r².

Inspect markers without calling:

```bash
genoabo cohort.pgen --inspect
```

## Supported 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 |

## Methods

```bash
genoabo --methods
genoabo --method-info three-marker
genoabo data.pgen --method auto        # default
genoabo data.pgen --method common
genoabo data.pgen --method three-marker
genoabo data.pgen --method ukb
genoabo data.pgen --method extended
```

| Method | Markers | Use case |
|--------|---------|----------|
| `common` | rs8176719, rs8176746 | Standard 2-marker inference |
| `three-marker` | + rs8176747 | East Asian / extra B check |
| `ukb` | rs8176719, rs8176746, rs505922 | UK Biobank Field 23165 style |
| `extended` | ISBT YAML (v0.1: A.01, B.01, O.01) | Experimental allele matching |

## Options

```text
--format auto|vcf|bcf|bgen|pgen|plink1
--build auto|hg19|hg38|chm13
--geno-mode auto|hardcall|dosage|probability
--phase auto|phased|unphased
--assume-bo / --no-assume-bo
--min-genotype-prob 0.90
--dosage-hardcall-threshold 0.1
--strict-method
--inspect
--report PATH.html
```

## Python API

```python
from genoabo import ABOCaller

caller = ABOCaller(method="auto", build="auto")
result = caller.call("ukb.pgen")
for call in result.calls:
    print(call.sample.iid, call.abo_group, call.abo_genotype)
```

## Genome builds

GRCh37/hg19, GRCh38/hg38, and T2T-CHM13v2 are supported. Build auto-detection uses marker coordinates, VCF header metadata, and chromosome lengths. Conflicting evidence returns an error requiring explicit `--build`.

## Citations

Full records are printed by `genoabo --method-info NAME` and in the Citations section of each HTML run report.

- **software** — Yunye He. genoABO: genetically determined ABO blood group inference from genotype datasets. Version 0.2.0. 2026. [https://github.com/cloufield/genoABO](https://github.com/cloufield/genoABO).
- **common** — Melzer D, Perry JRB, Hernandez D, Corsi AM, Stevens K, Rafferty I, et al. A genome-wide association study identifies protein quantitative trait loci (pQTLs). *PLoS Genet*. 2008;4:e1000072. [DOI: 10.1371/journal.pgen.1000072](https://doi.org/10.1371/journal.pgen.1000072). PMID: [18464913](https://pubmed.ncbi.nlm.nih.gov/18464913/).
- **three-marker** — Fry AE, Griffiths MJ, Auburn S, Diakite M, Forton JT, Green A, et al. Common variation in the ABO glycosyltransferase is associated with susceptibility to severe *Plasmodium falciparum* malaria. *Hum Mol Genet*. 2008;17:567–576. [DOI: 10.1093/hmg/ddm331](https://doi.org/10.1093/hmg/ddm331). PMID: [18003641](https://pubmed.ncbi.nlm.nih.gov/18003641/).
- **ukb** — UK Biobank. Data-Field 23165: Blood-type haplotype. [https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=23165](https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=23165).
- **extended** — Daniels GL, Fletcher A, Garratty G, Henry S, Jørgensen J, Judd WJ, et al. Blood group terminology 2004: from the International Society of Blood Transfusion committee on terminology for red cell surface antigens. *Vox Sang*. 2004;87:304–316. [DOI: 10.1111/j.1423-0410.2004.00564.x](https://doi.org/10.1111/j.1423-0410.2004.00564.x). PMID: [15585029](https://pubmed.ncbi.nlm.nih.gov/15585029/).

See [Inference methods](docs/methods.md) for used-in and molecular-basis notes.

## Documentation

Preview the docs site locally:

```bash
pip install -e ".[docs]"
./serve.sh           # http://127.0.0.1:8000
zensical build       # writes ./site/
```

- [Inference methods](docs/methods.md)
- [Marker coordinates](docs/markers.md) (includes 1000 Genomes LD r²)
- [Assumptions and limitations](docs/assumptions.md)
- [Examples](examples/)
- [Update Log](docs/updatelog.md)

## License

MIT — see [LICENSE](LICENSE).
