Skills

Claw Ancestry Pca

Ancestry decomposition PCA against the Simons Genome Diversity Project

Install

npx skills add ClawBio/ClawBio --skill claw-ancestry-pca -g -a claude-code -y
Repository
ClawBio/ClawBio1.2k
Category
Engineering
Updated
3d ago
License
MIT
Context cost
Lightabout 1,047 tokens
Runs scripts
Yes, review before use

What it does

Ancestry decomposition PCA against the Simons Genome Diversity Project

🦖 Ancestry Decomposition PCA

Place your study cohort in global genetic context by computing a joint PCA against the Simons Genome Diversity Project (SGDP), 345 samples from 164 populations spanning every inhabited continent.

What it does

  1. Takes your VCF + population map as input
  2. Finds common variants between your cohort and the SGDP reference panel (bundled)
  3. Runs PLINK PCA on the merged dataset
  4. Separates your cohort from SGDP reference samples
  5. Matches SGDP samples to their population labels (164 populations)
  6. Generates a publication-quality multi-panel figure:
    • Panel A: PC1 vs PC2, main population structure of your cohort
    • Panel B: PC3 vs PC2 with regional groupings and confidence ellipses
    • Panel C: PC3 vs PC1 with language/cultural groupings
    • Panel D: Global context, your samples (circles) vs SGDP (triangles)
  7. Produces a markdown report with variance explained, population assignments, and reproducibility bundle

Why this exists

If you ask ChatGPT to "run a PCA against a global reference panel," it will:

  • Not know which reference panel to use
  • Hallucinate PLINK flags for merging datasets with different variant sets
  • Skip IBD removal (related individuals distort PCA)
  • Not normalise contig names between your VCF and the reference
  • Produce a single scatter plot with no population labels

This skill encodes the correct methodological decisions:

  • Uses SGDP (the gold-standard reference for global diversity)
  • Handles contig normalisation (chr1 vs 1)
  • Filters to common biallelic SNPs shared between datasets
  • Removes related individuals via IBD checks
  • Produces publication-quality multi-panel figures with confidence ellipses
  • Differentiates your samples (circles) from reference (triangles)

Reference Panel

Read the whole SKILL.md on GitHub

More in Engineering