OmniCorr is an R package–style framework for correlation-based integration and visualization of multi-omics datasets, including transcriptomics, metatranscriptomics, metagenomics, metaproteomics, and associated sample metadata. The framework is designed to facilitate interpretable, feature-level comparison across omics layers and to generate aligned heatmap visualizations highlighting putative cross-omics associations.
OmniCorr focuses on:
-
Computing pairwise correlations between independently processed omics layers
-
Organizing correlation results in a reproducible data structure
-
Visualizing correlations using aligned, hierarchical heatmaps
OmniCorr is not a preprocessing or network inference pipeline. Instead, it assumes that each omics layer has already been processed using appropriate domain-specific workflows (e.g. WGCNA for transcriptomics). This design ensures flexibility and interoperability with existing bioinformatics pipelines. With some modifications to the input datasets, this code can be adapted to work with different omics data types. For example, in Step 3, users can substitute in their own data frames to calculate correlations between different datasets. Additionally, the color schemes used in the heatmaps can be adjusted to best suit the user's data.
Before using OmniCorr, users should ensure that:
-
Each omics dataset has been independently preprocessed
-
Samples are matched across datasets
-
Input matrices are numeric with samples as rows and features as columns
-
Feature-level summaries (e.g. hub genes, pathways, taxa) are provided as input
OmniCorr has been peer-reviewed and published in Bioinformatics Advances.
OmniCorr: correlation-based integration and visualization of multi-omics datasets.
Bioinformatics Advances (2026).
https://academic.oup.com/bioinformaticsadvances/advance-article/doi/10.1093/bioadv/vbag057/8488725
If you use OmniCorr in your research, please cite this article.
Install R (version >= 3.6.0) and RStudio (optional)
Some dependencies are available via Bioconductor:
# Install Bioconductor packages
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("impute", "preprocessCore", "GO.db", "ComplexHeatmap"))Install required CRAN packages:
install_pak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
packages <- c("ggplot2", "WGCNA", "pheatmap", "RColorBrewer", "cowplot", "devtools")
install_pak(packages)devtools::install_github("shashank-KU/OmniCorr")wget https://github.com/shashank-KU/OmniCorr/archive/refs/heads/master.zip
unzip master.zip
mv OmniCorr-master/ OmniCorr
R CMD INSTALL OmniCorrlibrary(OmniCorr)
data(Metagenomics)
data(Transcriptomics)
data(Metatranscriptomics)The example datasets included in OmniCorr are derived from typical upstream omics analysis workflows.
Metatranscriptomics input is generated from:
-
blockwiseModules()(WGCNA) for module detection -
chooseTopHubInEachModule()for hub feature selection The resulting object contains module-level summaries and representative hub features. Other omics layers (e.g. metagenomics) may originate from functional annotation or pathway profiling pipelines. OmniCorr does not enforce a specific preprocessing strategy.
All datasets must contain identical samples in the same order.
Check sample alignment:
table(rownames(Transcriptomics) == rownames(Metagenomics))
If sample order differs, use the helper function:
df_list <- CheckSampleOrder(Transcriptomics, Metagenomics)
Transcriptomics <- df_list[[1]]
Metagenomics <- df_list[[2]]OmniCorr can be used in two complementary ways, depending on the level of control required:
| Workflow | Description | Best for |
|---|---|---|
| Manual workflow | Users perform clustering, correlation calculation, and heatmap construction step-by-step using individual OmniCorr helper functions. | Maximum control, method development, or custom visualization pipelines |
| Fully automated workflow | A single function run_omnicorr() performs the entire integration pipeline automatically. |
Fast analysis, reproducible workflows, and standard analyses |
The following steps use OmniCorr to integrate transcriptomics and metagenomics data and visualize the results. First perform hierarchical clustering of transcriptomics
dendro <- hclust(as.dist(1 - WGCNA::bicor(Transcriptomics, maxPOutliers = 0.05)), method = "ward.D2")tx_heatmap <- pheatmap::pheatmap(
t(Transcriptomics),
cluster_rows = dendro,
cluster_cols = FALSE,
show_rownames = FALSE,
main = "Transcriptomics"
)This heatmap provides the structural backbone for aligning downstream correlation heatmaps.
Use the calculate_correlations() function from OmniCorr to calculate Pearson correlations between the transposed transcriptomics data and the metagenomics data
corr_mg <- calculate_correlations(
df1 = Transcriptomics,
df2 = Metagenomics,
show_significance = "stars"
)
corr_mt <- calculate_correlations(
df1 = Transcriptomics,
df2 = Metatranscriptomics,
show_significance = "stars"
)Each call returns:
-
correlation matrix
-
p-values
-
significance annotations
Create a color ramp for the heatmap using colorRampPalette()
Generate a heatmap of the correlations using pheatmap() with the dendrogram from Step 1, the color ramp, and no row tree
Add significant correlations to the heatmap using the display_numbers parameter from pheatmap()
heatmap_colors <- colorRampPalette(
rev(RColorBrewer::brewer.pal(6, "RdBu"))
)(51)
hm_mg <- pheatmap::pheatmap(
corr_mg$correlation,
color = heatmap_colors,
cluster_rows = dendro,
cluster_cols = F,
display_numbers = corr_mg$signif_matrix,
breaks = seq(-1, 1, length.out = 51),
show_rownames = FALSE,
legend = FALSE,
main = "Metagenomics")
hm_mt <- pheatmap::pheatmap(
corr_mt$correlation,
color = heatmap_colors,
cluster_rows = dendro,
cluster_cols = F,
display_numbers = corr_mt$signif_matrix,
breaks = seq(-1, 1, length.out = 51),
show_rownames = TRUE,
legend = TRUE,
main = "Metatranscriptomics")Use the plot_grid() function from the cowplot package to combine the two heatmaps into a single figure with two columns
Set the relative widths of the two columns using the rel_widths parameter
Adjust the margins of the plot using ggplot2::theme() with the plot.margin parameter
cowplot::plot_grid(
tx_heatmap$gtable,
hm_mg$gtable,
hm_mt$gtable,
ncol = 3,
align = "h",
rel_widths = c(3, 1, 2)
) +
ggplot2::theme(
plot.margin = ggplot2::unit(c(1,1,1,1), "cm")
)
OmniCorr can correlate omics features with phenotypic or environmental variables.
data(metadata)
all(row.names(metadata) == row.names(Transcriptomics))
corr_meta <- calculate_correlations(
df1 = Transcriptomics,
df2 = metadata,
use = "pairwise.complete.obs", # default is "all.obs"
show_significance = "stars" # Possible other values are "p_value" or "correlation"
)hm_meta <- pheatmap::pheatmap(
corr_meta$correlation,
color = heatmap_colors,
cluster_rows = dendro,
cluster_cols = F,
display_numbers = corr_meta$signif_matrix,
breaks = seq(-1, 1, length.out = 51),
show_rownames = FALSE,
legend = FALSE,
main = "Environmental Variables")cowplot::plot_grid(
hm_meta$gtable, # External heatmap correlation
tx_heatmap$gtable, # Transcriptomics heatmap correlation
hm_mg$gtable, # Metagenomics heatmap correlation
hm_mt$gtable, # Metatranscriptomics heatmap correlation
ncol = 4,
align = "h",
rel_widths = c(1.5, 3.5, 1, 2))OmniCorr provides a single high-level function, run_omnicorr(), that performs the complete integration workflow automatically.
No manual clustering, dendrogram creation, heatmap alignment, or p-value formatting is required.
The function internally performs:
-
Sample alignment validation
-
Reference feature clustering (optional, enabled by default)
-
Pairwise cross-omics correlation calculation
-
Multiple testing correction (FDR by default)
-
Significance annotation (stars, p-values, or correlations)
-
Construction of aligned multi-panel heatmaps
Run the full integration with one command:
run_omnicorr(
reference_layer = Transcriptomics,
reference_name = "Transcriptomics",
comparison_layers = list(
Metagenomics = Metagenomics,
Metatranscriptomics = Metatranscriptomics
),
metadata = metadata
)
Any omics dataset can be used as the reference layer. For example, to use metatranscriptomics as the reference:
run_omnicorr(
reference_layer = Metatranscriptomics,
reference_name = "Metatranscriptomics",
comparison_layers = list(
Transcriptomics = Transcriptomics,
Metagenomics = Metagenomics
),
metadata = metadata
)Any omics dataset can be used as the reference layer. For example, to use metatranscriptomics as the reference:
run_omnicorr(
reference_layer = Transcriptomics,
reference_name = "Transcriptomics",
comparison_layers = list(
Metagenomics = Metagenomics,
Metatranscriptomics = Metatranscriptomics
)
)Any omics dataset can be used as the reference layer. For example, to use metatranscriptomics as the reference:
run_omnicorr(
reference_layer = Transcriptomics,
reference_name = "Host Gene Expression",
comparison_layers = list(
Microbiome = Metagenomics,
Microbial_Activity = Metatranscriptomics
),
metadata = metadata,
metadata_name = "Environmental Variables"
)OmniCorr supports multiple correlation methods.
run_omnicorr(
reference_layer = Transcriptomics,
comparison_layers = list(
Metagenomics = Metagenomics,
Metatranscriptomics = Metatranscriptomics
),
metadata = metadata,
method = "spearman"
)run_omnicorr(
reference_layer = Transcriptomics,
comparison_layers = list(
Metagenomics = Metagenomics,
Metatranscriptomics = Metatranscriptomics
),
metadata = metadata,
method = "kendall"
)Users can control whether row or column labels are shown.
run_omnicorr(
reference_layer = Transcriptomics,
comparison_layers = list(
Metagenomics = Metagenomics,
Metatranscriptomics = Metatranscriptomics
),
metadata = metadata,
show_row_names = FALSE,
show_column_names = TRUE
)
