Skip to main content

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

Project description

genoselect

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

License: MIT Python

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).
  • Simulation and QCsimulate_population, qc_markers, impute_markers.

Install

pip install genoselect          # once published
# or, from source:
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())

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genoselect-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genoselect-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file genoselect-0.1.0.tar.gz.

File metadata

  • Download URL: genoselect-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for genoselect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00136fd4972e49e3b503ae30f5fdce1df4c69b8bb23b946a0d447064ed269ffe
MD5 06d5430c0ce14bdaba1018a7b532cb9a
BLAKE2b-256 a59fcc02571853851cce65c32f170f021650ed5ab2e4844c87ee88ff22cff1d0

See more details on using hashes here.

File details

Details for the file genoselect-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: genoselect-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for genoselect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e303a162273cb525c10650ca479d18ea2b0ea45c954f591abb5e0847d993395a
MD5 58a7b0e78991ac2afefa1c412edae973
BLAKE2b-256 9990c01de5c162c4b600442a0df39147e8a5f7b2d81d8156bc97db199472118b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page