bio-microbiome-diversity-analysis
Alpha and beta diversity analysis for microbiome data. Calculate within-sample richness, evenness, and between-sample dissimilarity with phyloseq and vegan. Use when comparing community composition across samples or testing for group differences in microbiome structure.
npx skills add majiayu000/claude-skill-registry --skill diversity-analysis --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.
# Diversity Analysis ## Create phyloseq Object ```r library(phyloseq) library(vegan) library(ggplot2) seqtab <- readRDS('seqtab_nochim.rds') taxa <- readRDS('taxa.rds') metadata <- read.csv('sample_metadata.csv', row.names = 1) ps <- phyloseq(otu_table(seqtab, taxa_are_rows = FALSE), tax_table(taxa), sample_data(metadata)) taxa_names(ps) <- paste0('ASV', seq(ntaxa(ps))) ``` ## Alpha Diversity ```r # Calculate multiple metrics alpha_div <- estimate_richness(ps, measures = c('Observed', 'Chao1', 'Shannon', 'Simpson')) alpha_div$SampleID <- rownames(alpha_div) alpha_div <- merge(alpha_div, sample_data(ps), by = 'row.names') # Statistical test kruskal.test(Shannon ~ Group, data = alpha_div) # Pairwise comparisons pairwise.wilcox.test(alpha_div$Shannon, alpha_div$Group, p.adjust.method = 'BH') ``` ## Alpha Diversity Plots ```r plot_richness(ps, x = 'Group', measures = c('Observed', 'Shannon')) + geom_boxplot() + theme_minimal() # Custom plot ggplot(alpha_div, aes(x = Group, y = Shannon, fill = Group)) + geom_boxplot() + geom_jitter(width = 0.2, alpha = 0.5) + theme_minimal() + labs(y = 'Shannon Diversity Index') ``` ## Faith's Phylogenetic Diversity ```r library(picante) # Requires phyl
- Create phyloseq Object
- Alpha Diversity
- Alpha Diversity Plots
- Faith's Phylogenetic Diversity
- Rarefaction Curves
- Rarefaction
- Beta Diversity
- PERMANOVA
- Beta Dispersion
- NMDS Ordination
- Distance Metrics Comparison
- Related Skills
What does the bio-microbiome-diversity-analysis skill do?
Alpha and beta diversity analysis for microbiome data. Calculate within-sample richness, evenness, and between-sample dissimilarity with phyloseq and vegan. Use when comparing community composition across samples or testing for group differences in microbiome structure.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill diversity-analysis --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.
