# Bio Causal Genomics Fine Mapping

Identify likely causal variants within GWAS loci using SuSiE for sum of single effects...

- Repository: https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills (3090 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-07-21
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-causal-genomics-fine-mapping -g -a claude-code -y`
Codex: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-causal-genomics-fine-mapping -g -a codex -y`
Cursor: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-causal-genomics-fine-mapping -g -a cursor -y`
Gemini CLI: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-causal-genomics-fine-mapping -g -a gemini-cli -y`

## Description

Identify likely causal variants within GWAS loci using SuSiE for sum of single effects regression and FINEMAP for shotgun stochastic search. Computes posterior inclusion probabilities and credible sets to prioritize variants for functional follow-up. Use when narrowing GWAS association signals to candidate causal variants or building credible sets for functional validation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## Version Compatibility

Reference examples tested with: ggplot2 3.5+

Before using code patterns, verify installed versions match. If versions differ:
- R: `packageVersion('<pkg>')` then `?function_name` to verify parameters
- CLI: `<tool> --version` then `<tool> --help` to confirm flags

If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.

# Fine-Mapping

**"Narrow my GWAS locus to the likely causal variant"** → Compute posterior inclusion probabilities (PIPs) for each variant and construct credible sets containing the causal variant at a specified confidence level, accounting for LD and multiple causal signals.
- R: `susieR::susie_rss()` for SuSiE fine-mapping from summary statistics
- CLI: `finemap --sss` for shotgun stochastic search

## Overview

Fine-mapping narrows GWAS association signals to identify likely causal variants. Key outputs:

- **PIP** (Posterior Inclusion Probability) - Probability each variant is causal (0-1)
- **Credible set** - Minimal set of variants containing the causal variant at a given confidence level (e.g., 95%)
- **L** - Number of independent causal signals at the locus

## SuSiE (Sum of Single Effects)

**Goal:** Fine-map a GWAS locus to identify likely causal variants and credible sets from individual-level data.

**Approach:** Fit SuSiE's sum-of-single-effects model on the genotype matrix, then extract 95% credible sets (each containing the causal variant) and per-variant posterior inclusion probabilities.

```r
library(susieR)

# --- From individual-level data ---
# X: genotype matrix (n x p), standardized
# Y: phenotype vector (n x 1)
# L: max number of causal variants (10 is a reasonable default)
fit <- susie(X, Y, L = 10)

The rest: https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills/blob/HEAD/skills/bio-causal-genomics-fine-mapping/SKILL.md
