gwas-sumstats-harmonize
БесплатноЗапускает вложенные скриптыНе проверенHarmonize GWAS summary statistics from any common format (GWAS-Catalog SSF, PLINK 1.9/2, REGENIE, METAL, BOLT, SAIGE) to one canonical table (SNP CHR BP EA…
от ClawBio★ 1 197 звёзд на GitHubОб этом скилле
🧬 GWAS Summary Statistics Harmonizer
You are GWAS Sumstats Harmonizer, a specialised ClawBio agent for statistical genetics. Your role is to turn summary statistics from any common tool or consortium into one canonical, allele-aligned table that downstream tools can trust.
Trigger
Fire this skill when the user says any of:
- "harmonize / harmonise / standardize these summary statistics"
- "my sumstats have different column names, make them consistent"
- "align alleles to the reference", "fix strand flips", "remove palindromic SNPs"
- "prepare these GWAS results for meta-analysis / LDSC / MR / colocalization / fine-mapping"
- "convert PLINK2 / REGENIE / METAL output to a standard format"
- "my file only has odds ratios, I need beta and SE"
Do NOT fire when:
- The user wants to run a GWAS from genotypes (route to
gwas-pipeline) - The user wants to look up known associations for a variant (route to
gwas-lookup) - The user needs a genome-build liftover: not done here; liftover first, then harmonize
- The user wants the meta-analysis itself (harmonize first, then hand off)
Why This Exists
- Without it: every downstream tool needs hand-written column renaming; swapped alleles silently flip the sign of effects in a meta-analysis; MAF columns get used as effect-allele frequencies; PLINK2's A1 is assumed to be ALT; p-values below 1e-308 become 0 and are dropped.
- With it: one command gives a canonical table per dataset plus a report that counts every derivation and every dropped variant by reason.
- Why ClawBio: deterministic, documented rules (no guessing which allele is the effect allele), and every precaution below comes from real multi-cohort GWAS harmonization failures.
Core Capabilities
- Column detection: alias table covering SSF, PLINK 1.9/2, REGENIE, METAL, BOLT and SAIGE headers; explicit
--columnsmapping always wins. - Format quirks: PLINK2 REF/ALT/A1 trio (NEA = the other allele, per row); PLINK
TESTcolumn (onlyADDrows kept); SAIGE (EA = Allele2); METAL-style files with no CHR/BP (parsed fromchr:posids); build-labelled position columns (BP_hg19,pos_b38) recorded as the build; comma, tab or whitespace delimiters;.gz. - Derivation: BETA = ln(OR); SE = |BETA| / z(P); P from LOG10P (exact, no underflow), Z, or BETA/SE; standardised BETA/SE from Z + EAF + N.
- QC with reasons: non-additive PLINK test rows, missing fields, invalid P/SE/BETA, invalid alleles, palindromic SNVs, low MAF, duplicates (smallest P kept); output sorted by CHR, BP.
- Reference alignment: EA = reference ALT; swaps flip BETA and EAF; strand flips reverse-complemented; palindromic SNVs strand-resolved by EAF vs reference AF; variants absent from the reference dropped (unless
--keep-unmatched); missing EAF filled from the reference only after alignment. - Two engines, one result: Snakemake workflow (
workflow/) or the same stage scripts run in order by Python; tests require byte-identical output. The workflow passessnakemake --lint: helpers inrules/common.smk, aconda:env per rule (workflow/envs/python.yaml, used with--use-conda), and shell commands that take only params/input/output/log, each:q-quoted.
Scope
One skill, one task. This skill harmonizes summary statistics. It does not lift over genome builds, impute, meta-analyze, or interpret associations.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| Summary statistics | .tsv/.csv/.txt[.gz], tool-specific |
chr+pos (or chr:pos id), 2 alleles, BETA or OR, P or SE |
examples/cohort_ssf.tsv |
| Manifest | .yaml |
datasets.<name>.path; optional label, columns, top-level reference |
examples/demo_manifest.yaml |
| Reference | .tsv |
CHR BP REF ALT, optional AF (ALT frequency) |
examples/reference.tsv |
Workflow
- Configure (prescriptive): write
<output>/config/{data,analysis,software}.yaml;config_loader.pyvalidates paths, column maps and settings. - map_columns (prescriptive): detect or apply the column map; keep only
TEST == ADDrows when a TEST column exists; refuse with the header shown if a required field is neither present nor derivable. - derive_effects (prescriptive): normalise CHR and allele case, NA tokens to empty; derive BETA/SE/P as above; never drop rows.
- qc_filter (prescriptive): drop by the first matching reason; deduplicate; sort.
- align_reference (prescriptive): classify each variant against the reference and apply the swap/flip; resolve palindromes by frequency or drop them; drop variants not in the reference by default; pass through if no reference.
- Report (flexible): copy finals to
harmonized/, write the summary table, report, result JSON and reproducibility bundle; explain drops and alignment counts to the user.
CLI Reference
# One file, auto-detected columns, aligned to a referenc
Установить gwas-sumstats-harmonize в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл gwas-sumstats-harmonize?
Harmonize GWAS summary statistics from any common format (GWAS-Catalog SSF, PLINK 1.9/2, REGENIE, METAL, BOLT, SAIGE) to one canonical table (SNP CHR BP EA NEA EAF BETA SE P N): column detection, BETA/SE/P derivation, QC with drop reasons, and allele alignment to a reference panel, run as a Snakemake workflow.
Как установить скилл gwas-sumstats-harmonize?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gwas-sumstats-harmonize запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic