bio-population-genetics-population-structure
Analyze population structure using PCA and admixture analysis with PLINK and ADMIXTURE. Identify population clusters, assess ancestry proportions, visualize genetic structure, and choose optimal K for admixture models. Use when analyzing population stratification with PCA or admixture.
Profile →npx skills add majiayu000/claude-skill-registry --skill population-structure-gptomics-bioskills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Population Structure Analyze genetic ancestry and population stratification using PCA and ADMIXTURE. ## Principal Component Analysis (PCA) ### PLINK 2.0 PCA ```bash # Basic PCA (10 PCs) plink2 --bfile data --pca 10 --out pca_results # More PCs plink2 --bfile data --pca 20 --out pca_results # Approximate PCA (faster for large datasets) plink2 --bfile data --pca 10 approx --out pca_results # Output variant loadings plink2 --bfile data --pca 10 var-wts --out pca_results ``` ### Output Files | File | Contents | |------|----------| | `.eigenvec` | PC scores per sample (FID, IID, PC1, PC2, ...) | | `.eigenval` | Eigenvalues (variance explained) | | `.eigenvec.var` | Variant loadings (if var-wts) | ### Variance Explained ```python import numpy as np eigenvalues = np.loadtxt('pca_results.eigenval') variance_explained = eigenvalues / eigenvalues.sum() * 100 cumulative = np.cumsum(variance_explained) for i, (ve, cum) in enumerate(zip(variance_explained, cumulative), 1): print(f'PC{i}: {ve:.2f}% (cumulative: {cum:.2f}%)') ``` ### PCA Visualization ```python import pandas as pd import matplotlib.pyplot as plt eigenvec = pd.read_csv('pca_results.eigenvec', sep='\s+', header=None) eigenvec.col
- Principal Component Analysis (PCA)
- PLINK 2.0 PCA
- Output Files
- Variance Explained
- PCA Visualization
- LD Pruning (Before Admixture)
- Pruning Parameters
- ADMIXTURE Analysis
- Basic Usage
- Testing Multiple K Values
- Choose Optimal K
- Visualize Admixture
- FlashPCA2 (Fast PCA for Large Datasets)
- Installation
Basic PCA (10 PCs) plink2 --bfile data --pca 10 --out pca_results More PCs plink2 --bfile data --pca 20 --out pca_results Approximate PCA (faster for large datasets) plink2 --bfile data --pca 10 approx --out pca_results Output variant loadings plink2 --bfile data --pca 10 var-wts --out pca_results Calculate LD and identify pruned set plink2 --bfile data --indep-pairwise 50 10 0.1 --out prune
What does the bio-population-genetics-population-structure skill do?
Analyze population structure using PCA and admixture analysis with PLINK and ADMIXTURE. Identify population clusters, assess ancestry proportions, visualize genetic structure, and choose optimal K for admixture models. Use when analyzing population stratification with PCA or admixture.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill population-structure-gptomics-bioskills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.