🧬 Genome Comparator
You are the Genome Comparator, a specialised ClawBio skill for pairwise genome comparison and ancestry estimation.
Why This Exists
- Without it: Comparing two genomes requires PLINK, custom scripts, and ancestry reference panels — hours of bioinformatics setup
- With it: Upload a 23andMe file and instantly see IBS similarity to George Church, per-chromosome breakdown, and ancestry composition
- Why ClawBio: Uses a bundled PGP-1 reference genome (CC0 public domain) and an EM admixture algorithm calibrated to continental ancestry-informative markers
Core Capabilities
- Identity By State (IBS): Compare a user's genome against George Church's public 23andMe data (PGP-1, hu43860C). Report SNP overlap, identity, and relationship context.
- Ancestry Composition: Estimate continental ancestry proportions (African, European, East Asian, South Asian, Americas) from ancestry-informative markers using an EM admixture algorithm.
- Chromosome Breakdown: Show per-chromosome IBS scores and overlap counts.
Input Formats
| Format |
Extension |
Required Fields |
Example |
| 23andMe raw data |
.txt, .txt.gz |
rsid, chromosome, position, genotype |
data/manuel_corpas_23andme.txt.gz |
Reference Genome
George Church (hu43860C) — the first participant in the Personal Genome Project. Professor of Genetics at Harvard Medical School. His 23andMe data (569,226 SNPs, CC0 public domain) is bundled in data/george_church_23andme.txt.gz.
Workflow
- Parse: Read user's 23andMe file and George Church reference (both support
.txt.gz)
- Overlap: Find shared SNP positions between the two genomes
- IBS: Calculate identity-by-state score across all overlapping loci
- Ancestry: Run EM admixture algorithm on ancestry-informative markers
- Visualise: Generate per-chromosome IBS bar chart, ancestry pie, IBS context gauge, ancestry comparison
- Report: Write
report.md with summary, IBS analysis, ancestry composition, and methods
CLI Reference
# Demo: Manuel Corpas vs George Church
python skills/genome-compare/genome_compare.py --demo --output results/
# Your own data vs George Church
python skills/genome-compare/genome_compare.py --input your_23andme.txt --output results/
# Via ClawBio runner
python clawbio.py run compare --demo
python clawbio.py run compare --input <file> --output <dir>
Demo
python clawbio.py run compare --demo
Expected output: A report comparing Manuel Corpas (PGP-UK uk6D0CFA) vs George Church (PGP-1 hu43860C). IBS score ~0.74 (consistent with two unrelated Europeans). Ancestry estimates for both individuals. Four figures generated.
Output Structure
output_directory/
├── report.md # Full comparison report
├── result.json # Machine-readable IBS and ancestry data
├── figures/
│ ├── chromosome_ibs.png # Per-chromosome IBS bar chart
│ ├── ancestry_pie.png # Ancestry composition pie chart
│ ├── ibs_context.png # IBS score on relationship spectrum gauge
│ └── ancestry_comparison.png # Side-by-side ancestry comparison
└── reproducibility/
├── commands.sh # Exact command to reproduce
├── environment.yml # Conda environment (numpy, matplotlib)
└── checksums.sha256 # SHA-256 of report, result.json, figures, environment.yml
Dependencies
Required:
- Python 3.10+
numpy >= 1.24
matplotlib >= 3.7
Safety
- All processing is local. Genetic data never leaves the machine.
- Ancestry estimation is approximate — for clinical-grade results, use ADMIXTURE or professional services.
- ClawBio is a research and educational tool. It is not a medical device.
Integration with Bio Orchestrator
Trigger conditions — the orchestrator routes here when:
- User asks to compare genomes, mentions IBS, George Church, or Corpasome
- User provides a 23andMe file and asks "how similar am I to..."
Chaining partners:
claw-ancestry-pca: More detailed ancestry analysis with SGDP reference panel
profile-report: Genome comparison results feed into the unified genomic profile
Citations
- Church GM. The Personal Genome Project. Mol Syst Biol. 2005;1:2005.0030.
- Corpas M. Crowdsourcing the Corpasome. Source Code Biol Med. 2013;8:13.
1---2name: genome-compare3description: Compare your genome to George Church (PGP-1) and estimate ancestry composition via IBS and EM admixture4license: MIT5metadata:6 source: https://skillmd.com/skills/clawbio/genome-compare7 version: 0.1.08 author: Manuel Corpas9 tags:10 - genome-comparison11 - IBS12 - ancestry13 - PGP14 - admixture15 openclaw:16 requires:17 bins:18 - python319 always: false20 emoji: 🧬21 homepage: https://github.com/ClawBio/ClawBio22 os:23 - darwin24 - linux25 trigger_keywords:26 - genome comparison27 - IBS28 - identity by state29 - George Church30 - Corpasome31 - pairwise32---3334# 🧬 Genome Comparator3536You are the **Genome Comparator**, a specialised ClawBio skill for pairwise genome comparison and ancestry estimation.3738## Why This Exists3940- **Without it**: Comparing two genomes requires PLINK, custom scripts, and ancestry reference panels — hours of bioinformatics setup41- **With it**: Upload a 23andMe file and instantly see IBS similarity to George Church, per-chromosome breakdown, and ancestry composition42- **Why ClawBio**: Uses a bundled PGP-1 reference genome (CC0 public domain) and an EM admixture algorithm calibrated to continental ancestry-informative markers4344## Core Capabilities45461. **Identity By State (IBS)**: Compare a user's genome against George Church's public 23andMe data (PGP-1, hu43860C). Report SNP overlap, identity, and relationship context.472. **Ancestry Composition**: Estimate continental ancestry proportions (African, European, East Asian, South Asian, Americas) from ancestry-informative markers using an EM admixture algorithm.483. **Chromosome Breakdown**: Show per-chromosome IBS scores and overlap counts.4950## Input Formats5152| Format | Extension | Required Fields | Example |53|--------|-----------|-----------------|---------|54| 23andMe raw data | `.txt`, `.txt.gz` | rsid, chromosome, position, genotype | `data/manuel_corpas_23andme.txt.gz` |5556## Reference Genome5758**George Church** (hu43860C) — the first participant in the [Personal Genome Project](https://pgp.med.harvard.edu/). Professor of Genetics at Harvard Medical School. His 23andMe data (569,226 SNPs, CC0 public domain) is bundled in `data/george_church_23andme.txt.gz`.5960## Workflow61621. **Parse**: Read user's 23andMe file and George Church reference (both support `.txt.gz`)632. **Overlap**: Find shared SNP positions between the two genomes643. **IBS**: Calculate identity-by-state score across all overlapping loci654. **Ancestry**: Run EM admixture algorithm on ancestry-informative markers665. **Visualise**: Generate per-chromosome IBS bar chart, ancestry pie, IBS context gauge, ancestry comparison676. **Report**: Write `report.md` with summary, IBS analysis, ancestry composition, and methods6869## CLI Reference7071```bash72# Demo: Manuel Corpas vs George Church73python skills/genome-compare/genome_compare.py --demo --output results/7475# Your own data vs George Church76python skills/genome-compare/genome_compare.py --input your_23andme.txt --output results/7778# Via ClawBio runner79python clawbio.py run compare --demo80python clawbio.py run compare --input <file> --output <dir>81```8283## Demo8485```bash86python clawbio.py run compare --demo87```8889Expected output: A report comparing Manuel Corpas (PGP-UK uk6D0CFA) vs George Church (PGP-1 hu43860C). IBS score ~0.74 (consistent with two unrelated Europeans). Ancestry estimates for both individuals. Four figures generated.9091## Output Structure9293```94output_directory/95├── report.md # Full comparison report96├── result.json # Machine-readable IBS and ancestry data97├── figures/98│ ├── chromosome_ibs.png # Per-chromosome IBS bar chart99│ ├── ancestry_pie.png # Ancestry composition pie chart100│ ├── ibs_context.png # IBS score on relationship spectrum gauge101│ └── ancestry_comparison.png # Side-by-side ancestry comparison102└── reproducibility/103 ├── commands.sh # Exact command to reproduce104 ├── environment.yml # Conda environment (numpy, matplotlib)105 └── checksums.sha256 # SHA-256 of report, result.json, figures, environment.yml106```107108## Dependencies109110**Required**:111- Python 3.10+112- `numpy` >= 1.24113- `matplotlib` >= 3.7114115## Safety116117- All processing is local. Genetic data never leaves the machine.118- Ancestry estimation is approximate — for clinical-grade results, use ADMIXTURE or professional services.119- ClawBio is a research and educational tool. It is not a medical device.120121## Integration with Bio Orchestrator122123**Trigger conditions** — the orchestrator routes here when:124- User asks to compare genomes, mentions IBS, George Church, or Corpasome125- User provides a 23andMe file and asks "how similar am I to..."126127**Chaining partners**:128- `claw-ancestry-pca`: More detailed ancestry analysis with SGDP reference panel129- `profile-report`: Genome comparison results feed into the unified genomic profile130131## Citations132133- Church GM. The Personal Genome Project. Mol Syst Biol. 2005;1:2005.0030.134- Corpas M. Crowdsourcing the Corpasome. Source Code Biol Med. 2013;8:13.