bio-population-genetics-linkage-disequilibrium
Installation
SKILL.md
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.