cyanea-meta
v0.1.2 AnalysisFrom reads to community structure — taxonomy, diversity, and composition.
Metagenomics — k-mer LCA taxonomy, community profiling, alpha/beta diversity, compositional analysis, binning, and assembly QC.
Overview
cyanea-meta turns sequencing reads and assemblies into community-level insight. It covers the metagenomics pipeline end to end: taxonomic assignment, community profiling, diversity analysis, compositional statistics, contig binning, and assembly quality control.
Microbiome data is compositional — abundances sum to a constant, so raw counts are misleading. The crate treats this as a first-class concern, providing log-ratio transforms and compositional differential-abundance tests rather than naive count comparisons.
Key Concepts
Taxonomy and LCA
Reads are classified by matching k-mers against a reference and resolving conflicts with a lowest-common-ancestor rule: when a k-mer maps to several taxa, the assignment climbs to the most specific shared ancestor. This trades resolution for robustness against ambiguous or contaminated references.
Diversity
Alpha diversity summarizes a single sample (Shannon, Simpson, observed richness). Beta diversity compares samples pairwise (Bray-Curtis, Jaccard, UniFrac), producing the distance matrices that feed ordination and clustering.
Compositional Analysis
CLR and ILR transforms move counts into an unconstrained space where standard statistics behave. ALDEx2 and ANCOM build on this to test differential abundance while respecting the compositional structure of the data.
Binning and Assembly QC
Contigs are grouped into putative genomes using tetranucleotide frequency and coverage signals. Assembly quality is summarized with N50, auN, and length distributions.
Code Examples
Rust
use cyanea_meta::{profile_community, alpha_diversity, DiversityMetric};
let profile = profile_community(&assignments);
let shannon = alpha_diversity(&counts, DiversityMetric::Shannon);
JavaScript (WASM)
import { alpha_diversity, beta_diversity } from '/wasm/cyanea_wasm.js';
const shannon = alpha_diversity(JSON.stringify(counts), "shannon");
const dist = JSON.parse(beta_diversity(JSON.stringify(samples), "bray_curtis"));
Use Cases
- Microbiome surveys — Profile communities and compare diversity across conditions.
- Differential abundance — Identify taxa that shift between groups without compositional artifacts.
- Metagenome-assembled genomes — Bin contigs and assess assembly completeness.