Python library that turns scripts into interactive web apps for data dashboards, reports and chat apps.
arvkevi/ezancestry
Python tool that predicts a person's genetic ancestry from direct-to-consumer SNP data by comparing it against 1000 Genomes samples.
- Stars
- 70
- Forks
- 10
- Open issues
- 7
- Last commit
- last month
What is it?
ezancestry predicts genetic ancestry from raw direct-to-consumer genetic files such as 23andMe and ancestry.com output, as well as VCF files. It places a user's genotypes alongside more than 2,500 samples from the 1000 Genomes Project and uses a k-nearest neighbors classifier trained on ancestry-informative SNPs (AISNPs) to assign continental and regional population labels.
The package ships with pretrained models for two published AISNP panels: a 55-SNP set from Kidd et al. and a 128-SNP set from Kosoy et al. (Seldin lab). Predictions can be made at the superpopulation or population level, with optional PCA-based dimensionality reduction.
A command-line interface provides fetch, predict, plot and train commands, and a Python API is available. Users can also supply a custom list of AISNPs and train new models to evaluate how well that panel separates ancestry groups, with cross-validation reports. A Streamlit app and a 3D scatter plot are provided for visualization.
Key features
- 01Predicts ancestry from 23andMe, ancestry.com and VCF files
- 02Compares user samples against 2,500+ 1000 Genomes samples
- 03Ships pretrained k-NN models for Kidd (55 SNPs) and Seldin (128 SNPs) panels
- 04Supports superpopulation and population-level predictions
- 05Lets users train models on a custom set of AISNPs with cross-validation reports
- 06Includes a 3D plot command and a Streamlit app for visualization
Use cases
- Visualizing a direct-to-consumer genetic test result next to reference populations
- Evaluating how well a custom panel of ancestry-informative SNPs separates populations
- Teaching or demonstrating ancestry inference with 1000 Genomes data
- Batch-predicting ancestry for a cohort of genotype files
Quick start
- 1
Install ezancestry with pip
pip install ezancestry - 2
Predict ancestry from your direct-to-consumer genetic data file
ezancestry predict mygenome.txt - 3
Visualize the predictions in a 3D scatter plot in your browser
ezancestry plot predictions.csv
Things to know
- Predictions rely on only a small set of ancestry-informative SNPs compared against 1000 Genomes samples, so results are approximate.
- Not intended for medical or clinical decisions; it is a research and exploration tool.
In collections
Topics
FAQ
- What is ezancestry?
- Python tool that predicts a person's genetic ancestry from direct-to-consumer SNP data by comparing it against 1000 Genomes samples. ezancestry predicts genetic ancestry from raw direct-to-consumer genetic files such as 23andMe and ancestry.com output, as well as VCF files. It places a user's genotypes alongside more than 2,500 samples from the 1000 Genomes Project and uses a k-nearest neighbors classifier trained on ancestry-informative SNPs (AISNPs) to assign continental and regional population labels.
- Is ezancestry free to use? What license does it have?
- ezancestry is open source under the MIT license. Check the license terms before using it in commercial products.
- Is ezancestry still maintained?
- Updated within 6 months. The last commit to ezancestry was on Oct 7, 2026.
- What can I use ezancestry for?
- Visualizing a direct-to-consumer genetic test result next to reference populations Evaluating how well a custom panel of ancestry-informative SNPs separates populations Teaching or demonstrating ancestry inference with 1000 Genomes data Batch-predicting ancestry for a cohort of genotype files
- How do I install ezancestry?
- Install ezancestry with pip: pip install ezancestry Predict ancestry from your direct-to-consumer genetic data file: ezancestry predict mygenome.txt Visualize the predictions in a 3D scatter plot in your browser: ezancestry plot predictions.csv
- Where can I get ezancestry?
- The source code and installation instructions are on GitHub: https://github.com/arvkevi/ezancestry
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A deep learning variant caller that identifies genetic variants from aligned next-generation DNA sequencing reads and outputs VCF/gVCF files.
A bioinformatics-native AI agent skill library where each skill is a runnable, reproducible analysis for genomics tasks, built on OpenClaw.
A toolkit of healthcare and life sciences reference agents, reusable domain skills, and MCP tools for AI coding assistants and AWS deployments.
Python library for UMAP, a non-linear dimension reduction method used for visualization and as a preprocessing step for machine learning.
Python framework for building interactive data apps and dashboards in pure Python, without writing JavaScript.