High-Performance Genome-Scale Metabolic Flux Analysis for Bulk and Single-Cell Transcriptomics
📖 Documentation: https://zaoqu-liu.github.io/METAFlux/
Abstract
METAFLUX is a computationally optimized R package for genome-scale metabolic flux analysis (MFA) from bulk and single-cell RNA sequencing data. Building upon the theoretical framework of METAFlux (Huang et al., Nature Communications, 2023), this implementation leverages the Human Genome-scale Metabolic model (Human-GEM) to infer 13,082 intracellular metabolic reaction fluxes through constraint-based flux balance analysis (FBA).
The package provides: - Metabolic Reaction Activity Scores (MRAS) derived from gene expression profiles - Flux Balance Analysis (FBA) via quadratic programming optimization - Community metabolic modeling for single-cell tumor microenvironment analysis - Cross-platform compatibility with optimized parallel computing
Theoretical Background
Flux Balance Analysis
METAFLUX employs constraint-based metabolic modeling to predict intracellular fluxes. The steady-state assumption yields:
where is the stoichiometric matrix (8,378 metabolites × 13,082 reactions) and is the flux vector. The optimization objective maximizes biomass production:
Installation
From R-universe (Recommended)
install.packages("METAFLUX", repos = "https://zaoqu-liu.r-universe.dev")From GitHub
# install.packages("remotes")
remotes::install_github("Zaoqu-Liu/METAFLUX")Dependencies
# Core dependencies
install.packages(c("osqp", "Matrix", "dplyr", "stringr", "stringi"))
# For single-cell analysis
install.packages("Seurat") # Version ≥ 4.0.0
# For parallel computing
install.packages(c("parallel", "foreach", "doParallel"))Quick Start
Bulk RNA-seq Pipeline
library(METAFLUX)
# Load example data
data("bulk_test_example") # Gene expression matrix
data("human_blood") # Nutrient medium composition
# Step 1: Calculate Metabolic Reaction Activity Scores (MRAS)
mras <- calculate_reaction_score(bulk_test_example)
# Step 2: Compute metabolic fluxes via FBA
flux <- compute_flux(mras = mras, medium = human_blood)
# Analyze specific pathways
glycolysis_flux <- flux[grep("glycolysis", rownames(flux), ignore.case = TRUE), ]Single-Cell RNA-seq Pipeline
library(METAFLUX)
# Load Seurat object and medium
data("sc_test_example")
data("human_blood")
# Step 1: Bootstrap aggregation for noise reduction
avg_expr <- calculate_avg_exp(
myseurat = sc_test_example,
myident = "Cell_type",
n_bootstrap = 100,
seed = 42
)
# Step 2: Calculate MRAS
mras <- calculate_reaction_score(avg_expr)
# Step 3: Define cell type fractions
fractions <- as.numeric(table(sc_test_example$Cell_type) / ncol(sc_test_example))
# Step 4: Community-based flux calculation
flux <- compute_sc_flux(
num_cell = length(unique(sc_test_example$Cell_type)),
fraction = fractions,
fluxscore = mras,
medium = human_blood,
parallel = TRUE,
n_cores = 4
)Data Requirements
Input Data
| Data Type | Format | Requirements |
|---|---|---|
| Bulk RNA-seq | Matrix/Data frame | Rows: HGNC gene symbols; Columns: samples; Values: normalized expression (TPM/FPKM) |
| Single-cell | Seurat object | RNA assay with normalized counts; metadata with cell type annotations |
| Medium | Data frame | Columns: metabolite, reaction_name
|
Output Interpretation
Performance
Computational benchmarks on Intel i7-10700K (8 cores), 32GB RAM:
| Analysis Type | Dataset Size | Execution Time |
|---|---|---|
| Bulk RNA-seq | 100 samples | ~2 min |
| Bulk RNA-seq | 500 samples | ~10 min |
| Single-cell | 5,000 cells × 4 types | ~4 min |
| Single-cell | 10,000 cells × 8 types | ~15 min |
Citation
If you use METAFLUX in your research, please cite:
Huang Y, Mohanty V, Dede M, Tsai K, Daher M, Li L, Rezvani K, Chen K. Characterizing cancer metabolism from bulk and single-cell RNA-seq data using METAFlux. Nature Communications 14, 4883 (2023). https://doi.org/10.1038/s41467-023-40457-w
@article{huang2023metaflux,
title={Characterizing cancer metabolism from bulk and single-cell RNA-seq data using METAFlux},
author={Huang, Yuefan and Mohanty, Vakul and Dede, Merve and Tsai, Kyle and Daher, May and Li, Li and Rezvani, Katayoun and Chen, Ken},
journal={Nature Communications},
volume={14},
number={1},
pages={4883},
year={2023},
publisher={Nature Publishing Group},
doi={10.1038/s41467-023-40457-w}
}License
MIT License © 2024-2026 Zaoqu Liu
Original METAFlux © 2023 Yuefan Huang, Ken Chen Lab, MD Anderson Cancer Center
Acknowledgments
This package builds upon the foundational work of the Ken Chen Laboratory at MD Anderson Cancer Center. We acknowledge the Human-GEM consortium for providing the genome-scale metabolic model.
