ld-1000g-region-compute

Compute pairwise r² between a lead variant and window variants using the 1000 Genomes Phase 3 GRCh38 panel.

1.1k|257|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/ClawBio/ClawBio --skill ld-1000g-region-compute
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ld-1000g-region-compute
Source: https://github.com/ClawBio/ClawBio/tree/main/skills/ld-1000g-region-compute
Command: npx skills add https://github.com/ClawBio/ClawBio --skill ld-1000g-region-compute

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pysam, pandas, requests.

What problem does it solve?

Regional plots, LD pruning, and coloc analyses need pairwise linkage disequilibrium r² values between a lead variant and nearby variants, but downloading multi-gigabyte reference panels is a heavy cold-start. This Skill fetches only the needed region from the 1000 Genomes Phase 3 GRCh38 panel on demand and computes ancestry-stratified r² locally with plink 1.9.

Core Features & Use Cases

  • On-demand region fetch: tabix byte-range requests against the EBI 1000G FTP pull only a ~5-50 MB region VCF, cached locally for repeat runs.
  • Ancestry-stratified LD: filters samples to a chosen 1000G super-population (EUR, AFR, AMR, EAS, SAS) via the canonical Phase 3 panel TSV before computing r².
  • Provenance-rich outputs: writes ld_pairs.tsv, a manifest.yaml with panel and plink versions, and a human-readable report.md.
  • Use Case: Given a SORT1 locus lead variant (1_109274968_G_T) and five partner variants, produce EUR r² values ready for LocusZoom-style LD coloring of a regional Manhattan plot.

Quick Start

Ask the agent to compute ancestry-stratified LD r² around a lead variant using the 1000 Genomes panel, or run the bundled demo with python ld_1000g_region_compute.py --demo --output /tmp/sort1_ld_demo.

Frequently Asked Questions about ld-1000g-region-compute

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute LD r² around a lead variant with 1000 Genomes data?

Provide the lead variant in chr_pos_ref_alt format, a partner list, chromosome, window size, and super-population. The skill tabix-fetches the region VCF from the EBI 1000G FTP, filters samples by super-population, and runs plink 1.9 --r2 to produce per-partner r² values.

What reference panel does this LD calculation use?

It uses the 1000 Genomes Phase 3 GRCh38 release (NYGC re-imputed, 2019-03-12), the canonical open-access LD reference panel. Other panels such as UK Biobank, gnomAD, TOPMed, or HRC are explicitly out of scope.

Which super-populations are supported for ancestry-stratified LD?

The five 1000G Phase 3 super-populations are supported: EUR, AFR, AMR, EAS, and SAS. You should match the super-population to the upstream cohort's ancestry, since mismatched ancestry produces misleading r² estimates.

Does this skill require downloading the full 1000 Genomes panel?

No. It performs on-demand tabix byte-range fetches of roughly 5-50 MB per region from the EBI FTP and caches them under ~/.clawbio/locuscompare_cache/1000g/. Only plink 1.9, tabix, and Python packages must be installed locally.

Why does my lead variant return r² of zero for all partners?

Rare or array-only lead variants may be absent from the 1000G panel, so no LD can be computed against neighbours. The skill notes this in the manifest; the workaround is to choose a more common lead variant in the locus that is present in 1000G.

When should I not use this 1000G LD skill?

Avoid it for two-variant lookups (use plink --ld directly), cross-population LD comparisons, rare variants below MAF 0.01, haplotype-block estimation, and non-1000G panels like TOPMed or UK Biobank. It computes on-demand regional r² only, not precomputed genome-wide matrices.