bio-population-genetics-selection-statistics
Detect signatures of natural selection using Fst, Tajima's D, iHS, XP-EHH, and other selection statistics. Calculate population differentiation, test for departures from neutrality, and identify selective sweeps with scikit-allel and vcftools. Use when computing selection signatures like Fst or Tajima's D.
npx skills add majiayu000/claude-skill-registry --skill selection-statistics-gptomics-bioskills --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Selection Statistics Detect natural selection signatures using diversity statistics and extended haplotype homozygosity. ## Fst - Population Differentiation ### scikit-allel ```python import allel import numpy as np callset = allel.read_vcf('data.vcf.gz') gt = allel.GenotypeArray(callset['calldata/GT']) pos = callset['variants/POS'] subpops = {'pop1': [0, 1, 2, 3, 4], 'pop2': [5, 6, 7, 8, 9]} ac_subpops = gt.count_alleles_subpops(subpops) num, den = allel.hudson_fst(ac_subpops['pop1'], ac_subpops['pop2']) fst_per_snp = num / den print(f'Mean Fst: {np.nanmean(fst_per_snp):.4f}') ``` ### Windowed Fst ```python fst_windowed, windows, n_snps = allel.windowed_hudson_fst( pos, ac_subpops['pop1'], ac_subpops['pop2'], size=100000, step=50000) import matplotlib.pyplot as plt plt.figure(figsize=(14, 4)) plt.plot(windows[:, 0], fst_windowed) plt.xlabel('Position') plt.ylabel('Fst') plt.savefig('fst_windows.png') ``` ### vcftools ```bash # Calculate Fst between populations vcftools --vcf data.vcf --weir-fst-pop pop1.txt --weir-fst-pop pop2.txt --out fst_result # With window vcftools --vcf data.vcf --weir-fst-pop pop1.txt --weir-fst-pop pop2.txt \ --fst-window-size 100000 --fst-window-step 50
- Fst - Population Differentiation
- scikit-allel
- Windowed Fst
- vcftools
- Tajima's D - Departures from Neutrality
- Interpretation
- iHS - Integrated Haplotype Score
- Plot iHS
- XP-EHH - Cross-Population Extended Haplotype Homozygosity
- NSL - Number of Segregating Sites by Length
- Garud's H Statistics
- Composite Selection Score
- Complete Selection Scan
- Related Skills
Calculate Fst between populations vcftools --vcf data.vcf --weir-fst-pop pop1.txt --weir-fst-pop pop2.txt --out fst_result With window vcftools --vcf data.vcf --weir-fst-pop pop1.txt --weir-fst-pop pop2.txt \ vcftools --vcf data.vcf --TajimaD 100000 --out tajima
What does the bio-population-genetics-selection-statistics skill do?
Detect signatures of natural selection using Fst, Tajima's D, iHS, XP-EHH, and other selection statistics. Calculate population differentiation, test for departures from neutrality, and identify selective sweeps with scikit-allel and vcftools. Use when computing selection signatures like Fst or Tajima's D.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill selection-statistics-gptomics-bioskills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
