swaruplab/operon/population-genetics-linkage-disequilibrium
Claude Code and agent skill by swaruplab/operon
- community
Checking that the SKILL.md file is still in the repository.
Calculate linkage disequilibrium statistics (r², D'), perform LD pruning for population structure analysis, identify haplotype blocks, and visualize LD patterns using PLINK, scikit-allel, and LDBlockShow. Use when calculating LD or pruning variants.
Install
npx vskill@latest install swaruplab/operon/population-genetics-linkage-disequilibriumSKILL.md
The same SKILL.md was published earlier as swaruplab/operon/population-genetics-linkage-disequilibrium.
Version Compatibility
Reference examples tested with: matplotlib 3.8+, numpy 1.26+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - CLI:
<tool> --versionthen<tool> --helpto 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.
Linkage Disequilibrium
"Calculate LD between my variants" -> Compute pairwise LD statistics (r², D'), prune correlated variants for independent sets, and identify haplotype blocks from genotype data.
- CLI:
plink2 --r2for LD calculation,--indep-pairwisefor pruning - Python:
allel.rogers_huff_r()for windowed LD in scikit-allel
Calculate LD statistics, prune correlated variants, and identify haplotype blocks.
PLINK LD Calculations
Pairwise r²
Output Format
PLINK 1.9 Options
LD Pruning
Standard Pruning
Pruning Parameters
| Parameter | Description | Common Values | |
|---|---|---|---|
| Window (50) | Variants per window | 50-200 | |
| Step (10) | Variants to shift | 5-50 | |
| r² threshold (0.1) | Max LD allowed | 0.1-0.5 |
Use Cases
scikit-allel LD
Pairwise r²
LD Decay
Goal: Plot LD decay as a function of physical distance to characterize the extent of linkage in the population.
Approach: Compute pairwise r² values between nearby variants using scikit-allel, bin by physical distance, and plot mean r² per distance bin.
Haplotype Blocks
PLINK
Block Statistics
LD Matrix Visualization
LD-based Clumping (GWAS)
Clump Parameters
| Parameter | Description | |
|---|---|---|
| --clump-p1 | Index SNP p-value threshold | |
| --clump-p2 | Clumped SNP p-value threshold | |
| --clump-r2 | LD threshold for clumping | |
| --clump-kb | Physical distance threshold |
vcftools LD
Complete Workflow
Related Skills
- plink-basics - File format handling
- population-structure - Use pruned data for PCA
- association-testing - LD clumping for GWAS
- selection-statistics - LD affects EHH statistics
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingprotocols/population-genetics-linkage-disequilibrium/SKILL.md
Popularity
- Repository stars
- 99
- Repository forks
- 11
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/swaruplab/operon/population-genetics-linkage-disequilibrium)