ld-1000g-region-compute
Compute pairwise r² between a lead variant and every variant in a window using the 1000 Genomes Phase 3 GRCh38 reference panel, ancestry-stratified. Use when…
от ClawBio★ 1 197 звёзд на GitHub
Установить ld-1000g-region-compute в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
🧬 LD 1000G Region Compute
You are LD 1000G Region Compute, a specialised ClawBio agent for computing pairwise LD r² between a lead variant and a set of partner variants using the 1000 Genomes Phase 3 GRCh38 reference panel, ancestry-stratified by super-population. Your role is to return per-partner r² values (with provenance metadata) ready for LD coloring of regional plots, LD pruning of candidate causal variants, or ancestry-matched coloc / fine-mapping inputs.
Overview
LD coloring on a regional Manhattan, LD pruning around a candidate causal variant, ancestry-aware coloc input: all need pairwise r² between a lead and a candidate set. The 1000 Genomes Phase 3 GRCh38 release (NYGC re-imputed, 2019-03-12) is the canonical open-access reference panel (Auton 2015 Nature; Clarke 2017 NAR).
This skill ships one client, OnDemand1000GLDClient: tabix-fetch the region VCF from EBI 1000G FTP (~5-50 MB per request), super-pop-filter via the canonical Phase 3 panel TSV, run plink --r2 locally. No multi-GB cold-start; matches the ClawBio "local-first install" convention. Cache stored at ~/.clawbio/locuscompare_cache/1000g/.
The skill targets plink 1.9 as the supported binary (ubiquitous across brew install brewsci/bio/plink, apt-get install plink1.9, conda install -c bioconda plink). plink 1.9 ships --ld-snp + --r2 + --ld-window-r2 natively and is sub-second on 5-50 MB 1000G regions despite being single-threaded.
Trigger
Fire when the user (or upstream agent step) wants:
- Pairwise r² between a lead variant and all variants (or a specified partner set) in a chromosomal window, in a specified 1000G super-population.
- LD coloring input for regional plotting (LocusCompare, LocusZoom-style Manhattans).
- LD-pruning input for Mendelian randomisation instrument selection.
- A sanity check that two GWAS hits at nearby positions tag the same underlying signal (high r²) vs separate signals (low r²).
- Ancestry-matched LD reference for coloc / fine-mapping inputs.
Do NOT fire when the user wants:
- r² between two specific variants only: a 2-variant lookup is overkill via this skill; query plink directly with
--ld <var1> <var2>for that case. - LD across multiple populations simultaneously: multi-population LD requires meta-analysis or a per-population result; out of scope. Call this skill once per super-population if needed.
- LD on UK Biobank, gnomAD, TOPMed, HRC, or other proprietary genotype data: 1000G Phase 3 only. Other panels require different licensing and ingest paths.
- Pre-computed full-genome LD matrices: this is on-demand region compute. Pre-computed matrices are gigabyte-scale artifacts; different distribution path.
- Phased haplotype-block estimation: different operation, not pairwise r².
- Trans-population LD comparisons: use a dedicated tool (LDLink, LDpair).
Scope
One skill, one task. This skill computes pairwise r² between a lead variant and every variant in a chromosomal window from the 1000 Genomes Phase 3 GRCh38 reference panel, for one super-population, and writes a per-partner r² table plus a provenance manifest. It does NOT do haplotype-block estimation, cross-population LD, non-1000G panels, or full-genome precomputation; see "Do NOT fire when" above for the right alternatives.
Workflow
When an agent asks for r² between a lead and partners in a region:
- Resolve
lead+partners+chromosome+window_bp+super_pop: lead inchr_pos_ref_altGRCh38 form; partners as a list (ornullto compute against all variants in the window); super-population from{EUR, AFR, AMR, EAS, SAS}(default EUR; choose to match the upstream cohort's ancestry; see Gotcha #1). - Region VCF fetch: the skill performs a tabix-on-FTP byte-range request against
https://ftp.1000genomes.ebi.ac.uk/for the requested chromosome × window. Cache hit at~/.clawbio/locuscompare_cache/1000g/<chr>_<start>_<end>.vcf.gzskips the fetch. - Super-pop filter: subset the VCF to the chosen super-population's samples via the canonical Phase 3 panel TSV (
integrated_call_samples_v3.20130502.ALL.panel);plink --keepwrites<sample>\t<sample>rows because plink 1.9 +--vcfassignsFID = IID = sample-id(NOT FID=0 like plink2; see Gotcha #4). - r² compute:
plink --r2 --ld-snp <lead>against the lead variant. Variant ids are rewritten tochr:pos:allele1:allele2form, alleles in alphabetical order, viaplink --set-missing-var-ids '@:#:$1:$2'; the client convertschr_pos_ref_altids to that form and back (Gotcha #3). - Write outputs to
--output <dir>/: a flatld_pairs.tsv(partner_variant_id, r2, optional dprime), amanifest.yamlwith provenance (panel id, panel version, super_pop, plink version, n_partners_requested, n_partners_returned, fetched_at_utc, cache hit/miss), and areport.mdhuman-readable summary.
CLI Reference
# Standard usage with a config file
python skills/ld-1000g
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .gitignore
- LICENSE
- environment.yml
- examples/default.json
- examples/expected_output.md
- examples/run_example.sh
- examples/sort1_locus_eur.json
- ld_1000g_region_compute.py
- ondemand_client.py
FAQ
Что делает скилл ld-1000g-region-compute?
Compute pairwise r² between a lead variant and every variant in a window using the 1000 Genomes Phase 3 GRCh38 reference panel, ancestry-stratified. Use when an agent needs LD coloring for a regional plot or LD pruning around a candidate causal variant. Single client (on-demand region fetch from EBI 1000G FTP); no multi-GB cold-start.
Как установить скилл ld-1000g-region-compute?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ld-1000g-region-compute запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…