Personal genomics

From sammcj/agentic-coding · View interactive version

Personal genomics is an AI agent skill from the GitHub repository sammcj/agentic-coding. Analyse personal DNA / genome files for pharmacogenomics, disease risk, carrier status, ancestry and traits. Use whenever the user mentions DNA or genome analysis, a raw genome file, gene names, drug-gene interactions, or wants to combine multiple DNA sources.

How to use this skill

Skill file

Personal Genomics

Runs the local personal-genomics toolkit over one or more raw DNA files and reports the findings. All analysis is offline; genetic data never leaves the machine.

First: track the workflow

Create a task for each step below, then work them to completion. The run is multi-step and the reporting step (surfacing findings safely) is the one most often skipped once the analysis file is written.

Locate the toolkit

The scripts and their virtualenv live at ~/git/personal-genomics (a .venv/ with pandas/numpy/scipy/reportlab). Use that venv's Python: ~/git/personal-genomics/.venv/bin/python.

If the repo or venv is missing, set it up before analysing:

cd ~/git/personal-genomics && python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

If the toolkit lives elsewhere, ask the user for the path rather than guessing.

Locate the input files

Ask the user where their DNA file(s) are if not already given. Common location is ~/Downloads/DNA/. Supported inputs:

A .cram.crai on its own is not usable (it is only an index; the alignment data is in the .cram it points to). See Gotchas for what to do when the .cram itself is available.

Choose single-source or combined

One file -> comprehensive_analysis.py:

~/git/personal-genomics/.venv/bin/python ~/git/personal-genomics/comprehensive_analysis.py <file> --out <dir>

Two or more files -> combine_sources.py, which merges them first:

~/git/personal-genomics/.venv/bin/python ~/git/personal-genomics/combine_sources.py <file1> <file2> ... --out <dir>

Always merge when more than one source exists. A variants-only VCF (the usual WGS export) lists only sites where the person differs from the reference, so every homozygous-reference site is absent. The marker analysis treats an absent rsID as "not tested" and skips it, which makes a rich WGS file yield fewer findings than an array on its own. Merging restores the array's reference/normal calls and keeps the WGS's rare variants, producing a strict superset. The combiner resolves contested sites to the sequencing call and writes merge_stats.json recording overlap, agreement, and strand-flip counts.

Outputs land in <dir> (suggest ~/dna-analysis/reports for single, ~/dna-analysis/reports-combined for merged): agent_summary.json, full_analysis.json, report.txt, dashboard.html.

Report the findings

Read agent_summary.json (it is priority-sorted) - not full_analysis.json, and never echo the raw genotype data. Surface, in order:

  1. critical_alerts - state each gene, genotype, and the recommended action verbatim.
  2. high_priority - pharmacogenomics and actionable risk items.
  3. A short read of polygenic_risk_scores (these are percentile ranges with confidence, not verdicts) and apoe_status.

Then offer the dashboard with SendUserFile (display: render).

Frame results as informational, not diagnostic. Recommend confirmatory clinical-grade testing and genetic counselling for any pathogenic hereditary-cancer variant, critical pharmacogenomic finding (e.g. DPYD, MT-RNR1, HLA-B risk alleles), APOE e4/e4, or carrier status with reproductive implications.

Gotchas

```bash

~/git/personal-genomics/.venv/bin/python ~/git/personal-genomics/cram/genotype_cram.py \

--cram <file.cram> --reference <hg38.fa> \

--analyze --combine-with <array.txt> <genome.vcf.gz>

```

This calls genotypes at the marker sites, merges them with the other sources, and writes a combined report to ~/dna-analysis/reports-cram.

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.