# Bio Causal Genomics Colocalization Analysis

Test whether two traits share a causal variant at a genomic locus using Bayesian...

- Repository: https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills (3090 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-07-21
- Runs scripts: no, instructions only

## Install

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

## Description

Test whether two traits share a causal variant at a genomic locus using Bayesian colocalization with coloc. Computes posterior probabilities for shared vs distinct causal variants between GWAS and eQTL signals. Use when determining if a GWAS signal and an eQTL share the same causal variant.

## 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

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

# Colocalization Analysis

**"Test whether my GWAS signal and eQTL share the same causal variant"** → Compute Bayesian posterior probabilities for five colocalization hypotheses (no association, trait-1-only, trait-2-only, distinct causal variants, shared causal variant) to distinguish true causal overlap from LD-driven coincidence.
- R: `coloc::coloc.abf()` for approximate Bayes factor colocalization

## Overview

Colocalization tests whether two association signals at the same locus are driven by the
same causal variant. This distinguishes shared causality from coincidental overlap due to LD.

Five hypotheses tested by coloc:
- H0: No association with either trait
- H1: Association with trait 1 only
- H2: Association with trait 2 only
- H3: Both associated, different causal variants
- H4: Both associated, shared causal variant

## coloc.abf Analysis

**Goal:** Test whether two traits share a causal variant at a GWAS locus using Bayesian colocalization.

**Approach:** Format summary statistics for each trait as named lists, run coloc.abf to compute posterior probabilities for five hypotheses (H0-H4), and interpret PP.H4 as evidence for a shared causal variant.

```r
library(coloc)

# --- Input format: named list with GWAS summary stats ---
# Required fields: beta, varbeta, snp, position, type, N
# type = 'quant' (continuous) or 'cc' (case-control)

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