一键导入
microbiome
Microbiome analysis — compositional data handling, 16S/ITS amplicon, shotgun metagenomics, diversity, differential abundance, and functional profiling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Microbiome analysis — compositional data handling, 16S/ITS amplicon, shotgun metagenomics, diversity, differential abundance, and functional profiling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Molecular structure analysis, SAR triage, compound library characterization, QSAR modeling, ADMET prediction, chemical space visualization, target engagement assessment, drug perturbation connectivity scoring, and selectivity profiling
Chromatin regulation analysis — ATAC-seq, ChIP-seq, CUT&Tag/CUT&Run, differential binding, motif analysis, and scATAC-seq
Systematic drug repurposing via signature matching, target-based analysis, network proximity, genetic evidence scoring, and clinical evidence mining
Functional enrichment and pathway analysis including GSEA, ORA, ssGSEA, GSVA, and decoupler-based activity inference
Genomic variant analysis — germline/somatic SNV, structural variants, CNV, GWAS, annotation, and filtering
Metabolomics and lipidomics analysis — untargeted/targeted workflows, normalization, annotation, and pathway mapping
| name | microbiome |
| description | Microbiome analysis — compositional data handling, 16S/ITS amplicon, shotgun metagenomics, diversity, differential abundance, and functional profiling |
| version | 1.0.0 |
| tags | ["microbiome","16s","its","shotgun","metagenomics","compositional","ancombc","aldex2"] |
Comprehensive guidelines for amplicon and shotgun metagenomics, with emphasis on compositional data analysis, diversity metrics, differential abundance, and functional profiling.
Microbiome count data is compositional. Sequencing produces counts that sum to a constant (library size). Each sample's counts represent relative proportions, NOT absolute abundances. This has profound statistical consequences:
You MUST use compositional-aware methods for all statistical analyses. This is not optional — it is a fundamental requirement of the data type. See the Differential Abundance section below for approved methods.
Demultiplexed FASTQ
→ DADA2 (R): filterAndTrim → learnErrors → dada → mergePairs → makeSequenceTable → removeBimeraDenovo
→ ASV table + taxonomy assignment (assignTaxonomy with SILVA for 16S, UNITE for ITS)
→ Import into phyloseq (R) for downstream analysis
Alternative: QIIME2 artifacts
→ Import pre-processed QIIME2 feature table + taxonomy
→ Convert to phyloseq for R-based analysis or pandas DataFrame for Python
removeBimeraDenovo and yields an ASV table, the ASV sequences, and per-step read tracking. Taxonomy assignment is the one step that may not complete — it needs a training set, which is a separate question covered below. QIIME2 is not installed, so that branch is import-only: bring an exported feature table rather than expecting a .qza to be read natively. A pre-computed feature table (BIOM, QIIME2 export, or counts matrix plus taxonomy) is still a perfectly good entry point when that is what you were handed — the rest of this pack (phyloseq, vegan, mia, ANCOM-BC2, ALDEx2, MaAsLin2, biom-format, scikit-bio) runs from it normally.Taxonomic abundance table (species-level relative abundances)
→ Import into phyloseq or pandas
→ Diversity and differential-abundance sections below
Functional abundance table (gene families / pathway abundances)
→ Import into pandas
→ Differential pathway analysis below
Feature table (ASV or species counts)
→ Richness: Chao1 (estimated richness, accounts for unseen species)
→ Evenness + richness: Shannon index (sensitive to rare taxa), Simpson index (weighted toward dominant taxa)
→ Phylogenetic: Faith's PD (incorporates phylogenetic tree, requires rooted tree)
→ Compute via phyloseq estimate_richness() (R)
→ Statistical comparison: Kruskal-Wallis (>2 groups), Wilcoxon (2 groups)
Feature table
→ Distance matrix:
→ Bray-Curtis (abundance-weighted, default)
→ Jaccard (presence/absence only)
→ UniFrac (weighted or unweighted, requires phylogenetic tree)
→ Ordination: PCoA (default) or NMDS (when PCoA stress is high)
→ Statistical testing: PERMANOVA (adonis2 in vegan)
→ Check dispersion: betadisper (PERMANOVA is sensitive to heterogeneous dispersion)
distance() + ordinate() for distance computation and ordination. Use vegan adonis2() for PERMANOVA (supports formula interface with covariates) and betadisper() for dispersion testing.All methods below are compositional-aware. Do NOT substitute with t-test, Wilcoxon, DESeq2, or edgeR.
Cross-sectional study (no repeated measures)
→ ANCOM-BC2 (R) — DEFAULT CHOICE
→ Bias-corrected log-linear model, handles compositionality natively
→ ancombc2() with formula, handles covariates
→ Structural zero detection built-in
Small sample size (n < 10 per group)
→ ALDEx2 (R)
→ CLR transformation + Bayesian Monte Carlo sampling
→ Robust to small samples due to posterior inference
→ aldex() → aldex.ttest() or aldex.kw()
Longitudinal / repeated measures / complex covariates
→ MaAsLin2 (R)
→ Supports random effects for subject-level correlation
→ Maaslin2() with fixed_effects + random_effects
→ CLR or log-transformed relative abundances internally
Functional abundance table (gene families + pathway abundances)
→ Normalize: copies per million (CPM)
→ Differential pathway analysis: same compositional-aware methods as taxonomic data
Should I rarefy?
→ Prefer NOT to rarefy. Modern methods (ANCOM-BC2, ALDEx2, MaAsLin2) handle unequal library sizes internally.
→ If required for legacy compatibility or specific diversity metrics:
→ Rarefy to the minimum library size (or exclude low-depth samples)
→ NEVER rarefy for differential abundance testing — it discards valid data.
propr package are the standard references but neither is installed here; the proportionality statistics they implement are short to compute directly — CLR-transform the counts (log of each value over the sample's geometric mean, after a pseudocount or zero-replacement), then take the correlation of the CLR values, or compute rho proportionality as 1 - var(clr_i - clr_j) / (var(clr_i) + var(clr_j)) in numpy. State which measure you used.var, samples as obs, counts as X.feature_id, kingdom, phylum, class, order, family, genus, species, confidence.taxon, log2FC, se, pvalue, padj, method (ANCOM-BC2/ALDEx2/MaAsLin2).sample_id, shannon, simpson, chao1, faiths_pd.adonis2() for PERMANOVA (formula interface with covariates), diversity() for alpha diversity, vegdist() for distance matrices, metaMDS() for NMDS ordination, betadisper() for dispersion testing.samtools, bcftools, bedtools, tabix — sufficient for everything downstream of a feature table.
Entry points. Amplicon (16S/ITS) starts from demultiplexed FASTQ and runs end to end here via dada2. Shotgun metagenomics starts from a profiled abundance table: taxonomic and functional profiling of shotgun reads is upstream of this pack, so if you were handed raw shotgun FASTQ, say so and stop rather than planning a profiling step.
references/dada2-api.md — DADA2 amplicon sequence variant inference (16S/ITS pipeline)references/phyloseq-api.md — Phyloseq object creation, manipulation, and diversityreferences/vegan-api.md — vegan: beta diversity (vegdist), NMDS (metaMDS), PERMANOVA (adonis2), dispersion (betadisper)references/ancombc-api.md — ANCOM-BC2 compositional differential abundancereferences/aldex2-api.md — ALDEx2 CLR-based differential abundancereferences/maaslin2-api.md — MaAsLin2 longitudinal differential abundancereferences/biom-format-api.md — BIOM file parsing and conversion (Python)