| Title: | Integrative Multi-Omics Analysis for Pan-Cancer Research |
|---|---|
| Description: | A modular and cancer-agnostic framework for integrative analysis of multi-omics data in cancer research. The package provides tools for differential methylation analysis, gene expression analysis, miRNA profiling, multi-omics integration, survival analysis, and biomarker discovery. It supports data from TCGA, cBioPortal, GEO, and user-provided datasets, and is designed to work across any cancer type. |
| Authors: | Maryam Emami [aut, cre] (ORCID: <https://orcid.org/0009-0008-7710-3274>) |
| Maintainer: | Maryam Emami <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.2 |
| Built: | 2026-10-20 10:24:08 UTC |
| Source: | https://github.com/BiocStaging/MultiOmicsCancer |
Performs differential gene expression analysis between tumor and normal
samples (or any two groups defined in the clinical data) for any cancer
type. Supports both limma (for log-transformed or normalized data)
and DESeq2 (for raw count data).
analyze_expression( mae, assay_name = "expression", group_column = "sample_type", group_levels = NULL, method = "limma", log_transform = TRUE, adj_method = "BH", p_cutoff = 0.05, logFC_cutoff = 1, verbose = TRUE )analyze_expression( mae, assay_name = "expression", group_column = "sample_type", group_levels = NULL, method = "limma", log_transform = TRUE, adj_method = "BH", p_cutoff = 0.05, logFC_cutoff = 1, verbose = TRUE )
mae |
A |
assay_name |
Character. Name of the expression assay in the
|
group_column |
Character. Name of the clinical column used to define
groups. Default |
group_levels |
Character vector of length 2. The two groups to compare.
The first is the reference (e.g., normal), the second is the comparison
(e.g., tumor). If |
method |
Character. Method for differential expression. One of
|
log_transform |
Logical. If |
adj_method |
Character. Multiple testing correction method. Default
|
p_cutoff |
Numeric. Adjusted p-value threshold for significance.
Default |
logFC_cutoff |
Numeric. Minimum absolute log2 fold change to call a
gene differentially expressed. Default |
verbose |
Logical. Whether to print progress messages. Default
|
A data frame with the following columns:
Gene identifier
Log2 fold change (group2 - group1)
Average expression across all samples
Moderated t-statistic (limma) or Wald statistic (DESeq2)
Raw p-value
Adjusted p-value
"Up" or "Down" in group2 vs group1
Logical, whether the gene passes both p-value and logFC cutoffs
if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Differential expression: normal vs tumor with limma deg <- analyze_expression(brca, method = "limma") # With DESeq2 on raw counts deg_deseq <- analyze_expression(brca, method = "DESeq2") # Filter significant genes sig_deg <- deg[deg$significant, ] # Lower the logFC cutoff to get more genes (higher sensitivity) deg_sensitive <- analyze_expression(brca, logFC_cutoff = 0.5) # Raise the logFC cutoff for stricter results (higher specificity) deg_strict <- analyze_expression(brca, logFC_cutoff = 1.5) }if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Differential expression: normal vs tumor with limma deg <- analyze_expression(brca, method = "limma") # With DESeq2 on raw counts deg_deseq <- analyze_expression(brca, method = "DESeq2") # Filter significant genes sig_deg <- deg[deg$significant, ] # Lower the logFC cutoff to get more genes (higher sensitivity) deg_sensitive <- analyze_expression(brca, logFC_cutoff = 0.5) # Raise the logFC cutoff for stricter results (higher specificity) deg_strict <- analyze_expression(brca, logFC_cutoff = 1.5) }
Performs differential methylation analysis between tumor and normal samples
(or any two groups defined in the clinical data) for any cancer type. Uses
the limma framework for linear modeling of methylation beta values.
analyze_methylation( mae, assay_name = "methylation", group_column = "sample_type", group_levels = NULL, method = "limma", adj_method = "BH", p_cutoff = 0.05, delta_beta = 0.1, verbose = TRUE )analyze_methylation( mae, assay_name = "methylation", group_column = "sample_type", group_levels = NULL, method = "limma", adj_method = "BH", p_cutoff = 0.05, delta_beta = 0.1, verbose = TRUE )
mae |
A |
assay_name |
Character. Name of the methylation assay in the
|
group_column |
Character. Name of the clinical column used to define
groups. Default |
group_levels |
Character vector of length 2. The two groups to compare.
The first is the reference (e.g., normal), the second is the comparison
(e.g., tumor). If |
method |
Character. Differential methylation method. Currently supports
|
adj_method |
Character. Multiple testing correction method passed to
|
p_cutoff |
Numeric. Adjusted p-value threshold for significance.
Default |
delta_beta |
Numeric. Minimum absolute difference in mean beta value
between groups to call a probe differentially methylated. Default
|
verbose |
Logical. Whether to print progress messages. Default
|
A data frame with the following columns:
Probe or CpG identifier
Difference in mean methylation (group2 - group1)
Average methylation across all samples
Moderated t-statistic
Raw p-value
Adjusted p-value
Absolute difference in mean beta between groups
"Hyper" or "Hypo" methylation in group2 vs group1
Logical, whether the probe passes both p-value and delta-beta cutoffs
if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Differential methylation: normal vs tumor dmr <- analyze_methylation( brca, group_column = "sample_type", group_levels = c("Solid Tissue Normal", "Primary Tumor") ) # Filter significant probes sig_dmr <- dmr[dmr$significant, ] # More sensitive analysis with lower thresholds dmr_sensitive <- analyze_methylation(brca, delta_beta = 0.05, p_cutoff = 0.01) }if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Differential methylation: normal vs tumor dmr <- analyze_methylation( brca, group_column = "sample_type", group_levels = c("Solid Tissue Normal", "Primary Tumor") ) # Filter significant probes sig_dmr <- dmr[dmr$significant, ] # More sensitive analysis with lower thresholds dmr_sensitive <- analyze_methylation(brca, delta_beta = 0.05, p_cutoff = 0.01) }
Performs survival analysis using clinical data and a molecular feature (gene expression, methylation, or a risk score). Supports Kaplan-Meier curves, log-rank tests, and univariate Cox proportional hazards models.
analyze_survival( mae, time_column = "OS.time", event_column = "OS", feature_name = NULL, assay_name = "expression", split_method = "median", verbose = TRUE )analyze_survival( mae, time_column = "OS.time", event_column = "OS", feature_name = NULL, assay_name = "expression", split_method = "median", verbose = TRUE )
mae |
A |
time_column |
Character. Name of the clinical column containing
follow-up time (in days or months). Default |
event_column |
Character. Name of the clinical column containing
event status (1 = event/death, 0 = censored). Default |
feature_name |
Character. Name of the molecular feature to test
(gene symbol or probe ID). If |
assay_name |
Character. Which assay to use for the feature. One of
|
split_method |
Character. How to split samples into high/low groups.
One of |
verbose |
Logical. Whether to print progress messages. Default
|
A list with the following components:
A survfit object for Kaplan-Meier curves
P-value from the log-rank test
A coxph object for univariate Cox regression
Summary table of the Cox model
Data frame used for the analysis
Factor of high/low groups
if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Survival analysis for TP53 expression surv <- analyze_survival(brca, feature_name = "TP53") # Survival analysis for a methylation probe surv_meth <- analyze_survival(brca, feature_name = "cg00000029", assay_name = "methylation") }if (interactive()) { # Load data brca <- load_cancer_data("brca_tcga") # Survival analysis for TP53 expression surv <- analyze_survival(brca, feature_name = "TP53") # Survival analysis for a methylation probe surv_meth <- analyze_survival(brca, feature_name = "cg00000029", assay_name = "methylation") }
Nested Bootstrap Validation for IMS
bootstrap_validate_ims( meth_data, surv_data, immune_genes = NULL, B = 100L, p_threshold = 0.05, min_cpgs = 3L, seed = 123 )bootstrap_validate_ims( meth_data, surv_data, immune_genes = NULL, B = 100L, p_threshold = 0.05, min_cpgs = 3L, seed = 123 )
meth_data |
Matrix of methylation (CpGs x samples). |
surv_data |
Data frame with columns 'time' and 'status'. |
immune_genes |
Character vector of immune gene symbols. |
B |
Integer. Number of bootstrap replicates. Default 100. |
p_threshold |
Numeric. P-value cutoff. Default 0.05. |
min_cpgs |
Integer. Minimum CpGs required. Default 3. |
seed |
Integer. Random seed. Default 123. |
A list with apparent C-index, optimism, corrected C-index, and the bootstrap distribution.
# Source: Mock data simulated for demonstration purposes. set.seed(123) meth_data <- matrix(runif(100), nrow = 10, ncol = 10) rownames(meth_data) <- paste0("CD274_cg", 1:10) colnames(meth_data) <- paste0("Sample", 1:10) surv_data <- data.frame( time = runif(10, 10, 100), status = sample(c(0, 1), 10, replace = TRUE) ) rownames(surv_data) <- colnames(meth_data) res <- bootstrap_validate_ims( meth_data = meth_data, surv_data = surv_data, immune_genes = c("CD274"), B = 5, p_threshold = 1, min_cpgs = 2 )# Source: Mock data simulated for demonstration purposes. set.seed(123) meth_data <- matrix(runif(100), nrow = 10, ncol = 10) rownames(meth_data) <- paste0("CD274_cg", 1:10) colnames(meth_data) <- paste0("Sample", 1:10) surv_data <- data.frame( time = runif(10, 10, 100), status = sample(c(0, 1), 10, replace = TRUE) ) rownames(surv_data) <- colnames(meth_data) res <- bootstrap_validate_ims( meth_data = meth_data, surv_data = surv_data, immune_genes = c("CD274"), B = 5, p_threshold = 1, min_cpgs = 2 )
Build an Immune Methylation Score (IMS)
build_ims( meth_data, surv_data, immune_genes = NULL, p_threshold = 0.05, hr_range = c(0.1, 10), min_cpgs = 3L )build_ims( meth_data, surv_data, immune_genes = NULL, p_threshold = 0.05, hr_range = c(0.1, 10), min_cpgs = 3L )
meth_data |
A matrix of methylation beta values (CpGs x samples). |
surv_data |
A data frame with columns 'time' and 'status'. |
immune_genes |
Character vector of immune gene symbols. If NULL, uses a default 35-gene immune panel. |
p_threshold |
Numeric. P-value threshold for CpG selection. Default 0.05. |
hr_range |
Numeric vector length 2. Allowed HR range. Default c(0.1, 10). |
min_cpgs |
Integer. Minimum CpGs required. Default 3. |
A list with IMS, selected_cpgs, coefs, model.
# Source: Mock data simulated for demonstration purposes. set.seed(123) meth_data <- matrix(runif(100), nrow = 10, ncol = 10) rownames(meth_data) <- paste0("CD274_cg", 1:10) colnames(meth_data) <- paste0("Sample", 1:10) surv_data <- data.frame( time = runif(10, 10, 100), status = sample(c(0, 1), 10, replace = TRUE) ) rownames(surv_data) <- colnames(meth_data) res <- build_ims( meth_data = meth_data, surv_data = surv_data, immune_genes = c("CD274"), p_threshold = 1, hr_range = c(0, 100), min_cpgs = 2 )# Source: Mock data simulated for demonstration purposes. set.seed(123) meth_data <- matrix(runif(100), nrow = 10, ncol = 10) rownames(meth_data) <- paste0("CD274_cg", 1:10) colnames(meth_data) <- paste0("Sample", 1:10) surv_data <- data.frame( time = runif(10, 10, 100), status = sample(c(0, 1), 10, replace = TRUE) ) rownames(surv_data) <- colnames(meth_data) res <- build_ims( meth_data = meth_data, surv_data = surv_data, immune_genes = c("CD274"), p_threshold = 1, hr_range = c(0, 100), min_cpgs = 2 )
Compares prognostic performance of IMS vs a clinical variable (e.g., Stage) using Cox models and likelihood ratio test.
compare_ims_clinical( ims_values, surv_data, clinical_var, var_name = "Clinical" )compare_ims_clinical( ims_values, surv_data, clinical_var, var_name = "Clinical" )
ims_values |
Named numeric vector of IMS values (from build_ims). |
surv_data |
Data frame with columns 'time' and 'status'. |
clinical_var |
Named vector or factor of clinical variable (e.g., Stage_binary) aligned with surv_data rownames. |
var_name |
Character. Name of clinical variable for output labels. |
A list with C-index for IMS alone, clinical alone, both, Delta C-index, and LRT p-value.
# Source: Mock data simulated for demonstration purposes. set.seed(123) n <- 60 ims_values <- setNames(rnorm(n), paste0("Sample", 1:n)) surv_data <- data.frame( time = runif(n, 10, 100), status = sample(c(0, 1), n, replace = TRUE), row.names = names(ims_values) ) clinical_var <- setNames( sample(c("Low", "High"), n, replace = TRUE), names(ims_values) ) res <- compare_ims_clinical( ims_values = ims_values, surv_data = surv_data, clinical_var = clinical_var, var_name = "Stage" )# Source: Mock data simulated for demonstration purposes. set.seed(123) n <- 60 ims_values <- setNames(rnorm(n), paste0("Sample", 1:n)) surv_data <- data.frame( time = runif(n, 10, 100), status = sample(c(0, 1), n, replace = TRUE), row.names = names(ims_values) ) clinical_var <- setNames( sample(c("Low", "High"), n, replace = TRUE), names(ims_values) ) res <- compare_ims_clinical( ims_values = ims_values, surv_data = surv_data, clinical_var = clinical_var, var_name = "Stage" )
Computes ESTIMATE scores (Stromal, Immune, ESTIMATE) and Tumor Purity from gene expression data using the ESTIMATE algorithm. Requires package 'tidyestimate'.
estimate_purity(expr_data, is_affymetrix = FALSE)estimate_purity(expr_data, is_affymetrix = FALSE)
expr_data |
A matrix of gene expression (genes x samples). |
is_affymetrix |
Logical. TRUE if data is from Affymetrix arrays. Default FALSE (RNA-seq). |
A data frame with columns: sample, stromal, immune, estimate, purity.
# Source: Mock data simulated to demonstrate the ESTIMATE algorithm. set.seed(123) expr_mat <- matrix(rnorm(1000), nrow = 100, ncol = 10) rownames(expr_mat) <- paste0("GENE", 1:100) colnames(expr_mat) <- paste0("Sample", 1:10) tryCatch({ res <- estimate_purity(expr_mat) head(res) }, error = function(e) { message("estimate_purity requires 'tidyestimate' package.") })# Source: Mock data simulated to demonstrate the ESTIMATE algorithm. set.seed(123) expr_mat <- matrix(rnorm(1000), nrow = 100, ncol = 10) rownames(expr_mat) <- paste0("GENE", 1:100) colnames(expr_mat) <- paste0("Sample", 1:10) tryCatch({ res <- estimate_purity(expr_mat) head(res) }, error = function(e) { message("estimate_purity requires 'tidyestimate' package.") })
Integrates DNA methylation and gene expression data to identify genes whose expression is significantly correlated with their promoter methylation status. This is a key step in multi-omics analysis for discovering epigenetically regulated genes in any cancer type.
integrate_meth_expr( mae, meth_assay = "methylation", expr_assay = "expression", gene_map = NULL, correlation_method = "pearson", min_samples = 5, p_cutoff = 0.05, cor_cutoff = 0.3, verbose = TRUE )integrate_meth_expr( mae, meth_assay = "methylation", expr_assay = "expression", gene_map = NULL, correlation_method = "pearson", min_samples = 5, p_cutoff = 0.05, cor_cutoff = 0.3, verbose = TRUE )
mae |
A |
meth_assay |
Character. Name of the methylation assay. Default
|
expr_assay |
Character. Name of the expression assay. Default
|
gene_map |
Optional. A data frame mapping methylation probes to genes.
Must have columns |
correlation_method |
Character. Correlation method, one of
|
min_samples |
Integer. Minimum number of samples required for
correlation analysis. Default |
p_cutoff |
Numeric. Adjusted p-value threshold for significance.
Default |
cor_cutoff |
Numeric. Minimum absolute correlation coefficient to
consider a methylation-expression pair significant. Default |
verbose |
Logical. Whether to print progress messages. Default
|
A data frame with the following columns:
Gene identifier
Methylation probe identifier
Correlation coefficient between methylation and expression
Raw p-value of the correlation test
Adjusted p-value (Benjamini-Hochberg)
Number of samples used in the correlation
"Negative" if methylation is inversely correlated with expression (expected for promoter methylation), "Positive" otherwise
Logical, whether the pair passes both p-value and correlation cutoffs
if (interactive()) { # Load multi-omics data brca <- load_cancer_data("brca_tcga", data_types = c("methylation", "expression")) # Integrate methylation and expression integrated <- integrate_meth_expr(brca) # Filter significant negative correlations epi_genes <- integrated[integrated$significant & integrated$regulation == "Negative", ] }if (interactive()) { # Load multi-omics data brca <- load_cancer_data("brca_tcga", data_types = c("methylation", "expression")) # Integrate methylation and expression integrated <- integrate_meth_expr(brca) # Filter significant negative correlations epi_genes <- integrated[integrated$significant & integrated$regulation == "Negative", ] }
Loads multi-omics data for any cancer type from cBioPortal, TCGA, or
user-provided datasets. The function returns a MultiAssayExperiment
object that can be used by all downstream analysis functions in the package.
load_cancer_data( cancer_type, data_types = c("methylation", "expression", "mirna"), source = "cBioPortal", genes = NULL, custom_data = NULL, verbose = TRUE )load_cancer_data( cancer_type, data_types = c("methylation", "expression", "mirna"), source = "cBioPortal", genes = NULL, custom_data = NULL, verbose = TRUE )
cancer_type |
Character. Cancer study identifier. For cBioPortal, use
study IDs such as |
data_types |
Character vector. Omics layers to load. Options include
|
source |
Character. Data source. One of |
genes |
Optional character vector of gene symbols to restrict the
download (e.g., |
custom_data |
Optional. A named list of matrices for custom data.
Names must match |
verbose |
Logical. Whether to print progress messages. Default |
A MultiAssayExperiment object containing the requested omics
layers and associated clinical data.
if (interactive()) { # Load breast cancer data from cBioPortal (all genes) brca <- load_cancer_data("brca_tcga") # Load only selected genes (faster) brca <- load_cancer_data( "brca_tcga", data_types = c("methylation", "expression"), genes = c("TP53", "BRCA1", "BRCA2", "EGFR") ) # Load custom data custom <- load_cancer_data("my_study", source = "custom", custom_data = list(methylation = meth_matrix, expression = expr_matrix)) }if (interactive()) { # Load breast cancer data from cBioPortal (all genes) brca <- load_cancer_data("brca_tcga") # Load only selected genes (faster) brca <- load_cancer_data( "brca_tcga", data_types = c("methylation", "expression"), genes = c("TP53", "BRCA1", "BRCA2", "EGFR") ) # Load custom data custom <- load_cancer_data("my_study", source = "custom", custom_data = list(methylation = meth_matrix, expression = expr_matrix)) }
A collection of publication-quality plotting functions for visualizing
results from differential methylation, differential expression, multi-omics
integration, and survival analysis. All plots are based on ggplot2
and return ggplot objects that can be further customized.
plot_cancer( data = NULL, plot_type = c("volcano", "heatmap", "correlation", "survival"), title = NULL, p_cutoff = 0.05, fc_cutoff = NULL, color_up = "firebrick", color_down = "steelblue", color_ns = "grey70", max_labels = 10, surv_result = NULL, verbose = TRUE )plot_cancer( data = NULL, plot_type = c("volcano", "heatmap", "correlation", "survival"), title = NULL, p_cutoff = 0.05, fc_cutoff = NULL, color_up = "firebrick", color_down = "steelblue", color_ns = "grey70", max_labels = 10, surv_result = NULL, verbose = TRUE )
data |
A data frame returned by |
plot_type |
Character. Type of plot to generate. One of
|
title |
Optional. Plot title. If |
p_cutoff |
Numeric. Adjusted p-value threshold for highlighting
significant features. Default |
fc_cutoff |
Numeric. Log fold change or delta-beta threshold for
highlighting significant features. Default |
color_up |
Character. Color for upregulated/hypermethylated features.
Default |
color_down |
Character. Color for downregulated/hypomethylated features.
Default |
color_ns |
Character. Color for non-significant features.
Default |
max_labels |
Integer. Maximum number of labels to display on volcano
plots. Default |
surv_result |
Optional. A list returned by |
verbose |
Logical. Whether to print progress messages. Default
|
A ggplot object.
if (interactive()) { # Volcano plot of differential expression deg <- analyze_expression(brca) plot_cancer(deg, plot_type = "volcano") # Volcano plot of differential methylation dmr <- analyze_methylation(brca) plot_cancer(dmr, plot_type = "volcano") # Survival plot surv <- analyze_survival(brca, feature_name = "TP53") plot_cancer(plot_type = "survival", surv_result = surv) }if (interactive()) { # Volcano plot of differential expression deg <- analyze_expression(brca) plot_cancer(deg, plot_type = "volcano") # Volcano plot of differential methylation dmr <- analyze_methylation(brca) plot_cancer(dmr, plot_type = "volcano") # Survival plot surv <- analyze_survival(brca, feature_name = "TP53") plot_cancer(plot_type = "survival", surv_result = surv) }
Validates genes using UniProt (protein existence).
validate_proteins(genes, use_uniprot = TRUE, timeout = 30)validate_proteins(genes, use_uniprot = TRUE, timeout = 30)
genes |
Character vector of gene symbols. |
use_uniprot |
Logical. Query UniProt? Default TRUE. |
timeout |
Numeric. HTTP timeout in seconds. Default 30. |
A data frame with columns: gene, protein_exists, protein_name.
# Source: Mock data for offline demonstration. genes <- c("BRCA1", "TP53", "CD274") res <- validate_proteins(genes, use_uniprot = FALSE) head(res)# Source: Mock data for offline demonstration. genes <- c("BRCA1", "TP53", "CD274") res <- validate_proteins(genes, use_uniprot = FALSE) head(res)