---
name: 23andme-genome-analysis
description: Parse 23andMe raw data files, search key SNPs, and provide personalized interpretation. Use when user sends a 23andMe .txt or .zip file.
category: data-science
---

# 23andMe Genome Analysis

## Trigger
User sends a 23andMe raw data file (`.txt` or `.zip`) and wants their genome decoded.

## Steps

### 1. Extract the file
```bash
# If zip:
unzip -o "file.zip" -d genome_dir/
# The raw data is a tab-separated .txt file
```

### 2. Check structure
```bash
wc -l genome.txt && head -30 genome.txt
```
Should show: `# rsid	chromosome	position	genotype` header. V5 format has ~627K SNPs.

### 3. Key SNPs to search
Focus on variants relevant to user's traits. Priority categories:

**Personality / Cognition:**
- `rs4680` — COMT Val158Met. G=Val (warrior: stress-resilient), A=Met (philosopher: deep processing), GA=balanced warrior-philosopher
- `rs6265` — BDNF Val66Met. CC=high neuroplasticity, T=reduced

**Dopamine / Addiction / Risk-taking:**
- `rs1800497` — DRD2 Taq1A. A1=lower receptor density → addiction risk. GG=normal
- `rs4648317`, `rs12364283`, `rs1076560` — DRD2 variants

**Serotonin / Mood / Spirituality:**
- `rs6311` — HTR2A. T=higher mysticism/spirituality/self-transcendence
- `rs6313` — HTR2A another variant

**Oxytocin / Social:**
- `rs53576` — OXTR. G=higher empathy, A=reduced

**Physical / Metabolism:**
- `rs1815739` — ACTN3 sprinter gene. C=fast-twitch works, T=knockout
- `rs762551` — CYP1A2 caffeine. A=fast metabolizer

**Health (careful — sensitive):**
- `rs1801133` — MTHFR C677T. TT=reduced methylation → mood risk
- `rs429358` + `rs7412` — APOE. ε3/ε3=neutral Alzheimer's risk. ε4=increased risk (handle carefully)
- `rs11575897` — Neanderthal ancestry marker

### 4. Parse and search
```python
snp_data = {}
with open("genome.txt") as f:
    for line in f:
        if line.startswith("#") or line.startswith("rsid"):
            continue
        parts = line.strip().split("\t")
        if len(parts) >= 4:
            snp_data[parts[0]] = parts[3]  # rsid -> genotype

for rsid, description in key_snps.items():
    if rsid in snp_data:
        print(f"{rsid}: {snp_data[rsid]} ← {description}")
```

### 5. Interpret
- COMT GA = balanced warrior-philosopher (rarest/most interesting finding)
- BDNF CC = maximum neuroplasticity
- DRD2 GG = addiction NOT genetically driven (overcame it through will)
- HTR2A CT = moderate mysticism — one foot in, one grounded
- ACTN3 CC = sprinter muscles
- APOE ε3/ε3 = neutral Alzheimer's risk

### 6. Present results
Format as a table with gene, SNP, genotype, and plain-language meaning. Connect to user's life narrative where relevant.

## Pitfalls
- 23andMe data is NOT clinical-grade. Always add disclaimers.
- Never diagnose diseases from raw data.
- APOE ε4 is sensitive — handle carefully.
- Some SNPs may not be on the v5 chip.
- `--` means no-call — skip those lines.
