tooluniverse-population-genetics

Analyze allele frequencies, Hardy-Weinberg equilibrium, Fst, and GWAS associations across populations.

1.7k|254|Updated Mar 3, 2025
One-click install
npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-population-genetics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tooluniverse-population-genetics
Source: https://github.com/mims-harvard/ToolUniverse/tree/main/plugins/tooluniverse/skills/tooluniverse-population-genetics
Command: npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-population-genetics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Population genetics questions require looking up real allele frequencies and computing statistics like HWE chi-square, Fst, and inbreeding coefficients rather than guessing. This Skill combines ToolUniverse database tools (gnomAD, 1000 Genomes, GWAS Catalog, ClinVar, Ensembl VEP) with a bundled Python calculator to produce computed, evidence-backed answers for variant and population-level analyses.

Core Features & Use Cases

  • Allele Frequency Lookup: Query gnomAD and 1000 Genomes for cross-population variant frequencies, resolving rsIDs to variant IDs and comparing ancestry groups.
  • Population Genetics Computation: Run Hardy-Weinberg equilibrium tests, Weir-Cockerham Fst, inbreeding coefficients, and haplotype diversity estimates via PopGen tools or the fallback popgen_calculator.py script.
  • Variant Interpretation: Assess pathogenicity using ClinVar, VEP consequences, CADD scores, gene constraint metrics (pLI, LOEUF), and GWAS associations.
  • Use Case: Given a question about whether a SNP deviates from HWE in a sample of 175 genotypes, run the HWE chi-square test, get the p-value, and interpret heterozygote excess or deficit with biological reasoning.

Quick Start

Ask the agent to look up the allele frequencies of a variant like rs429358 across gnomAD populations and test whether the observed genotype counts are in Hardy-Weinberg equilibrium.

Frequently Asked Questions about tooluniverse-population-genetics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I look up allele frequencies for a variant across populations?

Resolve the rsID to a variant_id using gnomad_search_variants, then call gnomad_get_variant with dataset gnomad_r4 for population frequencies. Use MyVariant_query_variants for 1000 Genomes population breakdowns.

How do I test Hardy-Weinberg equilibrium from genotype counts?

Use the PopGen_hwe_test tool with observed AA, Aa, and aa counts to get a chi-square statistic and p-value. If the tool is unavailable, run popgen_calculator.py with --type hwe and the same genotype counts.

How do I calculate Fst between two populations?

Use the PopGen_fst tool with allele frequencies and sample sizes for both populations, or run popgen_calculator.py --type fst --p1 --p2 --n1 --n2. Values below 0.05 indicate little differentiation; above 0.25 indicates very great differentiation.

Why does gwas_search_associations fail when I pass a gene name?

gwas_search_associations only accepts disease or trait names, not gene symbols. For gene-based GWAS lookups, use gwas_get_snps_for_gene instead, which returns all GWAS SNPs associated with a gene.

What do pLI and LOEUF scores mean for gene constraint?

pLI above 0.9 indicates a haploinsufficient gene intolerant of loss-of-function variants. LOEUF below 0.35 marks highly constrained genes. Both are retrieved with gnomad_get_gene_constraints using a gene symbol.

What are the limitations of the popgen_calculator.py script?

The script implements a simplified Weir-Cockerham Fst for two populations and approximates chi-square p-values via the incomplete gamma function. Haplotype diversity estimates are heuristic, so ToolUniverse PopGen tools are preferred when available.