The Deconvolution package contains different functions, specific to generate absolute or relative deconvolution plots, with different methods, which also return data frames with the result of the deconvolution, or a list with data frames in the case of the deconv function, these df can then be used with another function of the package, the Box_Deconv function to generate a boxplot that compares two conditions in the different cell types, and does so from the df resulting from the deconvolution.
| Deconvolution method | Description | |----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | CIBERSORT | Versatile computational method for quantifying cell fractions from bulk tissue gene expression profiles (GEPs). Combining support vector regression with prior knowledge of expression profiles from purified leukocyte subsets,this methode can accurately estimate the immune composition of a tumor biopsy. https://doi.org/10.1007/978-1-4939-7493-1_12 | | EPIC (Estimating the Proportions of Immune and Cancer cells) | includes RNA-seq-based gene expression reference profiles from immune cells and other nonmalignant cell types found in tumors, can additionally manage user-defined gene expression reference profiles, include the ability to account for an uncharacterized cell type. https://doi.org/10.1007/978-1-0716-0327-7_17 | | FARDEEP (Fast And Robust DEconvolution of Expression Profiles) | This methode enumerate immune cell subsets from whole tumor tissue samples. To reduce noise in the tumor gene expression datasets, utilizes an adaptive least trimmed square to automatically detect and remove outliers before estimating the cell compositions. We show that FARDEEP is less susceptible to outliers and returns a better estimation of coefficients than the existing methods with both numerical simulations and real datasets. https://doi.org/10.1371/journal.pcbi.1006976 |
| Signature matrix | Description | |---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | LM22 | Is a signature matrix file consisting of 547 genes that accurately distinguish 22 mature human hematopoietic populations isolated from peripheral blood or in vitro culture conditions, including seven T cell types, naïve and memory B cells, plasma cells, NK cells, and myeloid subsets. https://doi.org/10.1007/978-1-4939-7493-1_12 | | Monaco-ABIS_Immune11_Microarray | This matrix was constructed from a set of predictor variables (cell types), normalized by mRNA abundance with scaling factors, and filtered by extracting genes with very high or very low expression and also genes not expressed with the STAR method, including eleven cell tipes, T.Naive, T.Memory, B.Naive, B.Memory, Plasmablasts, NK, pDCs, Neutrophils.LD, Basophils.LD, mDCs, Monocytes. https://doi.org/10.1016/j.celrep.2019.01.041 | | Wang2020_signature.matrix | To construct the signature matrix of brain data, adult scRNA-seq data from Darmanis et al. (2015) were analyzed by grouping characterized human brain cells into seven cell types [astrocytes, endothelia, microglia, oligodendrocytes (Oligo), oligodendrocyte precursor cells (OPCs), inhibitory and excitatory neurons] and selecting the top 50 marker genes for each cell type using SC3 (Kiselev et al., 2017). Finally, the expression of each marker gene in cells of the same type was averaged. https://doi.org/10.1093/bioinformatics/btz619|
| Function | Description | Return | |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| | CIBERSORT_abs_F | Function that generates the absolute deconvolution plot with the CIBERSORT method, with the fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graphs and Deconvolution df | | CIBERSORT_abs_NF | Function that generates the absolute deconvolution plot with the CIBERSORT method, with the non-fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graph and df | | CIBERSORT_rel_F | Function that generates the relative deconvolution plot with the CIBERSORT method, with the fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graphs and Deconvolution df | | CIBERSORT_rel_NF | Function that generates the relative deconvolution plot with the CIBERSORT method, with the non-fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graph and df | | EPIC_rel_F | Function that generates the relative deconvolution plot with the EPIC method, with the fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graphs and Deconvolution df | | EPIC_rel_NF | Function that generates the relative deconvolution plot with the EPIC method, with the non-fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graph and df | | FARDEEP_abs_F | Function that generates the absolute deconvolution plot with the FARDEEP method, with the fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graphs and Deconvolution df | | FARDEEP_abs_NF | Function that generates the absolute deconvolution plot with the FARDEEP method, with the non-fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graph and df | | FARDEEP_rel_F | Function that generates the relative deconvolution plot with the FARDEEP method, with the fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graphs and Deconvolution df | | FARDEEP_rel_NF | Function that generates the relative deconvolution plot with the FARDEEP method, with the non-fractional plot, and returns a df resulting from the deconvolution. | Deconvolution Graph and df | | Deconv | Function that generates massive deconvolution plots with the CIBERSORT, EPIC and FARDEEP methods, and returns a list of df's resulting from the deconvolutions. | Deconvolution Graphs and df's list | | Box_Deconv | Function that generates a boxplot comparing conditions for each cell type from a df and a condition vector, and in the case of more than two conditions, it also returns a df with P.Value information. | Deconvolution Boxplot |
library(devtools) devtools::install_github("margenomics/Deconvolution") library(Deconvolution)
# CIBERSORT_abs_F C_abs <- CIBERSORT_abs_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name, "MONACO") # CIBERSORT_abs_NF C_abs <- CIBERSORT_abs_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # CIBERSORT_rel_F C_rel <- CIBERSORT_rel_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # CIBERSORT_rel_NF C_rel <- CIBERSORT_rel_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # EPIC_rel_F E_rel <- EPIC_rel_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # EPIC_rel_NF E_rel <- EPIC_rel_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # FARDEEP_abs_F F_abs <- FARDEEP_abs_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # FARDEEP_abs_NF F_abs <- FARDEEP_abs_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # FARDEEP_rel_F F_rel <- FARDEEP_rel_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # FARDEEP_rel_NF F_rel <- FARDEEP_rel_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # Deconv L_rel <- deconv("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", "ALL", "rel", fraccionate.samples=TRUE, fractions= f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO") # Box_deconv P.value_df <- Box_Deconv(data= C_abs, cond= fractions, results_dir = "/bicoh/nidia/Deconv/Brain/test", f_name= "Box_CIBERSORT_abs")
matrix <- "Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt" sig.matrix <- "Wang2020_signature.matrix.txt" fractions <- c(rep("A", each=18), rep("B", each=43), rep("C", each=36)) results_dir <- "/bicoh/nidia/Deconv/Brain/test"
# The CIBERSORT_abs_NF function generates the absolute deconvolution graph with the cibersort method, and returns the df resulting from the deconvolution. C_abs <- CIBERSORT_abs_NF("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", results_dir = "/bicoh/nidia/Deconv/Brain/test")
source("CIBERSORT.R") matrix <- "Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt" sig.matrix <- "Wang2020_signature.matrix.txt" results_dir <- "/bicoh/nidia/Deconv/Brain_MMartin/test" res_ciber = CIBERSORT(sig_matrix=sig.matrix, mixture_file = matrix, QN = F,perm=100,absolute = T,abs_method='no.sumto1') res_ciber = as.data.frame(t(res_ciber)) res_ciber$cell_type=rownames(res_ciber) C_abs <- res_ciber[1:(length(rownames(res_ciber))-4),]
# Show the first 6 columns of the deconvolution df. knitr::kable(C_abs[,1:6 ])
# The CIBERSORT_rel_F function generates the relative deconvolution graphs, as many as fractions in the fractions vector with the cibersort method, and returns the resulting deconvolution df. C_rel <- CIBERSORT_rel_F("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", f, results_dir = "/bicoh/nidia/Deconv/Brain/test", height= 8, name= "MONACO")
source("CIBERSORT.R") matrix <- "Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt" sig.matrix <- "Wang2020_signature.matrix.txt" results_dir <- "/bicoh/nidia/Deconv/Brain_MMartin/test" res_ciber = CIBERSORT(sig_matrix=sig.matrix, mixture_file = matrix, QN = F,perm=100) res_ciber = as.data.frame(t(res_ciber)) res_ciber$cell_type=rownames(res_ciber) C_rel <- res_ciber[1:(length(rownames(res_ciber))-4),]
# Show the first 6 columns of the deconvolution df. knitr::kable(C_rel[,1:6 ])
# The deconv function can generate any deconvolution graph, fractional or not and with any of the three methods contained in the package (CIBERSORT, EPIC or FARDEEP), and returns a list of the df's resulting from the deconvolution with each method. L_rel <- deconv("Counts.HUMAN_nodup_Sal_Veh_IPs_INPUTs.txt", "Wang2020_signature.matrix.txt", "ALL", "rel", fraccionate.samples=FALSE, results_dir = "/bicoh/nidia/Deconv/Brain/test")
require(EPIC) require(usethis) require(devtools) require(gplots) require(data.table) require(ggplot2) require(dplyr) require(tidyr) require(immunedeconv) require(RColorBrewer) require(FARDEEP) cpm=read.table(matrix,sep = "\t",header = T) cpm <- cpm %>% group_by(Gene.symbol) %>% summarise_all(mean) names <- cpm$Gene.symbol cpm=as.matrix(cpm[,-1]) rownames(cpm)=names # Llegeix la matriu signature en txt i posa els rownames amb els noms de la columna de gens, 3 possibles noms sig.mtrx=read.table(sig.matrix,sep = "\t",header = T) sig.mtrx <- sig.mtrx %>% group_by(Gene.symbol) %>% summarise_all(mean) names <- sig.mtrx$Gene.symbol sig.mtrx=as.matrix(sig.mtrx[,-1]) rownames(sig.mtrx)=names # Creació de la llista de gens i la matriu signature i generació de la matriu de deconvolució i conversió d'aquesta a df C_EPIC <- list() C_EPIC[["sigGenes"]] <- rownames(sig.mtrx) C_EPIC[["refProfiles"]] <- as.matrix(sig.mtrx) RESULTS <- t(EPIC::EPIC(bulk=cpm, reference=C_EPIC, withOtherCells=TRUE, scaleExprs=FALSE)$cellFractions) #scaleExprs=TRUE by default: only keep genes in common between matrices RESULTS <- as.data.frame(RESULTS) RESULTS$cell_type=rownames(RESULTS) E_rel <- RESULTS # Construcció de la matriu de deconvolució relativa i conversió d'aquesta en un dataframe RESULTS = t(FARDEEP::fardeep(sig.mtrx, cpm, nn = TRUE, intercept = TRUE, permn = 10, QN = FALSE)$relative.beta) #RESULTS = t(FARDEEP::fardeep(sig.mtrx, cpm, nn = TRUE, intercept = TRUE, permn = 10, QN = FALSE)$relative.beta) RESULTS <- as.data.frame(RESULTS) RESULTS$cell_type=rownames(RESULTS) F_rel <- RESULTS l_df <- list(C_rel, E_rel, F_rel)
# l_df <- list(C_rel, E_rel, F_rel) knitr::kable(l_df[[1]][,1:6]) knitr::kable(l_df[[2]][,1:6]) knitr::kable(l_df[[3]][,1:6])
# The Box_Deconv function generates a graph comparing for each cell type the conditions present in the list of samples. P.value_df <- Box_Deconv(data= C_abs, cond= fractions, results_dir = "/bicoh/nidia/Deconv/Brain/test")
If the samples have two conditions, the function returns a graph with the P.Value of the conditions for each cell type in the graph.
If the samples have more than two conditions, the function returns a graph comparing the conditions for each cell type, but the overall P.Value for each cell type is displayed as a message, since the function returns a df containing information of the P.value's and the significance level of the conditions per cell type.
require(ggplot2) require(ggpubr) require(gplots) require(data.table) require(ggsignif) require(tidyverse) fractions <- c(rep("A", each=18), rep("B", each=43), rep("C", each=36)) data <- C_abs cond <- fractions data$cell_type <- NULL data <- t(data) test_m <- melt(as.data.table(data), variable.factor = FALSE) condition <- c(rep(cond, times=length(colnames(data)))) df_m <- cbind(test_m, condition) anno_df = compare_means(value ~ condition, group.by = "variable", data = df_m, method = "t.test")
knitr::kable(anno_df)
Hao, Y., Yan, M., Heath, B. R., Lei, Y. L., & Xie, Y. (2019). Fast and robust deconvolution of tumor infiltrating lymphocyte from expression profiles using least trimmed squares. PLoS computational biology, 15(5), e1006976. https://doi.org/10.1371/journal.pcbi.1006976
Chen, B., Khodadoust, M. S., Liu, C. L., Newman, A. M., & Alizadeh, A. A. (2018). Profiling Tumor Infiltrating Immune Cells with CIBERSORT. Methods in molecular biology (Clifton, N.J.), 1711, 243–259. https://doi.org/10.1007/978-1-4939-7493-1_12
Racle, J., & Gfeller, D. (2020). EPIC: A Tool to Estimate the Proportions of Different Cell Types from Bulk Gene Expression Data. Methods in molecular biology (Clifton, N.J.), 2120, 233–248. https://doi.org/10.1007/978-1-0716-0327-7_17
Avila Cobos, F., Alquicira-Hernandez, J., Powell, J.E. et al. Benchmarking of cell type deconvolution pipelines for transcriptomics data. Nat Commun 11, 5650 (2020). https://doi.org/10.1038/s41467-020-19015-1
Gregor Sturm, Francesca Finotello, Florent Petitprez, Jitao David Zhang, Jan Baumbach, Wolf H Fridman, Markus List, Tatsiana Aneichyk, Comprehensive evaluation of transcriptome-based cell-type quantification methods for immuno-oncology, Bioinformatics, Volume 35, Issue 14, July 2019, Pages i436–i445, https://doi.org/10.1093/bioinformatics/btz363
Francisco Avila Cobos, Jo Vandesompele, Pieter Mestdagh, Katleen De Preter, Computational deconvolution of transcriptomics data from mixed cell populations, Bioinformatics, Volume 34, Issue 11, 01 June 2018, Pages 1969–1979, https://doi.org/10.1093/bioinformatics/bty019
Finotello, F., Trajanoski, Z. Quantifying tumor-infiltrating immune cells from transcriptomics data. Cancer Immunol Immunother 67, 1031–1040 (2018). https://doi.org/10.1007/s00262-018-2150-z
Monaco, G., Lee, B., Xu, W., Mustafah, S., Hwang, Y. Y., Carré, C., Burdin, N., Visan, L., Ceccarelli, M., Poidinger, M., Zippelius, A., Pedro de Magalhães, J., & Larbi, A. (2019). RNA-Seq Signatures Normalized by mRNA Abundance Allow Absolute Deconvolution of Human Immune Cell Types. Cell reports, 26(6), 1627–1640.e7. https://doi.org/10.1016/j.celrep.2019.01.041
Jiebiao Wang, Bernie Devlin, Kathryn Roeder, Using multiple measurements of tissue to estimate subject- and cell-type-specific gene expression, Bioinformatics, Volume 36, Issue 3, 1 February 2020, Pages 782–788, https://doi.org/10.1093/bioinformatics/btz619
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.