bio-microbiome-functional-prediction
Infers metabolic pathways and gene abundances from microbial 16S sequencing data.
Install
mkdir -p .claude/skills/bio-microbiome-functional-prediction && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14374" && unzip -o skill.zip -d .claude/skills/bio-microbiome-functional-prediction && rm skill.zipInstalls to .claude/skills/bio-microbiome-functional-prediction
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Predict metagenome functional content from 16S rRNA marker gene data using PICRUSt2. Infer KEGG, MetaCyc, and EC abundances from ASV tables. Use when functional profiling is needed from 16S data without shotgun metagenomics sequencing.Key capabilities
- →Predict metagenome functional content from 16S rRNA data
- →Infer KEGG, MetaCyc, and EC abundances
- →Run the PICRUSt2 pipeline
- →Place ASV sequences in a reference tree
- →Perform metagenome inference
How it works
The skill executes the PICRUSt2 pipeline, which involves placing ASV sequences, predicting gene families, and inferring metagenome functions to generate functional abundance profiles.
Inputs & outputs
When to use bio-microbiome-functional-prediction
- →Infer KEGG pathways from 16S
- →Predict functional content
- →Process microbiome data
About this skill
Functional Prediction with PICRUSt2
Prepare Input Files
library(phyloseq)
library(Biostrings)
ps <- readRDS('phyloseq_object.rds')
# Export ASV table (samples as columns)
otu <- as.data.frame(otu_table(ps))
if (!taxa_are_rows(ps)) otu <- t(otu)
write.table(otu, 'asv_table.tsv', sep = '\t', quote = FALSE)
# Export ASV sequences as FASTA
seqs <- refseq(ps) # Or extract from ASV names if stored there
writeXStringSet(seqs, 'asv_seqs.fasta')
Run PICRUSt2 Pipeline
# Full pipeline (place sequences, predict functions, metagenome inference)
picrust2_pipeline.py \
-s asv_seqs.fasta \
-i asv_table.tsv \
-o picrust2_output \
-p 4 \
--stratified \
--per_sequence_contrib
# Output files:
# - pathway_abundance.tsv (MetaCyc pathways)
# - KO_metagenome_out/pred_metagenome_unstrat.tsv (KEGG orthologs)
# - EC_metagenome_out/pred_metagenome_unstrat.tsv (EC numbers)
Step-by-Step Pipeline
# 1. Place sequences in reference tree
place_seqs.py -s asv_seqs.fasta -o placed_seqs.tre -p 4
# 2. Hidden state prediction (gene content)
hsp.py -i 16S -t placed_seqs.tre -o marker_nsti_predicted.tsv -m pic -n
# 3. Predict gene families (KO)
hsp.py -i KO -t placed_seqs.tre -o KO_predicted.tsv -m pic
# 4. Metagenome inference
metagenome_pipeline.py \
-i asv_table.tsv \
-m marker_nsti_predicted.tsv \
-f KO_predicted.tsv \
-o KO_metagenome_out \
--strat_out
# 5. Pathway inference
pathway_pipeline.py \
-i KO_metagenome_out/pred_metagenome_contrib.tsv \
-o pathway_output \
-p 4
Quality Control: NSTI
import pandas as pd
# NSTI = Nearest Sequenced Taxon Index
# Lower = more reliable prediction (< 2 is acceptable)
nsti = pd.read_csv('marker_nsti_predicted.tsv', sep='\t')
print(f'Mean NSTI: {nsti["metadata_NSTI"].mean():.3f}')
print(f'ASVs with NSTI > 2: {(nsti["metadata_NSTI"] > 2).sum()}')
Analyze Pathway Output
library(ggplot2)
pathways <- read.delim('picrust2_output/pathways_out/path_abun_unstrat.tsv', row.names = 1)
metadata <- read.csv('sample_metadata.csv', row.names = 1)
# Normalize to relative abundance
pathways_rel <- sweep(pathways, 2, colSums(pathways), '/')
# Differential pathway analysis (use ALDEx2 or similar)
library(ALDEx2)
groups <- metadata[colnames(pathways), 'Group']
pathway_aldex <- aldex(as.data.frame(t(pathways)), groups, mc.samples = 128)
Add Pathway Descriptions
# Map pathway IDs to names
add_descriptions.py \
-i pathway_abundance.tsv \
-m METACYC \
-o pathway_abundance_described.tsv
KEGG Module Analysis
# Analyze KEGG modules instead of individual KOs
ko_table <- read.delim('KO_metagenome_out/pred_metagenome_unstrat.tsv', row.names = 1)
# Use KEGGREST for module mapping
library(KEGGREST)
modules <- keggLink('module', 'ko')
Limitations
- Predictions based on phylogenetic placement
- Novel taxa (high NSTI) have unreliable predictions
- 16S resolution limits species-level accuracy
- Cannot detect horizontal gene transfer events
Related Skills
- amplicon-processing - Generate ASV input
- metagenomics/functional-profiling - Direct shotgun-based profiling
- pathway-analysis/kegg-pathways - KEGG pathway enrichment
When not to use it
- →When shotgun metagenomics sequencing data is available
- →When fine-grained species-level accuracy is required
- →When detecting horizontal gene transfer events is critical
Prerequisites
Limitations
- →Predictions are based on phylogenetic placement
- →Novel taxa may have unreliable predictions
- →16S resolution limits species-level accuracy
How it compares
This skill infers functional content from 16S rRNA marker gene data, providing functional profiling without the need for direct shotgun metagenomics sequencing.
Compared to similar skills
bio-microbiome-functional-prediction side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| bio-microbiome-functional-prediction (this skill) | 0 | 3mo | Review | Advanced |
| quant-analyst | 103 | 2mo | No flags | Advanced |
| umap-learn | 6 | 2mo | Review | Intermediate |
| embedding-strategies | 8 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by majiayu000
View all by majiayu000 →You might also like
quant-analyst
zenobi-us
Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.
umap-learn
K-Dense-AI
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
embedding-strategies
wshobson
Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.
building-automl-pipelines
jeremylongshore
Build automated machine learning pipelines, including feature engineering, model selection, and performance evaluation.
model-compare
rawwerks
Compare 3D CAD models using boolean operations (IoU, Dice, precision/recall). Use when evaluating generated models against gold references, diffing CAD revisions, or computing similarity metrics for ML training. Triggers on: model diff, compare models, IoU, intersection over union, model similarity, CAD comparison, STEP diff, 3D evaluation, gold reference, generated model, precision recall 3D.
matchms
davila7
Mass spectrometry analysis. Process mzML/MGF/MSP, spectral similarity (cosine, modified cosine), metadata harmonization, compound ID, for metabolomics and MS data processing.