Metadata-Version: 2.4
Name: genoio
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Dist: numpy>=1.24
Requires-Dist: polars>=1.0
Requires-Dist: scipy>=1.10
Requires-Dist: maturin>=1.10,<2 ; extra == 'dev'
Requires-Dist: pre-commit>=3 ; extra == 'dev'
Requires-Dist: pytest>=8 ; extra == 'dev'
Requires-Dist: ruff>=0.5 ; extra == 'dev'
Requires-Dist: ty>=0.0.44 ; extra == 'dev'
Requires-Dist: mkdocstrings-python>=1.12 ; extra == 'docs'
Requires-Dist: zensical>=0.0.37 ; extra == 'docs'
Provides-Extra: dev
Provides-Extra: docs
License-File: LICENSE
Summary: Genotype IO tools for Python
Author: Mancuso Lab
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://mancusolab.github.io/genoio
Project-URL: Homepage, https://github.com/mancusolab/genoio
Project-URL: Issues, https://github.com/mancusolab/genoio/issues
Project-URL: Repository, https://github.com/mancusolab/genoio

# genoio

`genoio` reads VCF/BCF, PLINK1, PLINK2, and BGEN genotype sources into Python
matrices. The public API is Python; the file readers are Rust. This pairing
keeps the interface simple while moving parsing and matrix construction into
compiled, efficient code.

It is built for downstream genetics tools that need stable matrix contracts:
samples on rows, variants on columns, and metadata aligned to returned matrices,
blocks, or regions.

## Install

```bash
pip install git+https://github.com/mancusolab/genoio.git
```

From a local checkout:

```bash
pip install .
```

## Documentation

For complete documentation and examples, see the
[documentation site](https://mancusolab.github.io/genoio).

## Quick Example

```python
import genoio

ds = genoio.pfile("data/chr22_hg38")
samples = ds.samples()
y = load_phenotype_vector(samples["iid"])
C = load_covariates(samples["iid"])

for X, variants in ds.iter_blocks(10_000, return_variants=True):
    # X has shape (samples, variants_in_this_block).
    # `y` and `C` must be aligned to the rows described by `samples`.
    association_scan(X, y, C, variants=variants)
```

Use `read(...)` for one matrix, `iter_blocks(...)` for streaming scans, and
`iter_regions(...)` for interval-based workflows.

## License

MIT. See [LICENSE](LICENSE).

---

## Notes

`genoio` was developed by members of the Mancuso Lab with assistance from Codex,
following the practices described in the
[scientific-software-playbook](https://github.com/mancusolab/scientific-software-playbook)
and [coding-skills](https://github.com/mancusolab/coding-skills) repositories.

