rbims: an R package for integrative functional profiling and pathway-level discrimination in metagenome-assembled genomes
Metagenomics enables the recovery of metagenome-assembled genomes (MAGs), providing access to the metabolic potential of uncultured microbial communities that drive ecosystem function and biogeochemical cycles. However, as MAGs datasets increase in size and complexity, comparing functional repertoires and identifying ecologically meaningful traits across experimental gradients becomes increasingly difficult. Here, we present rbims, a modular R package for integrative functional profiling of MAGs and metagenomic datasets. rbims supports annotations from KEGG, dbCAN, InterProScan, MEROPS, and PICRUSt2, and enables the calculation of gene presence/absence, raw abundance, and pathway coverage, as well as metadata-informed comparative analyses and publication-ready visualizations. Beyond descriptive profiling, rbims implements an exploratory discriminant framework that combines compositional differential analysis (ALDEx2) with random forest–based feature ranking to prioritize candidate metabolic traits associated with environmental factors. Importantly, it extends gene-level analysis to pathway-level directional bias testing, allowing users to evaluate whether the majority of genes within a metabolic route are consistently enriched toward a given condition. We applied rbims to 42 MAGs recovered from a hydrocarbon enrichment experiment in the North Atlantic Ocean. The workflow identified widespread hexadecane and phenanthrene degradation potential, detected enriched oxidoreductase-related protein families, and revealed a strong pathway-level directional bias toward deep-water MAGs for phenanthrene, naphthalene, and hexadecane degradation pathways. By integrating annotation parsing, quantitative trait analysis, statistical discrimination, and visualization in a reproducible framework, rbims provides a user-friendly platform for functional interpretation in genome-resolved metagenomics.