# Bioresearch Ld Reference Management

> Manage ancestry-specific LD reference panels and perform LD clumping for cross-ancestry MR. Use when the user needs to simulate ancestry-aware LD block structures (AFR/EUR/EAS/SAS/AMR), run greedy distance-based clumping (PLINK --clump style), or compute LD scores for stratified LDSC. Mock mode validates the clumping pipeline; live mode wraps PLINK 2.0 + 1000 Genomes reference panels.

- **Type:** Skill
- **Install:** `agentstack add skill-alim430-bioresearch-agent-ld-reference-management`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Alim430](https://agentstack.voostack.com/s/alim430)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Alim430](https://github.com/Alim430)
- **Source:** https://github.com/Alim430/bioresearch-agent/tree/main/skills/biomedical/ld-reference-management

## Install

```sh
agentstack add skill-alim430-bioresearch-agent-ld-reference-management
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# BioResearch Agent — LD Reference Panel Management Skill

## Capability

Manages ancestry-specific LD reference panels and performs LD-based instrument clumping:

1. **Ancestry-aware LD simulation** — generates realistic LD block structures for 5 super-populations
   (AFR / EUR / EAS / SAS / AMR) with biologically grounded parameters: AFR has shortest LD blocks
   (older population, more recombination), non-AFR populations have longer blocks (serial founder
   effects). Block lengths and LD decay rates follow 1000 Genomes empirical patterns.
2. **Greedy LD clumping** — PLINK `--clump`-style algorithm: sort SNPs by p-value, greedily select
   lead SNPs, remove proxies within a distance + r² threshold. Returns independent instrument set.
3. **LD score computation** — per-SNP LD scores (sum of r² with neighbors) for stratified LDSC
   heritability partitioning across ancestries.
4. **Cross-ancestry LD comparison** — pairwise LD decay curves and block-length distributions,
   quantifying how LD structure differs across populations (the root cause of ancestry-portability
   failure in MR).

Returns a clumped instrument set + LD score table + ancestry comparison report, not a causal claim.

## Run

```bash
bioresearch run ld-reference-management --ancestry EUR --n-snps 500 --seed 42 --output-dir outputs/ld-reference
```

## Outputs (in `--output-dir`)

- `ld_clumped_instruments.csv` — independent lead SNPs after clumping (SNP, CHR, POS, P, cluster_id)
- `ld_scores.csv` — per-SNP LD scores per ancestry (SNP, ancestry, ld_score)
- `ld_decay_comparison.csv` — pairwise LD decay curves (distance, mean_r2, ancestry_pair)
- `ld_block_summary.csv` — per-ancestry block-length statistics (mean, median, max, n_blocks)
- `ld_ancestry_heatmap.png` — LD decay heatmap across ancestries
- `ld_evidence_package.json` — reproducible Evidence Package (provenance + parameters + grade)

## Note

This skill dispatches to the framework's `ld-reference-management` workflow / `demo_ld_reference.py`.
It adds **no analysis of its own**; all computations run in the workflow modules. By default uses
**simulated LD panels with ancestry-specific parameters** to validate the clumping pipeline —
real-data deployment would use PLINK 2.0 with 1000 Genomes Phase 3 reference panels per ancestry.
Evidence grade is **C** (methodology validation). Part of Phase 3a (cross-ancestry MR, CPU-only).

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Alim430](https://github.com/Alim430)
- **Source:** [Alim430/bioresearch-agent](https://github.com/Alim430/bioresearch-agent)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-alim430-bioresearch-agent-ld-reference-management
- Seller: https://agentstack.voostack.com/s/alim430
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
