Skip to main content

genoselect

scikit-learn-compatible genomic prediction and selection from SNP marker data.

PyPI Python Downloads tests License: MIT DOI

Genomic selection is dominated by R packages (rrBLUP, BGLR, sommer). genoselect brings a clean, Pythonic, scikit-learn-compatible toolkit to the same problem: fit, cross-validate, and benchmark genomic-prediction models from 0/1/2 marker matrices, with a properly implemented GBLUP by REML at its core.

Features

  • VanRaden genomic relationship matrix [vanraden_grm].
  • GBLUP by REML — the Endelman (2011) spectral method, with equivalent ridge-regression marker effects for out-of-sample prediction (GBLUP).
  • A common model interface — GBLUP, elastic net, random forest, gradient boosting, and a stacked super-learner ensemble, all as scikit-learn estimators (make_model, available_models).
  • Breeding-relevant cross-validation — k-fold and leave-group-out, reporting predictive ability honestly (cross_validate, benchmark).
  • GWAS — single-marker association (gwas) with PC structure correction, plus position-aware manhattan and qq_plot helpers.
  • Read your own data — read_vcf, read_plink, read_hapmap load VCF / PLINK / HapMap files into 0/1/2 matrices (pure-Python, no extra deps).
  • Simulation and QC — simulate_population, qc_markers, impute_markers.

Install

pip install genoselect

Or from source:

git clone https://github.com/mqfarooqi1/genoselect
cd genoselect && pip install -e .

Quick start

import genoselect as gs

# simulate a population with a heritable trait
pop = gs.simulate_population(n=250, m=800, n_qtl=40, h2=0.5, seed=1)

# fit GBLUP and inspect heritability + breeding values
fit = gs.GBLUP().fit(pop.geno, pop.pheno)
print(fit.h2_)            # estimated genomic heritability
print(fit.gebv_[:5])      # genomic estimated breeding values

# predict new genotypes
pred = fit.predict(pop.geno[:10])

# benchmark several models by cross-validation
cv = gs.benchmark(pop.geno, pop.pheno, k=5, random_state=1)
print(cv.summary())

Load your own data instead of simulating:

gd = gs.read_vcf("genotypes.vcf.gz")     # or read_plink("data"), read_hapmap("data.hmp.txt")
fit = gs.GBLUP().fit(gd.geno, phenotypes)

Because the estimators follow the scikit-learn API, they compose with the wider ecosystem (Pipeline, GridSearchCV, cross_val_score, …).

Methods

The genomic relationship matrix follows VanRaden (2008, doi:10.3168/jds.2007-0980); the mixed-model solver follows Endelman (2011, doi:10.3835/plantgenome2011.08.0024); the genomic-selection framework follows Meuwissen, Hayes & Goddard (2001, doi:10.1093/genetics/157.4.1819).

Tests

pip install -e ".[test]"
pytest

Author: Muhammad Farooqi · MIT licensed. A Python companion to the R package GSbench.

Metadata

Release files for genoselect 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genoselect 0.3.1
File Size Uploaded Provenance Actions
genoselect-0.3.1.tar.gz 492.7 kB Without provenance Details for genoselect-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genoselect 0.3.1
File Interpreter ABI Platform Actions
genoselect-0.3.1-py3-none-any.whl Python 3 none any Details for genoselect-0.3.1-py3-none-any.whl

Total release size: 510.0 kB

Release files / genoselect-0.3.1.tar.gz

Download URL genoselect-0.3.1.tar.gz
Size 492.7 kB
Tags Source
SHA-256 checksum
How to use checksums
87fd8e5bf54d5d5bf23ec6884e9482061914ba0f9008244a44e5e0e04296e776
BLAKE2b-256 checksum
How to use checksums
ce2aee1644ff036231d9860112de0fa3d8366c9678eeb410b0a510ecb6b22a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / genoselect-0.3.1-py3-none-any.whl

Download URL genoselect-0.3.1-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60c1752ccf6be8484a366d69b91fae5b77a106220fad5b8d0e640de626496de0
BLAKE2b-256 checksum
How to use checksums
d80d3f47fea0ae61e1c18a48edd6122120b4085f4b8e326eb836e2703d30d075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for genoselect 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page