| Title: | Calculate EMT Scores Based on Omics Data |
|---|---|
| Description: | Epithelial-mesenchymal transition (EMT) is an important form of cellular plasticity that is fully or partially activated in several biological scenarios including development and disease progression. EMT involves altered expression of hundreds of protein-coding and non-protein-coding genes. Recent studies showed the prevalence of partial EMT in multiple processes such as various cancers and organ fibrosis, which necessitates rigorous quantification of the degree of EMT. While traditional gene set scoring methods such as gene set variation analysis have been used to generate EMT scores from omics data, multiple EMT scoring algorithms and EMT gene sets have been used by different groups without standardization. Furthermore, comparisons of EMT scores computed from different methods and/or different EMT gene sets are generally difficult due to both the context dependent nature of EMT and the lack of tools that comprehensively integrate varying components for EMT scoring. To address this problem, EMTscore enables users to select scoring methods from a list of previously used algorithms and EMT gene sets from a list of gene sets produced from different experiments. Several visualization methods are provided for making publication-quality plots of EMT scores from omics data. The package also implements a principal-component-analysis based method for scoring divergent EMT processes from a single dataset. Overall, EMTscore provides an integrated solution for assessing the degree and complexity of EMT from omics data, and paves the way for standardizing the comparison of EMT programs across multiple contexts. |
| Authors: | Haimei Wen [aut, cre] (ORCID: <https://orcid.org/0009-0006-1600-1210>), Daniel Lopez [aut], Tian Hong [aut], National Institutes of Health [fnd] (grant: R35GM149531), National Science Foundation [fnd] (grant: 2243562) |
| Maintainer: | Haimei Wen <[email protected]> |
| License: | GPL-3 |
| Version: | 0.99.10 |
| Built: | 2026-10-11 15:53:49 UTC |
| Source: | https://github.com/bioc/EMTscore |
This function calculates epithelial-mesenchymal transition (EMT) scores
for one or more single-cell objects using multiple scoring methods.
Supported methods include "Seurat", "nnPCA", "AUCell",
"GSVA", "ssGSEA", "SCSE", and "JASMINE".
add_EMT_score( objects, gmt_file, emt_name = "EMT_Score", method = c("Seurat", "nnPCA", "AUCell", "GSVA", "ssGSEA", "SCSE", "JASMINE"), nnPCA_dim = 1 )add_EMT_score( objects, gmt_file, emt_name = "EMT_Score", method = c("Seurat", "nnPCA", "AUCell", "GSVA", "ssGSEA", "SCSE", "JASMINE"), nnPCA_dim = 1 )
objects |
A named list of Seurat or SingleCellExperiment objects that have already been loaded in the R session. |
gmt_file |
Character string. Path to a GMT file containing EMT gene sets. |
emt_name |
Character string. Name of the EMT score column to add. |
method |
Character string. Scoring method to use. One of:
|
nnPCA_dim |
Integer. Dimension for nnPCA (default = 1). |
A named list of Seurat objects with a new metadata column containing EMT scores.
library(ExperimentHub) eh <- ExperimentHub() A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objects <- list(A549_TGFB1 = A549_TGFB1) res <- add_EMT_score(objects, gmt_file, emt_name = "EMT_Score", method = "AUCell" )library(ExperimentHub) eh <- ExperimentHub() A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objects <- list(A549_TGFB1 = A549_TGFB1) res <- add_EMT_score(objects, gmt_file, emt_name = "EMT_Score", method = "AUCell" )
Calculate EMT (epithelial-mesenchymal transition) scores for bulk RNA-seq expression data. The function accepts a single expression matrix (rows = genes, columns = samples) or a named list of such matrices, and computes EMT scores for each sample using one of the supported scoring methods.
add_EMT_score_Bulk( expr_mat_list, gmt_file = NULL, emt_name, method = c("nnPCA", "AUCell", "ssGSEA", "SCSE", "GSVA", "JASMINE"), dimension )add_EMT_score_Bulk( expr_mat_list, gmt_file = NULL, emt_name, method = c("nnPCA", "AUCell", "ssGSEA", "SCSE", "GSVA", "JASMINE"), dimension )
expr_mat_list |
A matrix/data.frame (rows = genes, cols = samples) **or** a named list of such matrices. If a single matrix is provided it will be processed and a data.frame of scores returned. If a list is provided, each element will be processed and a named list of data.frames will be returned. |
gmt_file |
Character. Path to a GMT file (gene sets). The GMT should contain EMT-related genes used by the scoring functions. |
emt_name |
Character. Column name to use for the EMT score in the
returned data.frames. Default: |
method |
Character. One of |
dimension |
Integer. Number of components for nnPCA (only used when
|
Supported methods:
"nnPCA" - non-negative sparse PCA (via nsprcomp)
"AUCell" - AUCell AUC scoring
"ssGSEA" - single-sample GSEA
"GSVA"
"SCSE" - Single-Cell Signature Explorer (adapted)
"JASMINE" - JASMINE scoring
- The function expects gene names as rownames(mat) and sample names as
colnames(mat). It will coerce inputs to numeric matrices internally.
- If none of the GMT genes are present in a matrix a warning is issued and
that matrix returns NULL in the result list.
- The scoring helpers (Execute_nnPCA, Execute_AUCell,
Execute_ssGSEA, Execute_SCSE, Execute_JAS) are assumed
available in the package namespace (or the environment) and must return a
data.frame with sample rows and the score column name given in
score_names.
If a single matrix is provided, a data.frame with rownames =
sample names and one column named after emt_name containing EMT
scores. If a list of matrices is provided, a named list of such
data.frames (one per input matrix) is returned.
# single matrix data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") res <- add_EMT_score_Bulk( expr_mat_list = list(s = geneExp), gmt_file, emt_name = "EMT", method = "AUCell", dimension = 1 ) # multiple matrices (named list) exprs <- list(TCGA = geneExp, GTEX = geneExp) res_list <- add_EMT_score_Bulk( expr_mat_list = exprs, gmt_file, emt_name = "EMT", method = "nnPCA", dimension = 1 )# single matrix data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") res <- add_EMT_score_Bulk( expr_mat_list = list(s = geneExp), gmt_file, emt_name = "EMT", method = "AUCell", dimension = 1 ) # multiple matrices (named list) exprs <- list(TCGA = geneExp, GTEX = geneExp) res_list <- add_EMT_score_Bulk( expr_mat_list = exprs, gmt_file, emt_name = "EMT", method = "nnPCA", dimension = 1 )
Computes EMT-related scores for multiple gene sets defined in a GMT file.
add_EMT_score_multiple( objects, gmt_file, emt_names = NULL, method = c("Seurat", "nnPCA", "AUCell", "ssGSEA", "GSVA", "SCSE", "JASMINE"), nnPCA_dim = 1, cores = 1 )add_EMT_score_multiple( objects, gmt_file, emt_names = NULL, method = c("Seurat", "nnPCA", "AUCell", "ssGSEA", "GSVA", "SCSE", "JASMINE"), nnPCA_dim = 1, cores = 1 )
objects |
A named list of Seurat or SingleCellExperiment objects already in memory. |
gmt_file |
Character string. Path to GMT file with multiple gene sets. |
emt_names |
Character vector. Column names to assign to the resulting EMT scores. |
method |
Character string. Scoring method. |
nnPCA_dim |
Integer. Dimension used in nnPCA. |
cores |
Integer. Number of CPU cores for parallel computation. |
A named list of Seurat objects with multiple EMT score columns added.
library(ExperimentHub) eh <- ExperimentHub() A549_TNF <- eh[["EH10291"]] A549_EGF <- eh[["EH10292"]] A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objects <- list(A549_TGFB1 = A549_TGFB1, A549_EGF = A549_EGF, A549_TNF = A549_TNF) EMscore_result <- add_EMT_score_multiple(objects, gmt_file, emt_names = c("Escore", "Mscore"), method = "nnPCA", nnPCA_dim = 1, cores = 2 )library(ExperimentHub) eh <- ExperimentHub() A549_TNF <- eh[["EH10291"]] A549_EGF <- eh[["EH10292"]] A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objects <- list(A549_TGFB1 = A549_TGFB1, A549_EGF = A549_EGF, A549_TNF = A549_TNF) EMscore_result <- add_EMT_score_multiple(objects, gmt_file, emt_names = c("Escore", "Mscore"), method = "nnPCA", nnPCA_dim = 1, cores = 2 )
Arrange multiple ggplot objects with subtitles and common legend
Arrange_plots( plots_list, ncol_per_row = 2, subtitles = NULL, fig_title = NULL, common_legend = TRUE, legend_position = "bottom" )Arrange_plots( plots_list, ncol_per_row = 2, subtitles = NULL, fig_title = NULL, common_legend = TRUE, legend_position = "bottom" )
plots_list |
List of ggplot objects. |
ncol_per_row |
Number of plots per row. |
subtitles |
Optional vector of subtitles (bold). |
fig_title |
Optional main figure title. |
common_legend |
Logical, whether to use a common legend. |
legend_position |
Position of the legend ("bottom", "right", etc.). |
Combined ggplot object.
Sample-level annotation for the cell lines in geneExp, mapping
each sample name to its data source and epithelial/mesenchymal cell-type
label. Used to demonstrate the plotting helpers.
data(cell_annotation_file)data(cell_annotation_file)
A data.frame with 118 rows and 3 columns: name (sample
identifier, matching the columns of geneExp), source (data
source, e.g. CCLE), and celltype_annotation (E/M state label).
Sample-level annotation accompanying the cell-line expression matrix
deposited at Zenodo, doi:10.5281/zenodo.19487376, subset to the samples
retained in geneExp.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(cell_annotation_file)data(cell_annotation_file)
This function computes signature scores using Spearman correlation between a predefined gene signature and expression data. It supports both bulk expression matrices and Seurat objects.
compute_Signature_score(data, signature_file, score_name)compute_Signature_score(data, signature_file, score_name)
data |
A bulk gene expression matrix (row names are gene names, and the column names are sample) or a Seurat object. |
signature_file |
Path to the signature weight file (two-column .tsv file). |
score_name |
Character string. The name to assign to the resulting score column. |
A numeric matrix (for bulk input) or a Seurat object with a new metadata column (for Seurat input).
data(geneExp) signature_file <- system.file("extdata", "stemsig.tsv", package = "EMTscore") compute_Signature_score(geneExp, signature_file, "Stemness_Score")data(geneExp) signature_file <- system.file("extdata", "stemsig.tsv", package = "EMTscore") compute_Signature_score(geneExp, signature_file, "Stemness_Score")
This function calculates one or more gene signature scores for single-cell datasets stored as Seurat or SingleCellExperiment (SCE) objects. Each score is computed using Spearman correlation between gene expression profiles and signature weights, followed by min-max normalization. The resulting scores are added to the Seurat object metadata.
compute_Signature_score_SingleCell(objects, signature_files, score_names)compute_Signature_score_SingleCell(objects, signature_files, score_names)
objects |
A named list of Seurat or SingleCellExperiment objects Each file will be read, updated, and annotated with computed signature scores. |
signature_files |
A character vector of paths to signature weight files (two-column '.tsv' or '.txt' files with gene symbols and weights). Multiple files can be provided. |
score_names |
A character vector of names for the resulting score columns. Must have the same length as 'signature_files'. |
Each signature score is calculated by computing the Spearman correlation between the normalized expression of genes and their corresponding signature weights. The resulting scores are then scaled to a 0-1 range and stored in the Seurat object metadata under the specified names.
A named list of Seurat objects, each containing new metadata columns corresponding to the computed signature scores.
obj <- system.file("extdata", "example_seurat_obj.rds", package = "EMTscore") obj1 <- readRDS(obj) files <- c(test = obj1) signature_file1 <- system.file("extdata", "stemsig.tsv", package = "EMTscore") signature_file2 <- system.file("extdata", "cellular_senescence_sig.tsv", package = "EMTscore") signature_files <- c(signature_file1, signature_file2) result <- compute_Signature_score_SingleCell(files, signature_files, score_names = c("Stemness_Score", "Senescence_Score") )obj <- system.file("extdata", "example_seurat_obj.rds", package = "EMTscore") obj1 <- readRDS(obj) files <- c(test = obj1) signature_file1 <- system.file("extdata", "stemsig.tsv", package = "EMTscore") signature_file2 <- system.file("extdata", "cellular_senescence_sig.tsv", package = "EMTscore") signature_files <- c(signature_file1, signature_file2) result <- compute_Signature_score_SingleCell(files, signature_files, score_names = c("Stemness_Score", "Senescence_Score") )
This function calculates pairwise correlations between all numeric columns of two input dataframes that contain sample-level scores (e.g., pathway, signature, or module scores). The correlation is computed only for samples (rows) shared by both dataframes.
correlate_sample_scores(score_mat1, score_mat2, method = "pearson")correlate_sample_scores(score_mat1, score_mat2, method = "pearson")
score_mat1 |
A dataframe or matrix of sample-level scores. Each row represents a sample, and each column represents a pathway or signature. |
score_mat2 |
Another dataframe or matrix of sample-level scores with matching sample row names. |
method |
Correlation method, one of |
This function is designed for comparing pathway, EMT, or signature scores across samples. It finds the intersection of sample names (row names) between the two dataframes and performs correlation analysis between every pair of numeric score columns.
A dataframe containing:
Column name from score_mat1
Column name from score_mat2
Correlation coefficient
P-value of the correlation test
Number of non-missing paired samples used in the test
set.seed(1) ids <- paste0("sample", seq_len(20)) score_mat1 <- data.frame(PathwayA = rnorm(20), PathwayB = rnorm(20), row.names = ids) score_mat2 <- data.frame(EMT = rnorm(20), row.names = ids) correlate_sample_scores(score_mat1, score_mat2, method = "pearson")set.seed(1) ids <- paste0("sample", seq_len(20)) score_mat1 <- data.frame(PathwayA = rnorm(20), PathwayB = rnorm(20), row.names = ids) score_mat2 <- data.frame(EMT = rnorm(20), row.names = ids) correlate_sample_scores(score_mat1, score_mat2, method = "pearson")
A data frame combining cell annotations with computed scores, ready to be passed to the plotting helpers.
data(data_for_plot)data(data_for_plot)
A data frame (rows = cells/samples) of annotations and scores.
Precomputed example object built with data_prepare by
merging cell_annotation_file with nnPCA scores computed from
the bundled geneExp matrix.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(data_for_plot)data(data_for_plot)
Merge cell annotation and score result, and set rownames based on a user-specified column.
data_prepare(cell_annotation_file, score_result, merge_colname)data_prepare(cell_annotation_file, score_result, merge_colname)
cell_annotation_file |
A data.frame containing cell annotation. |
score_result |
A data.frame or matrix of computed scores (nnPCA, AUCell, etc.). |
merge_colname |
Character, the column of cell_annotation_file to use as row names. |
A data.frame ready for plotting.
data(cell_annotation_file) data(nnPCA_Result_multiple) data_for_plot <- data_prepare(cell_annotation_file, nnPCA_Result_multiple, merge_colname = "name")data(cell_annotation_file) data(nnPCA_Result_multiple) data_for_plot <- data_prepare(cell_annotation_file, nnPCA_Result_multiple, merge_colname = "name")
Read a GMT file and compute EMT scores for a gene expression matrix.
Execute_AUCell(exprMatrix, Genesets, score_names)Execute_AUCell(exprMatrix, Genesets, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
score_names |
Character string. Column name for the scores. |
Data frame of samples with AUCell scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_AUCell(geneExp, gmt_file, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_AUCell(geneExp, gmt_file, score_names = "score")
This function computes AUCell scores for each gene set in a GMT file using a given gene expression matrix (genes as rows, samples as columns). It runs in parallel across multiple cores and returns a combined data frame of AUCell scores for all pathways.
Execute_AUCell_parallel(exprMatrix, gmt_file, cores)Execute_AUCell_parallel(exprMatrix, gmt_file, cores)
exprMatrix |
Numeric matrix or data frame of gene expression, where row names are genes and column names are samples. |
gmt_file |
Character string. Path to the GMT file containing gene sets. |
cores |
Integer. Number of CPU cores to use for parallel processing. |
A data frame containing AUCell scores for each pathway across samples.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_AUCell_parallel(geneExp, gmt_file, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_AUCell_parallel(geneExp, gmt_file, cores = 1)
Scatter plot of E vs M scores with mean +/- SD per cell type.
Execute_E_M_plot( data_for_plot, E_colname, M_colname, celltype_colname, colors = c("#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6") )Execute_E_M_plot( data_for_plot, E_colname, M_colname, celltype_colname, colors = c("#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6") )
data_for_plot |
A data.frame prepared by plot_data_prepare. |
E_colname |
Character, column name for E score. |
M_colname |
Character, column name for M score. |
celltype_colname |
Character, column name for cell type annotation. |
colors |
Vector of colors for cell types. |
A ggplot object.
data(data_for_plot) plot <- Execute_E_M_plot( data_for_plot, E_colname = "Panchy_et_al_E_signature", M_colname = "Panchy_et_al_M_signature", celltype_colname = "celltype_annotation", colors = c( "#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6" ) )data(data_for_plot) plot <- Execute_E_M_plot( data_for_plot, E_colname = "Panchy_et_al_E_signature", M_colname = "Panchy_et_al_M_signature", celltype_colname = "celltype_annotation", colors = c( "#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6" ) )
Read a GMT file and compute EMT scores for a gene expression matrix.
Execute_GSVA(exprMatrix, Genesets, score_names)Execute_GSVA(exprMatrix, Genesets, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
score_names |
Character string. Column name for the scores. |
Data frame of samples with GSVA scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_GSVA(geneExp, gmt_file, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_GSVA(geneExp, gmt_file, score_names = "score")
This function calculates GSVA scores for gene sets defined in a GMT file using the GSVA package. Parallel processing is used to speed up computation across pathways.
Execute_GSVA_parallel(exprMatrix, gmt_file, cores)Execute_GSVA_parallel(exprMatrix, gmt_file, cores)
exprMatrix |
Numeric matrix of gene expression, rows are genes, columns are samples. |
gmt_file |
Character string. Path to the GMT file containing gene sets. |
cores |
Integer. Number of CPU cores to use for parallel processing. |
A data frame containing GSVA scores for each pathway across samples. Each row corresponds to a pathway with an additional 'Pathway' column.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_GSVA_parallel(geneExp, gmt_file, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_GSVA_parallel(geneExp, gmt_file, cores = 1)
Read a GMT file and compute JASMINE scores for a gene expression matrix.
Execute_JAS(exprMatrix, Genesets, score_names)Execute_JAS(exprMatrix, Genesets, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
score_names |
Character string. Column name for the scores. |
Data frame of samples with JASMINE scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_JAS(geneExp, gmt_file, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_JAS(geneExp, gmt_file, score_names = "score")
This function calculates JASMINE scores for gene sets defined in a GMT file. Each pathway score combines normalized rank mean and odds ratio of gene expression across samples. Parallel processing is used to speed up computation across gene sets.
Execute_JASMINE_parallel(exprMatrix, gmt_file, cores)Execute_JASMINE_parallel(exprMatrix, gmt_file, cores)
exprMatrix |
Numeric matrix of gene expression, rows are genes, columns are samples. |
gmt_file |
Character string. Path to the GMT file containing gene sets. |
cores |
Integer. Number of CPU cores to use for parallel processing. |
A data frame containing JASMINE scores for each pathway across samples.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_JASMINE_parallel(geneExp, gmt_file, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_JASMINE_parallel(geneExp, gmt_file, cores = 1)
Scatter plot of two M scores with mean +/- SD per cell type.
Execute_M_dimension_plot( data_for_plot, M1_colname, M2_colname, celltype_colname, colors = c("#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6") )Execute_M_dimension_plot( data_for_plot, M1_colname, M2_colname, celltype_colname, colors = c("#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6") )
data_for_plot |
A data.frame prepared by plot_data_prepare. |
M1_colname |
Column name for M1 score. |
M2_colname |
Column name for M2 score. |
celltype_colname |
Column name for cell type annotation. |
colors |
Vector of colors for cell types. |
A ggplot object.
data(cell_annotation_file) data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") nnPCA_Mscore <- Execute_nnPCA(geneExp, gmt_file, dimension = 2, score_names = c("M1_score", "M2_score")) data_for_plot <- data_prepare(cell_annotation_file, nnPCA_Mscore, merge_colname = "name") plot2 <- Execute_M_dimension_plot( data_for_plot, M1_colname = "M1_score", M2_colname = "M2_score", celltype_colname = "celltype_annotation", colors = c( "#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6" ) )data(cell_annotation_file) data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") nnPCA_Mscore <- Execute_nnPCA(geneExp, gmt_file, dimension = 2, score_names = c("M1_score", "M2_score")) data_for_plot <- data_prepare(cell_annotation_file, nnPCA_Mscore, merge_colname = "name") plot2 <- Execute_M_dimension_plot( data_for_plot, M1_colname = "M1_score", M2_colname = "M2_score", celltype_colname = "celltype_annotation", colors = c( "#F87189", "#CE9031", "#A48CF5", "#97A430", "#39A7D0", "#E57D5F", "#84C7B9", "#E1AF64", "#C26CCF", "#B0BF43", "#57C3E8", "#F29D9E", "#92AAE6" ) )
Execute nnPCA Scoring from GMT File
Execute_nnPCA(exprMatrix, Genesets, dimension, score_names)Execute_nnPCA(exprMatrix, Genesets, dimension, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
dimension |
An integer specifying the number of principal components to compute (default is 1). |
score_names |
Character string. Column name for the scores. |
Read a GMT file and compute EMT scores for a gene expression matrix.
Data frame of samples with nnPCA scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_nnPCA(geneExp, gmt_file, dimension = 1, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_nnPCA(geneExp, gmt_file, dimension = 1, score_names = "score")
This function reads a GMT gene set file and performs non-negative sparse PCA (nnPCA) for each gene set in parallel, returning a combined data frame of pathway scores.
Execute_nnPCA_parallel(exprMatrix, Genesets, dimension, cores)Execute_nnPCA_parallel(exprMatrix, Genesets, dimension, cores)
exprMatrix |
Numeric matrix of gene expression, where rows are genes and columns are samples. |
Genesets |
Character string. Path to the GMT file containing gene sets. |
dimension |
Integer. Number of nnPCA components to compute. |
cores |
Integer. Number of cores to use for parallel processing. |
A data frame containing the first nnPCA component scores for each pathway.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_nnPCA_parallel(geneExp, gmt_file, dimension = 1, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_nnPCA_parallel(geneExp, gmt_file, dimension = 1, cores = 1)
Read a GMT file and compute EMT scores for a gene expression matrix.
Execute_SCSE(exprMatrix, Genesets, score_names)Execute_SCSE(exprMatrix, Genesets, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
score_names |
Character string. Column name for the scores. |
Data frame of samples with SCSE scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_SCSE(geneExp, gmt_file, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_SCSE(geneExp, gmt_file, score_names = "score")
This function computes SCSE (Single Cell Signature Explorer) scores for each gene set in a GMT file using a given gene expression matrix (genes as rows, samples as columns). It runs in parallel across multiple cores and returns a combined data frame of SCSE scores for all pathways.
Execute_SCSE_parallel(exprMatrix, gmt_file, cores)Execute_SCSE_parallel(exprMatrix, gmt_file, cores)
exprMatrix |
Numeric matrix of gene expression, where rows are genes and columns are samples. |
gmt_file |
Character string. Path to the GMT file containing gene sets. |
cores |
Integer. Number of CPU cores to use for parallel processing. |
A data frame containing SCSE scores for each pathway across samples.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_SCSE_parallel(geneExp, gmt_file, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_SCSE_parallel(geneExp, gmt_file, cores = 1)
Read a GMT file and compute EMT scores for a gene expression matrix.
Execute_ssGSEA(exprMatrix, Genesets, score_names)Execute_ssGSEA(exprMatrix, Genesets, score_names)
exprMatrix |
Numeric matrix of gene expression, row names are genes, column names are samples. |
Genesets |
Character string. Path to GMT file. |
score_names |
Character string. Column name for the scores. |
Data frame of samples with ssGSEA scores.
data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_ssGSEA(geneExp, gmt_file, score_names = "score")data(geneExp) gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") result <- Execute_ssGSEA(geneExp, gmt_file, score_names = "score")
This function calculates ssGSEA scores for gene sets defined in a GMT file using the ssGSEA package. Parallel processing is used to speed up computation across pathways.
Execute_ssGSEA_parallel(exprMatrix, gmt_file, cores)Execute_ssGSEA_parallel(exprMatrix, gmt_file, cores)
exprMatrix |
Numeric matrix of gene expression, rows are genes, columns are samples. |
gmt_file |
Character string. Path to the GMT file containing gene sets. |
cores |
Integer. Number of CPU cores to use for parallel processing. |
A data frame containing ssGSEA scores for each pathway across samples. Each row corresponds to a pathway with an additional 'Pathway' column.
data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_ssGSEA_parallel(geneExp, gmt_file, cores = 1)data(geneExp) gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") result <- Execute_ssGSEA_parallel(geneExp, gmt_file, cores = 1)
Removes (or keeps) gene sets from 'target_gmt' according to the proportion of their genes that appear anywhere in 'ref_gmt'. By default, only novel and non-redundant gene sets are kept (overlap < 'cutoff').
filter_gmt_by_reference( ref_gmt, target_gmt, output_gmt, cutoff = 0.5, keep_low_overlap = TRUE, min_genes = 5 )filter_gmt_by_reference( ref_gmt, target_gmt, output_gmt, cutoff = 0.5, keep_low_overlap = TRUE, min_genes = 5 )
ref_gmt |
Path to the reference GMT file containing the gene universe to compare against. |
target_gmt |
Path to the GMT file that should be filtered. |
output_gmt |
Path where the filtered GMT will be written. |
cutoff |
Numeric threshold between 0 and 1 (default '0.5'). Fraction of overlapping genes. |
keep_low_overlap |
Logical (default 'TRUE'):
|
min_genes |
Integer. Minimum number of genes required in a set (default '5'). Sets with fewer genes are ignored. |
Invisibly a 'data.frame' with one row per processed gene set and the columns:
name |
Gene set name |
size |
Total number of genes in the set |
overlap |
Number of genes present in the reference GMT |
fraction |
'overlap / size' |
ref_gmt <- system.file("extdata", "TianLab_collected_EMT_signatures.gmt", package = "EMTscore") target_gmt <- system.file("extdata", "h.all.v2025.1.Hs.symbols.gmt", package = "EMTscore") output_gmt <- tempfile(fileext = ".gmt") # Keep only gene sets that share < 50 % genes with the TianLab EMT collection filter_gmt_by_reference( ref_gmt, target_gmt, output_gmt, cutoff = 0.50, keep_low_overlap = TRUE )ref_gmt <- system.file("extdata", "TianLab_collected_EMT_signatures.gmt", package = "EMTscore") target_gmt <- system.file("extdata", "h.all.v2025.1.Hs.symbols.gmt", package = "EMTscore") output_gmt <- tempfile(fileext = ".gmt") # Keep only gene sets that share < 50 % genes with the TianLab EMT collection filter_gmt_by_reference( ref_gmt, target_gmt, output_gmt, cutoff = 0.50, keep_low_overlap = TRUE )
A small log2-scale bulk gene expression matrix used to demonstrate the
scoring functions in runnable examples. It is a subset of the CCLE / cell
line panel distributed with the EMTscore study, restricted to the genes that
appear in the bundled EMT signature gene sets (EM_signature.gmt and
test.gmt) so that the examples run quickly without a network download.
data(geneExp)data(geneExp)
A numeric matrix with 544 rows (genes, row names are HGNC symbols)
and 120 columns (samples/cell lines, column names match the name
column of cell_annotation_file). Values are log2-transformed
normalized expression.
Subset of the full expression matrix deposited at Zenodo,
doi:10.5281/zenodo.19487376 (file geneExp.rda). The processing
script that produced this subset is in
system.file("script", "make_geneExp.R", package = "EMTscore").
data(geneExp) dim(geneExp)data(geneExp) dim(geneExp)
A curated collection of Gene Ontology (GO) gene sets used as input for EMT scoring.
data(GO)data(GO)
A list of gene sets, each a character vector of gene symbols.
EMT-related gene sets derived from the Gene Ontology (GO) database
(http://geneontology.org).
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(GO)data(GO)
Hallmark gene sets from the Molecular Signatures Database (MSigDB), provided as example pathway input.
data(MSigDB_Hallmark)data(MSigDB_Hallmark)
A list of Hallmark gene sets, each a character vector of gene symbols.
Hallmark (H) gene set collection from the Molecular Signatures
Database (MSigDB, https://www.gsea-msigdb.org/gsea/msigdb).
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(MSigDB_Hallmark)data(MSigDB_Hallmark)
This dataset contains EMT score computed using the nnPCA method.
data(nnPCA_Result_EMT)data(nnPCA_Result_EMT)
A data frame or matrix of nnPCA-based EMT score.
EMT score results generated using the nnPCA method.
Precomputed example output produced by running
Execute_nnPCA on the bundled geneExp matrix
with the EM_signature.gmt gene set shipped in
system.file("extdata", package = "EMTscore").
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(nnPCA_Result_EMT)data(nnPCA_Result_EMT)
Example Escore and Mscore values computed with the nnPCA method across multiple gene sets.
data(nnPCA_Result_multiple)data(nnPCA_Result_multiple)
A data frame with nnPCA Escore and Mscore columns (rows = samples).
Precomputed example output produced by running Execute_nnPCA
(with dimension = 2) on the bundled geneExp matrix and
the EM_signature.gmt gene set shipped in
system.file("extdata", package = "EMTscore").
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(nnPCA_Result_multiple)data(nnPCA_Result_multiple)
Epithelial (E) marker gene set curated from Panchy et al., provided as an example EMT signature.
data(Panchy_et_al_E_signature)data(Panchy_et_al_E_signature)
A character vector of epithelial-state gene symbols.
Epithelial marker gene list curated from Panchy et al. Gene symbols
were extracted from the published EMT signature; no further processing was
applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Panchy_et_al_E_signature)data(Panchy_et_al_E_signature)
Mesenchymal (M) marker gene set curated from Panchy et al., provided as an example EMT signature.
data(Panchy_et_al_M_signature)data(Panchy_et_al_M_signature)
A character vector of mesenchymal-state gene symbols.
Mesenchymal marker gene list curated from Panchy et al. Gene symbols
were extracted from the published EMT signature; no further processing was
applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Panchy_et_al_M_signature)data(Panchy_et_al_M_signature)
This function visualizes EMT (epithelial mesenchymal transition) scores across pseudotime for multiple Seurat objects. Each Seurat object is treated as a different condition or sample.
plot_EMT_from_objects(obj_list, col_name, emt_score_col)plot_EMT_from_objects(obj_list, col_name, emt_score_col)
obj_list |
A named list of Seurat objects. Each element should be a Seurat object with the EMT score already computed and stored in the metadata. |
col_name |
Character string. Name of the column in |
emt_score_col |
Character string. Name of the column in |
A ggplot object showing smoothed EMT score trajectories along pseudotime
for each condition.
library(ExperimentHub) eh <- ExperimentHub() A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objs <- add_EMT_score(list(A549_TGFB1 = A549_TGFB1), gmt_file, emt_name = "EMT_Score", method = "AUCell" ) p <- plot_EMT_from_objects(objs, col_name = "nCount_RNA", emt_score_col = "EMT_Score" )library(ExperimentHub) eh <- ExperimentHub() A549_TGFB1 <- eh[["EH10293"]] gmt_file <- system.file("extdata", "EM_signature.gmt", package = "EMTscore") objs <- add_EMT_score(list(A549_TGFB1 = A549_TGFB1), gmt_file, emt_name = "EMT_Score", method = "AUCell" ) p <- plot_EMT_from_objects(objs, col_name = "nCount_RNA", emt_score_col = "EMT_Score" )
present result of heat map of genes that contribute to M score of dimension 1 and disension 2
plot_heatmap_function(geneExp, geneList_M)plot_heatmap_function(geneExp, geneList_M)
geneExp |
gene expression matrix |
geneList_M |
M signature gene list in dataframe, we supply example list such as geneList_M, M_signature_for_cancer, M_signature_for_cell |
Figure represent EMT score for different methods and gene sets
data(geneExp) data(Tan_et_al_cell_line_M_signature) geneList_M <- Tan_et_al_cell_line_M_signature p <- plot_heatmap_function(t(geneExp), geneList_M)data(geneExp) data(Tan_et_al_cell_line_M_signature) geneList_M <- Tan_et_al_cell_line_M_signature p <- plot_heatmap_function(t(geneExp), geneList_M)
This function clusters PCA results using Gaussian Mixture Model (GMM) or K-means, identifies the clusters with maximum Escore and Mscore, assigns labels "E", "M", and "EM1", "EM2", ... to other clusters, and returns a named vector of final cluster labels for each sample.
predict_cluster_labels( pca_result, method = "GMM", n_clusters = 3, PC_name = c("Escore", "Mscore") )predict_cluster_labels( pca_result, method = "GMM", n_clusters = 3, PC_name = c("Escore", "Mscore") )
pca_result |
A numeric matrix or data frame of PCA results (rows = samples, columns = PCs). |
method |
Character, either "GMM" (Gaussian Mixture Model) or "Kmeans" for clustering. Default is "GMM". |
n_clusters |
Numeric, number of clusters for Kmeans. Ignored if method = "GMM". |
PC_name |
Character vector of length 2 specifying the column names for Escore and Mscore. Default is c("Escore", "Mscore"). |
A named character vector of cluster labels for each sample.
data(nnPCA_Result_multiple) labels_gmm <- predict_cluster_labels(nnPCA_Result_multiple, method = "GMM", n_clusters = 3, PC_name = c("Escore", "Mscore") ) labels_km <- predict_cluster_labels(nnPCA_Result_multiple, method = "Kmeans", n_clusters = 3, PC_name = c("Escore", "Mscore") )data(nnPCA_Result_multiple) labels_gmm <- predict_cluster_labels(nnPCA_Result_multiple, method = "GMM", n_clusters = 3, PC_name = c("Escore", "Mscore") ) labels_km <- predict_cluster_labels(nnPCA_Result_multiple, method = "Kmeans", n_clusters = 3, PC_name = c("Escore", "Mscore") )
This function reads a GMT (Gene Matrix Transposed) file with
GSEABase::getGmt() and extracts all unique genes across all gene sets.
read_gmt(fname)read_gmt(fname)
fname |
Character string. Path to the GMT file. |
A data frame with a single column gene, containing all unique
genes.
gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") genes <- read_gmt(gmt_file)gmt_file <- system.file("extdata", "test.gmt", package = "EMTscore") genes <- read_gmt(gmt_file)
Example EMT scores computed with the Single-Cell Signature Explorer (SCSE) method.
data(SCSE_Result_EMT)data(SCSE_Result_EMT)
A data frame of SCSE-based EMT scores (rows = samples).
Precomputed example output produced by running
Execute_SCSE on the bundled geneExp matrix
with the EM_signature.gmt gene set shipped in
system.file("extdata", package = "EMTscore").
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(SCSE_Result_EMT)data(SCSE_Result_EMT)
Epithelial (E) signature gene set derived from cell-line data in Tan et al.
data(Tan_et_al_cell_line_E_signature)data(Tan_et_al_cell_line_E_signature)
A character vector of epithelial signature gene symbols.
Cell-line epithelial EMT signature curated from Tan et al. Gene
symbols were extracted from the published signature; no further processing
was applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Tan_et_al_cell_line_E_signature)data(Tan_et_al_cell_line_E_signature)
Mesenchymal (M) signature gene set derived from cell-line data in Tan et al.
data(Tan_et_al_cell_line_M_signature)data(Tan_et_al_cell_line_M_signature)
A character vector of mesenchymal signature gene symbols.
Cell-line mesenchymal EMT signature curated from Tan et al. Gene
symbols were extracted from the published signature; no further processing
was applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Tan_et_al_cell_line_M_signature)data(Tan_et_al_cell_line_M_signature)
Epithelial (E) signature gene set derived from tumor data in Tan et al.
data(Tan_et_al_tumor_E_signature)data(Tan_et_al_tumor_E_signature)
A character vector of epithelial signature gene symbols.
Tumor epithelial EMT signature curated from Tan et al. Gene symbols
were extracted from the published signature; no further processing was
applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Tan_et_al_tumor_E_signature)data(Tan_et_al_tumor_E_signature)
Mesenchymal (M) signature gene set derived from tumor data in Tan et al.
data(Tan_et_al_tumor_M_signature)data(Tan_et_al_tumor_M_signature)
A character vector of mesenchymal signature gene symbols.
Tumor mesenchymal EMT signature curated from Tan et al. Gene symbols
were extracted from the published signature; no further processing was
applied.
Creation and provenance code: system.file("script", "make-data.R", package = "EMTscore").
data(Tan_et_al_tumor_M_signature)data(Tan_et_al_tumor_M_signature)
Convert multiple gene lists into a single GMT (Gene Matrix Transposed) formatted file. Each element of the input list represents one gene set, where the element name is the gene set name and the element value is a vector of gene symbols.
write_gmt(gene_sets, file)write_gmt(gene_sets, file)
gene_sets |
A named list of gene sets. Each element should be a character vector
containing gene symbols, and each list name will be used as the gene set name.
Example: |
file |
A character string specifying the output GMT file path (e.g. "output.gmt"). |
No return value. The function writes a GMT file to the specified path.
gene_sets <- list( EMT_High = c("VIM", "ZEB1", "SNAI1"), EMT_Low = c("CDH1", "OCLN", "DSP") ) write_gmt(gene_sets, file = tempfile(fileext = ".gmt"))gene_sets <- list( EMT_High = c("VIM", "ZEB1", "SNAI1"), EMT_Low = c("CDH1", "OCLN", "DSP") ) write_gmt(gene_sets, file = tempfile(fileext = ".gmt"))