Statistical fine-mapping of GWAS loci using credible sets (SuSiE, FINEMAP) and locus-to-gene scoring (Open Targets L2G). Identifies likely causal variants and target genes — distinct from positional 'nearest gene' which is often wrong. Use for prioritizing causal variants at GWAS hits, comparing fine-mapping methods, and converting lead SNPs to target genes.
81%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
When analysis requires computation (statistics, data processing, scoring, enrichment), write and run Python code via Bash. Don't describe what you would do — execute it and report actual results. Use ToolUniverse tools to retrieve data, then Python (pandas, scipy, statsmodels, matplotlib) to analyze it.
Identify and prioritize causal variants at GWAS loci using statistical fine-mapping and locus-to-gene predictions.
Genome-wide association studies (GWAS) identify genomic regions associated with traits, but linkage disequilibrium (LD) makes it difficult to pinpoint the causal variant. Fine-mapping uses Bayesian statistical methods to compute the posterior probability that each variant is causal, given the GWAS summary statistics.
REASONING STRATEGY — Start Here: Fine-mapping asks: which variant at this locus is CAUSAL? Work through this chain:
This skill provides tools to:
A credible set is a minimal set of variants that contains the causal variant with high confidence (typically 95% or 99%). Each variant in the set has a posterior probability of being causal, computed using methods like:
The probability that a specific variant is causal, given the GWAS data and LD structure. Higher posterior probability = more likely to be causal.
L2G scores integrate multiple data types to predict which gene is affected by a variant:
L2G scores range from 0 to 1, with higher scores indicating stronger gene-variant links.
LOOK UP DON'T GUESS -- never assume a lead SNP is the causal variant. Always check LD structure, credible sets, and functional annotations via the tools below.
The lead SNP (most significant p-value) is often NOT the causal variant. It is simply the best-tagged variant on the genotyping array. The causal variant may be:
Action: Always call OpenTargets_get_variant_credible_sets for the lead SNP. If the posterior probability is < 0.5, the lead SNP is likely NOT causal -- examine other variants in the credible set.
LD blocks define the resolution limit of fine-mapping:
When interpreting a credible set:
Colocalization asks: do two association signals (e.g., GWAS + eQTL) share the SAME causal variant?
When multiple variants have similar posterior probabilities:
OpenTargets_get_variant_credible_sets or gwas_search_snps with gene=TCF7L2OpenTargets_get_variant_info then OpenTargets_get_variant_credible_setsOpenTargets_get_study_credible_setsOpenTargets_search_gwas_studies_by_disease or gwas_search_studiesOpenTargets_get_variant_info: Variant details and allele frequenciesOpenTargets_get_variant_credible_sets: Credible sets containing a variantOpenTargets_get_credible_set_detail: Detailed credible set informationOpenTargets_get_study_credible_sets: All loci from a GWAS studyOpenTargets_search_gwas_studies_by_disease: Find studies by diseasegwas_search_snps: Find SNPs by gene or rsIDgwas_get_snp_by_id: Detailed SNP informationgwas_get_associations_for_snp: All trait associations for a variantgwas_search_studies: Find studies by disease/traitThis skill's "Limitations" section above already notes that Open Targets hasn't fine-mapped every published GWAS locus. When a locus has no precomputed OpenTargets_get_variant_credible_sets/OpenTargets_get_study_credible_sets result, three local calculator tools let you run the actual statistics yourself from raw per-SNP summary statistics (beta, standard error, SNP IDs) that you already have or pull from elsewhere:
Finemap_credible_set(beta=[...], se=[...], snp=[...], coverage=0.95, sd_prior=...) — single-causal-variant fine-mapping via Wakefield's approximate Bayes factor. Returns each SNP's posterior inclusion probability (PIP), the top_snp/top_pip, and the credible set at the requested coverage. Verified live: {"n_snps": 6, "top_snp": "rs3", "top_pip": 1.0, "credible_set": [...]}.Coloc_abf_test(beta1=[...], se1=[...], beta2=[...], se2=[...], snp=[...], p1=..., p2=..., p12=...) — Bayesian colocalization (coloc.abf, Giambartolomei 2014) testing whether two signals over the same SNP set (e.g. a GWAS hit and an eQTL) share one causal variant. Returns the five posterior probabilities PP0-PP4 (PP4 = shared causal variant — the number to check first). Verified live: real posteriors returned for a 6-SNP toy region.SPrediXcan_associate(weight=[...], gwas_z=[...], snp_sd=[...], covariance=..., snp=[...]) — summary-based transcriptome-wide association (S-PrediXcan, Barbeira 2018): combines eQTL prediction weights for a gene with GWAS per-SNP z-scores to test whether the gene's predicted expression (not just nearby variants) associates with the trait. Returns a TWAS z-score/p-value and direction. Verified live: {"twas_zscore": 4.73, "p_value": 2.2e-06, ...}.Where to get the raw inputs: these three tools compute on arrays you supply — they do not fetch summary statistics themselves. src/tooluniverse/data/gwas_sumstats_tools.json's 3 tools (GWASSumStats_list_studies, GWASSumStats_get_trait_studies, GWASSumStats_get_region_associations) were meant to supply exactly this, but as of this writing all three are dead: EBI deprecated its GWAS Summary Statistics REST API entirely — every call returns a clean 410 Gone ("This API has been deprecated. For ways to access summary statistics see: https://www.ebi.ac.uk/gwas/docs/methods/summary-statistics"), confirmed both via tu test and an independent direct curl to the same endpoint. Do not route a workflow through GWASSumStats_* expecting it to work; get region-level summary statistics via the GWAS Catalog's current bulk-download/FTP method (linked from that docs page) or another source, then feed the resulting beta/SE/SNP arrays into the three calculator tools above.
Q: Why don't all variants have credible sets? A: Fine-mapping requires:
Q: Can a variant be in multiple credible sets? A: Yes! A variant can be causal for multiple traits (pleiotropy) or appear in different studies for the same trait.
Q: What if the top L2G gene is far from the variant? A: This suggests regulatory effects (enhancers, promoters). Check:
Q: How do I choose between variants in a credible set? A: Prioritize by:
mims-harvard/ToolUniverse
37bb81a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.