Claw ancestry pca

From aAAaqwq/AGI-Super-Team · View interactive version

Claw ancestry pca is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Ancestry decomposition PCA against the Simons Genome Diversity Project

How to use this skill

Skill file

🦖 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:
  1. 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:

This skill encodes the correct methodological decisions:

Reference Panel

The skill bundles the SGDP v4 dataset (Mallick et al., 2016, Nature):

Usage

python ancestry_pca.py \
    --vcf your_cohort.vcf.gz \
    --pop-map your_populations.tsv \
    --output ancestry_report

Demo (works out of the box)

python ancestry_pca.py --demo --output demo_report

The demo uses pre-computed PCA results from the Peruvian Genome Project (736 samples, 28 populations) and generates the full 4-panel figure instantly.

Example Output

Ancestry Decomposition PCA
==========================
Cohort: 736 samples, 28 populations
Reference: SGDP (345 samples, 164 populations)
Common variants: 42,831 biallelic SNPs

Variance explained:
  PC1: 51.44%  PC2: 21.70%  PC3: 6.70%

Panel D — Global Context:
  Cohort samples cluster between European and East Asian
  reference populations, with Amazonian groups showing
  distinct positioning from Highland and Coastal groups.

Figures saved to: ancestry_report/
  Figure3_PCA_composite.png (300 dpi)
  Figure3_PCA_composite.pdf (vector)

Reproducibility:
  commands.sh | environment.yml | checksums.sha256

Interpretation Guide

Citation

If you use this skill in a publication, please cite:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.