Hierarchical annotation of immune cells in scRNA-Seq data based on ssGSEA algorithm. Fork for large datasets with QOL improvements.

replace layer naming w cell resolution (cr, cell_res) + general linting

Signed-off-by: Ariel Lighty <ariellig@buffalo.edu>

+56 -35
R/genelist.R
··· 3 3 #' @format Data frames with cell type as column names. 4 4 5 5 6 + cr0_genelist <- read.csv( 7 + file = paste0("./extdata/", 8 + "ImmuneOrNot_cr0_genelist.csv", 9 + sep = "" 10 + ), 11 + header = TRUE 12 + ) 6 13 7 - layer0_genelist <- read.csv(file=paste("./extdata/","immune_non-immune_genelist(layer0).csv",sep=""),header=T) 8 - layer0_genelist 14 + cr1_genelist <- read.csv(file = paste0("./extdata/", 15 + "MainType_cr1_genelist.csv", 16 + sep = "" 17 + ), header = TRUE) 18 + 19 + Tcell_genelist <- read.csv(file = paste0("./extdata/", 20 + "Tcell_cr2_genelist.csv", 21 + sep = "" 22 + ), header = TRUE) 23 + 24 + Bcell_genelist <- read.csv(file = paste0("./extdata/", 25 + "Bcell_cr2_genelist.csv", 26 + sep = "" 27 + ), header = TRUE) 28 + 29 + DC_genelist <- read.csv(file = paste0("./extdata/", 30 + "DC_cr2_genelist.csv", 31 + sep = "" 32 + ), header = TRUE) 33 + 34 + NK_genelist <- read.csv(file = paste0("./extdata/", 35 + "NK_cr2_genelist.csv", 36 + sep = "" 37 + ), header = TRUE) 38 + 39 + Monocyte_genelist <- read.csv(file = paste0("./extdata/", 40 + "Monocyte_cr2_genelist.csv", 41 + sep = "" 42 + ), header = TRUE) 43 + 44 + Macrophage_genelist <- read.csv(file = paste0("./extdata/", 45 + "Macrophage_cr2_genelist.csv", 46 + sep = "" 47 + ), header = TRUE) 48 + 49 + ILC_genelist <- read.csv(file = paste0("./extdata/", 50 + "ILC_cr2_genelist.csv", 51 + sep = "" 52 + ), header = TRUE) 9 53 10 - layer1_genelist <- read.csv(file=paste("./extdata/","main_type_layer1_genelist.csv",sep=""),header=T) 11 - layer1_genelist 54 + CD4_genelist <- read.csv(file = paste0("./extdata/", 55 + "CD4_cr3_genelist.csv", 56 + sep = "" 57 + ), header = TRUE) 12 58 59 + CD8_genelist <- read.csv(file = paste0("./extdata/", 60 + "CD8_cr3_genelist.csv", 61 + sep = "" 62 + ), header = TRUE) 13 63 14 - Tcell_genelist <- read.csv(file=paste("./extdata/","Tcell_layer2_genelist.csv",sep=""),header=T) 64 + cr0_genelist 65 + cr1_genelist 15 66 Tcell_genelist 16 - 17 - Bcell_genelist <- read.csv(file=paste("./extdata/","Bcell_layer2_genelist.csv",sep=""),header=T) 18 67 Bcell_genelist 19 - 20 - DC_genelist <- read.csv(file=paste("./extdata/","DC_layer2_genelist.csv",sep=""),header=T) 21 68 DC_genelist 22 - 23 - NK_genelist <- read.csv(file=paste("./extdata/","NK_layer2_genelist.csv",sep=""),header=T) 24 69 NK_genelist 25 - 26 - Monocyte_genelist <- read.csv(file=paste("./extdata/","Monocyte_layer2_genelist.csv",sep=""),header=T) 27 70 Monocyte_genelist 28 - 29 - Macrophage_genelist <- read.csv(file=paste("./extdata/","Macrophage_layer2_genelist.csv",sep=""),header=T) 30 71 Macrophage_genelist 31 - 32 - ILC_genelist <- read.csv(file=paste("./extdata/","ILC_layer2_genelist.csv",sep=""),header=T) 33 72 ILC_genelist 34 - 35 - CD4_genelist <- read.csv(file=paste("./extdata/","CD4_layer3_genelist.csv",sep=""),header=T) 36 73 CD4_genelist 37 - 38 - CD8_genelist <- read.csv(file=paste("./extdata/","CD8_layer3_genelist.csv",sep=""),header=T) 39 74 CD8_genelist 40 - 41 - 42 - # usethis::use_data(layer1_genelist) 43 - # usethis::use_data(layer0_genelist) 44 - # usethis::use_data(Tcell_genelist) 45 - # usethis::use_data(Bcell_genelist) 46 - # usethis::use_data(DC_genelist) 47 - # usethis::use_data(NK_genelist) 48 - # usethis::use_data(Monocyte_genelist) 49 - # usethis::use_data(Macrophage_genelist) 50 - # usethis::use_data(ILC_genelist) 51 - # usethis::use_data(CD4_genelist) 52 - # usethis::use_data(CD8_genelist) 53 -
+124 -106
R/scImmuCC.R
··· 1 1 #' @title scImmuCC_Layered. 2 - #' @description Creating Hierarchical_annotation for scRNA-Seq data immune cell. 3 - #' @details Input takes a cells-genes matrix with cell unique barcodes as column names and gene names as row names and returns the cells annotation. 4 - #' @param count a matrix with cell unique barcodes as column names and gene names as row names . 5 - #' @param Non_Immune Whether non-immune cells are included in the matrix. 6 - #' @return Data frames with the barcodes and cell types, and some maps. 2 + #' @description Creating Hierarchical_annotation for scRNA-Seq data immune cell 3 + #' @details Input takes a cells-genes matrix with cell unique barcodes as 4 + #' column names and gene names as row names and returns the cells annotation 5 + #' @param count Matrix with cell unique barcodes as column names and gene names 6 + #' as row names 7 + #' @param Non_Immune Whether non-immune cells are included in the matrix 8 + #' @return Data frames with the barcodes and cell types, and some maps 7 9 #' @import GSVA 8 10 #' @importFrom GSVA gsva 9 11 #' @import Matrix 10 12 #' @export 11 13 #' @examples test_data 12 - #' library(GSVA) 13 - #' library(Seurat) 14 - 15 - scImmuCC_Layered <- function(count,Non_Immune=TRUE){ 16 - 17 - # if (!requireNamespace("GSVA", quietly = TRUE)) { 18 - # BiocManager::install("GSVA") 19 - # } 20 - # if (!requireNamespace("Seurat", quietly = TRUE)){ 21 - # install.packages("Seurat") 22 - # } 23 - data("./data/layer1_genelist.rda",package="scImmuCC") 24 - data("./data/Tcell_genelist.rda",package="scImmuCC") 25 - data("./data/Bcell_genelist.rda",package="scImmuCC") 26 - data("./data/DC_genelist.rda",package="scImmuCC") 27 - data("./data/NK_genelist.rda",package="scImmuCC") 28 - data("./data/Monocyte_genelist.rda",package="scImmuCC") 29 - data("./data/Macrophage_genelist.rda",package="scImmuCC") 30 - data("./data/ILC_genelist.rda",package="scImmuCC") 31 - data("./data/CD4_genelist.rda",package="scImmuCC") 32 - data("./data/CD8_genelist.rda",package="scImmuCC") 33 - data("./data/layer0_genelist.rda",package="scImmuCC") 14 + scImmuCC_Layered <- function(count, Non_Immune = TRUE) { 15 + data("./data/cr0_genelist.rda", package = "scImmuCC") 16 + data("./data/cr1_genelist.rda", package = "scImmuCC") 17 + data("./data/Tcell_genelist.rda", package = "scImmuCC") 18 + data("./data/Bcell_genelist.rda", package = "scImmuCC") 19 + data("./data/DC_genelist.rda", package = "scImmuCC") 20 + data("./data/NK_genelist.rda", package = "scImmuCC") 21 + data("./data/Monocyte_genelist.rda", package = "scImmuCC") 22 + data("./data/Macrophage_genelist.rda", package = "scImmuCC") 23 + data("./data/ILC_genelist.rda", package = "scImmuCC") 24 + data("./data/CD4_genelist.rda", package = "scImmuCC") 25 + data("./data/CD8_genelist.rda", package = "scImmuCC") 34 26 35 - 36 - if(Non_Immune==TRUE){ 37 - 38 - layer0_result <- scImmuCC_main(count,layer0_genelist,"Layer0") 39 - immune <- layer0_result[which(layer0_result[,2]=="Immune"),] 40 - count_immune <- count[,immune[,1]] 41 - ssGSEA_result <- scImmuCC_main(count_immune,layer1_genelist,"Layer1") 42 - seurat_result <- seurat_Heatmap(count,layer1_genelist,ssGSEA_result,"Layer1") 43 - 44 - }else{ 45 - 46 - ssGSEA_result <- scImmuCC_main(count,layer1_genelist,"Layer1") 47 - seurat_result <- seurat_Heatmap(count,layer1_genelist,ssGSEA_result,"Layer1") 27 + if (Non_Immune == TRUE) { 28 + cr0_result <- scImmuCC_main(count, cr0_genelist, "cr0") 29 + immune <- cr0_result[which(cr0_result[, 2] == "Immune"), ] 30 + count_immune <- count[, immune[, 1]] 31 + ssGSEA_result <- scImmuCC_main(count_immune, cr1_genelist, "cr1") 32 + seurat_result <- seurat_Heatmap(count, cr1_genelist, ssGSEA_result, "cr1") 33 + } else { 34 + ssGSEA_result <- scImmuCC_main(count, cr1_genelist, "cr1") 35 + seurat_result <- seurat_Heatmap(count, cr1_genelist, ssGSEA_result, "cr1") 48 36 } 49 37 50 - cell_type <- unique(ssGSEA_result[,2]) 38 + cell_type <- unique(ssGSEA_result[, 2]) 51 39 52 - if("Tcell" %in% cell_type){ 53 - sub_ssGSEA_Tcell <- ssGSEA_result[which(ssGSEA_result[,2]=="Tcell"),] 54 - sub_count_Tcell <- count[,sub_ssGSEA_Tcell[,1]] 40 + if ("Tcell" %in% cell_type) { 41 + sub_ssGSEA_Tcell <- ssGSEA_result[which(ssGSEA_result[, 2] == "Tcell"), ] 42 + sub_count_Tcell <- count[, sub_ssGSEA_Tcell[, 1]] 55 43 sub_count_Tcell <- as.matrix(sub_count_Tcell) 56 - ssGSEA_Tcell <- scImmuCC_main(sub_count_Tcell,Tcell_genelist,"Layer2_Tcell") 57 - seurat_Tcell <- seurat_Heatmap(sub_count_Tcell,Tcell_genelist,ssGSEA_Tcell,"Layer2_Tcell") 44 + ssGSEA_Tcell <- scImmuCC_main(sub_count_Tcell, Tcell_genelist, "cr2_Tcell") 45 + seurat_Tcell <- seurat_Heatmap( 46 + sub_count_Tcell, Tcell_genelist, 47 + ssGSEA_Tcell, "cr2_Tcell" 48 + ) 58 49 59 - cell_type2 <- unique(ssGSEA_Tcell[,2]) 50 + cell_type2 <- unique(ssGSEA_Tcell[, 2]) 60 51 61 - if("CD4_T" %in% cell_type2){ 62 - sub_ssGSEA_CD4 <- ssGSEA_Tcell[which(ssGSEA_Tcell[,2]=="CD4_T"),] 63 - sub_count_CD4 <- count[,sub_ssGSEA_CD4[,1]] 52 + if ("CD4_T" %in% cell_type2) { 53 + sub_ssGSEA_CD4 <- ssGSEA_Tcell[which(ssGSEA_Tcell[, 2] == "CD4_T"), ] 54 + sub_count_CD4 <- count[, sub_ssGSEA_CD4[, 1]] 64 55 sub_count_CD4 <- as.matrix(sub_count_CD4) 65 - ssGSEA_CD4 <- scImmuCC_main(sub_count_CD4,CD4_genelist,"Layer3_CD4") 66 - cells <- length(sub_count_CD4[2,]) 67 - if(cells>50){ 68 - seurat_CD4 <- seurat_Heatmap(sub_count_CD4,CD4_genelist,ssGSEA_CD4,"Layer3_CD4") 56 + ssGSEA_CD4 <- scImmuCC_main(sub_count_CD4, CD4_genelist, "cr3_CD4") 57 + cells <- length(sub_count_CD4[2, ]) 58 + if (cells > 50) { 59 + seurat_CD4 <- seurat_Heatmap( 60 + sub_count_CD4, CD4_genelist, ssGSEA_CD4, 61 + "cr3_CD4" 62 + ) 69 63 } 70 - 71 64 } 72 65 73 66 74 - if("CD8_T" %in% cell_type2){ 75 - sub_ssGSEA_CD8 <- ssGSEA_Tcell[which(ssGSEA_Tcell[,2]=="CD8_T"),] 76 - sub_count_CD8 <- count[,sub_ssGSEA_CD8[,1]] 67 + if ("CD8_T" %in% cell_type2) { 68 + sub_ssGSEA_CD8 <- ssGSEA_Tcell[which(ssGSEA_Tcell[, 2] == "CD8_T"), ] 69 + sub_count_CD8 <- count[, sub_ssGSEA_CD8[, 1]] 77 70 sub_count_CD8 <- as.matrix(sub_count_CD8) 78 - ssGSEA_CD8 <- scImmuCC_main(sub_count_CD8,CD8_genelist,"Layer3_CD8") 79 - cells <- length(sub_count_CD8[2,]) 80 - if(cells>50){ 81 - seurat_CD8 <- seurat_Heatmap(sub_count_CD8,CD8_genelist,ssGSEA_CD8,"Layer3_CD8") 71 + ssGSEA_CD8 <- scImmuCC_main(sub_count_CD8, CD8_genelist, "cr3_CD8") 72 + cells <- length(sub_count_CD8[2, ]) 73 + if (cells > 50) { 74 + seurat_CD8 <- seurat_Heatmap( 75 + sub_count_CD8, CD8_genelist, ssGSEA_CD8, 76 + "cr3_CD8" 77 + ) 82 78 } 83 - 84 79 } 85 80 } 86 81 87 - if("Bcell" %in% cell_type){ 88 - sub_ssGSEA_Bcell <- ssGSEA_result[which(ssGSEA_result[,2]=="Bcell"),] 89 - sub_count_Bcell <- count[,sub_ssGSEA_Bcell[,1]] 82 + if ("Bcell" %in% cell_type) { 83 + sub_ssGSEA_Bcell <- ssGSEA_result[which(ssGSEA_result[, 2] == "Bcell"), ] 84 + sub_count_Bcell <- count[, sub_ssGSEA_Bcell[, 1]] 90 85 sub_count_Bcell <- as.matrix(sub_count_Bcell) 91 - ssGSEA_Bcell <- scImmuCC_main(sub_count_Bcell,Bcell_genelist,"Layer2_Bcell") 92 - cells <- length(sub_count_Bcell[2,]) 93 - if(cells>50){ 94 - seurat_Bcell <- seurat_Heatmap(sub_count_Bcell,Bcell_genelist,ssGSEA_Bcell,"Layer2_Bcell") 86 + ssGSEA_Bcell <- scImmuCC_main(sub_count_Bcell, Bcell_genelist, "cr2_Bcell") 87 + cells <- length(sub_count_Bcell[2, ]) 88 + if (cells > 50) { 89 + seurat_Bcell <- seurat_Heatmap( 90 + sub_count_Bcell, Bcell_genelist, 91 + ssGSEA_Bcell, "cr2_Bcell" 92 + ) 95 93 } 96 94 } 97 95 98 - if("DC" %in% cell_type){ 99 - sub_ssGSEA_DC <- ssGSEA_result[which(ssGSEA_result[,2]=="DC"),] 100 - sub_count_DC <- count[,sub_ssGSEA_DC[,1]] 96 + if ("DC" %in% cell_type) { 97 + sub_ssGSEA_DC <- ssGSEA_result[which(ssGSEA_result[, 2] == "DC"), ] 98 + sub_count_DC <- count[, sub_ssGSEA_DC[, 1]] 101 99 sub_count_DC <- as.matrix(sub_count_DC) 102 - ssGSEA_DC <- scImmuCC_main(sub_count_DC,DC_genelist,"Layer2_DC") 103 - cells <- length(sub_count_DC[2,]) 104 - if(cells>50){ 105 - seurat_DC <- seurat_Heatmap(sub_count_DC,DC_genelist,ssGSEA_DC,"Layer2_DC") 100 + ssGSEA_DC <- scImmuCC_main(sub_count_DC, DC_genelist, "cr2_DC") 101 + cells <- length(sub_count_DC[2, ]) 102 + if (cells > 50) { 103 + seurat_DC <- seurat_Heatmap( 104 + sub_count_DC, DC_genelist, ssGSEA_DC, 105 + "cr2_DC" 106 + ) 106 107 } 107 - 108 108 } 109 109 110 - if("NK" %in% cell_type){ 111 - sub_ssGSEA_NK <- ssGSEA_result[which(ssGSEA_result[,2]=="NK"),] 112 - sub_count_NK <- count[,sub_ssGSEA_NK[,1]] 110 + if ("NK" %in% cell_type) { 111 + sub_ssGSEA_NK <- ssGSEA_result[which(ssGSEA_result[, 2] == "NK"), ] 112 + sub_count_NK <- count[, sub_ssGSEA_NK[, 1]] 113 113 sub_count_NK <- as.matrix(sub_count_NK) 114 - ssGSEA_NK <- scImmuCC_main(sub_count_NK,NK_genelist,"Layer2_NK") 115 - cells <- length(sub_count_NK[2,]) 116 - if(cells>50){ 117 - seurat_NK <- seurat_Heatmap(sub_count_NK,NK_genelist,ssGSEA_NK,"Layer2_NK") 114 + ssGSEA_NK <- scImmuCC_main(sub_count_NK, NK_genelist, "cr2_NK") 115 + cells <- length(sub_count_NK[2, ]) 116 + if (cells > 50) { 117 + seurat_NK <- seurat_Heatmap( 118 + sub_count_NK, NK_genelist, ssGSEA_NK, 119 + "cr2_NK" 120 + ) 118 121 } 119 122 } 120 123 121 - if("Monocyte" %in% cell_type){ 122 - sub_ssGSEA_Mono <- ssGSEA_result[which(ssGSEA_result[,2]=="Monocyte"),] 123 - sub_count_Mono <- count[,sub_ssGSEA_Mono[,1]] 124 + if ("Monocyte" %in% cell_type) { 125 + sub_ssGSEA_Mono <- ssGSEA_result[which(ssGSEA_result[, 2] == "Monocyte"), ] 126 + sub_count_Mono <- count[, sub_ssGSEA_Mono[, 1]] 124 127 sub_count_Mono <- as.matrix(sub_count_Mono) 125 - ssGSEA_Mono <- scImmuCC_main(sub_count_Mono,Monocyte_genelist,"Layer2_Monocyte") 126 - cells <- length(sub_count_Mono[2,]) 127 - if(cells>50){ 128 - seurat_Mono <- seurat_Heatmap(sub_count_Mono,Monocyte_genelist,ssGSEA_Mono,"Layer2_Monocyte") 128 + ssGSEA_Mono <- scImmuCC_main( 129 + sub_count_Mono, Monocyte_genelist, 130 + "cr2_Monocyte" 131 + ) 132 + cells <- length(sub_count_Mono[2, ]) 133 + if (cells > 50) { 134 + seurat_Mono <- seurat_Heatmap( 135 + sub_count_Mono, Monocyte_genelist, 136 + ssGSEA_Mono, "cr2_Monocyte" 137 + ) 129 138 } 130 139 } 131 140 132 - if("Macrophage" %in% cell_type){ 133 - sub_ssGSEA_Mac <- ssGSEA_result[which(ssGSEA_result[,2]=="Macrophage"),] 134 - sub_count_Mac <- count[,sub_ssGSEA_Mac[,1]] 141 + if ("Macrophage" %in% cell_type) { 142 + sub_ssGSEA_Mac <- ssGSEA_result[which(ssGSEA_result[, 2] == "Macrophage"), ] 143 + sub_count_Mac <- count[, sub_ssGSEA_Mac[, 1]] 135 144 sub_count_Mac <- as.matrix(sub_count_Mac) 136 - ssGSEA_Mac <- scImmuCC_main(sub_count_Mac,Macrophage_genelist,"Layer2_Macrophage") 137 - cells <- length(sub_count_Mac[2,]) 138 - if(cells>50){ 139 - seurat_Mac <- seurat_Heatmap(sub_count_Mac,Macrophage_genelist,ssGSEA_Mac,"Layer2_Macrophage") 145 + ssGSEA_Mac <- scImmuCC_main( 146 + sub_count_Mac, Macrophage_genelist, 147 + "cr2_Macrophage" 148 + ) 149 + cells <- length(sub_count_Mac[2, ]) 150 + if (cells > 50) { 151 + seurat_Mac <- seurat_Heatmap( 152 + sub_count_Mac, Macrophage_genelist, 153 + ssGSEA_Mac, "cr2_Macrophage" 154 + ) 140 155 } 141 156 } 142 157 143 - if("ILC" %in% cell_type){ 144 - sub_ssGSEA_ILC <- ssGSEA_result[which(ssGSEA_result[,2]=="ILC"),] 145 - sub_count_ILC <- count[,sub_ssGSEA_ILC[,1]] 158 + if ("ILC" %in% cell_type) { 159 + sub_ssGSEA_ILC <- ssGSEA_result[which(ssGSEA_result[, 2] == "ILC"), ] 160 + sub_count_ILC <- count[, sub_ssGSEA_ILC[, 1]] 146 161 sub_count_ILC <- as.matrix(sub_count_ILC) 147 - ssGSEA_ILC <- scImmuCC_main(sub_count_ILC,ILC_genelist,"Layer2_ILC") 148 - cells <- length(sub_count_ILC[2,]) 149 - if(cells>50){ 150 - seurat_ILC <- seurat_Heatmap(sub_count_ILC,ILC_genelist,ssGSEA_ILC,"Layer2_ILC") 162 + ssGSEA_ILC <- scImmuCC_main(sub_count_ILC, ILC_genelist, "cr2_ILC") 163 + cells <- length(sub_count_ILC[2, ]) 164 + if (cells > 50) { 165 + seurat_ILC <- seurat_Heatmap( 166 + sub_count_ILC, ILC_genelist, ssGSEA_ILC, 167 + "cr2_ILC" 168 + ) 151 169 } 152 170 } 153 171 }
+22 -34
R/scImmuCC_main.R
··· 1 - #' @title scImmuCC_main. 2 - #' @description Calculation of gene enrichment scores and annotate cell type . 3 - #' @details Input takes a count, genelist and filename, returns a data frame with cell annotation . 4 - #' @param count a matrix with cell unique barcodes as column names and gene names as row names . 5 - #' @param genematrix a data frame with cell types as column names . 6 - #' @param ssGSEA_result a data frame , scImmuCC return result . 7 - #' @param filename custom file name, character . 8 - #' @return a data frame with cell annotation. 1 + #' @title scImmuCC_main 2 + #' @description Calculation of gene enrichment scores and annotate cell type 3 + #' @details Input takes a count, genelist and filename, returns a data frame 4 + #' with cell annotation 5 + #' @param count Matrix with cell unique barcodes as column names and gene 6 + #' names as row names 7 + #' @param genematrix Data frame with cell types as column names 8 + #' @param ssGSEA_result Data frame, scImmuCC return result 9 + #' @param filename Custom file name, char 10 + #' @return Data frame with cell annotation 9 11 #' @import GSVA 10 12 #' @importFrom GSVA gsva 11 13 12 - 13 - 14 - scImmuCC_main <- function(count,genematrix,filename){ 15 - 14 + scImmuCC_main <- function(count, genematrix, filename) { 15 + genelist <- as.list(genematrix) 16 + genelist <- lapply(genelist, function(x) x[!is.na(x)]) 16 17 17 - genelist <- as.list(genematrix) 18 - genelist <- lapply(genelist,function(x) x[!is.na(x)]) 19 - 20 18 ssgsea <- ssgseaParam( 21 19 count, 22 20 genelist 23 - ) 24 - #, 25 - #assay = NA_character_, 26 - #annotation = NA_character_, 27 - #minSize = 1, 28 - #maxSize = Inf, 29 - #alpha = 0.25, 30 - #normalize = TRUE 31 - #) 32 - 21 + ) 22 + 33 23 ssgsea_score <- gsva(ssgsea) 34 - ##ssgsea_score = gsva(count, genelist, method = "ssgsea", ssgsea.norm = TRUE, verbose = TRUE) # signature 'matrix,list' 35 24 score <- t(ssgsea_score) 36 25 37 26 barcodes <- c() 38 27 celltype <- c() 39 - for(i in 1:length(score[,1])){ 40 - a1 <- score[i,] 28 + for (i in 1:length(score[, 1])) { 29 + a1 <- score[i, ] 41 30 b1 <- as.data.frame(a1) 42 31 b1$celltype <- rownames(b1) 43 - f <- b1[which(b1[,1]==max(b1[,1])),] 44 - barcodes <- c(barcodes,rownames(score)[i]) 45 - celltype <- c(celltype,rownames(f)) 32 + f <- b1[which(b1[, 1] == max(b1[, 1])), ] 33 + barcodes <- c(barcodes, rownames(score)[i]) 34 + celltype <- c(celltype, rownames(f)) 46 35 } 47 36 48 - ssGSEA_result <- data.frame(barcodes=barcodes,cell_type=celltype) 37 + ssGSEA_result <- data.frame(barcodes = barcodes, cell_type = celltype) 49 38 head(ssGSEA_result) 50 - write.csv(ssGSEA_result,paste(filename,"_scImmuCC_label.csv",sep="")) 51 - return(ssGSEA_result) 39 + write.csv(ssGSEA_result, paste(filename, "_scImmuCC_label.csv", sep = "")) 52 40 }
+90 -58
R/seurat_maps.R
··· 1 1 #' @title Seurat Object. 2 - #' @description Creating dynamic Seurat Object to add annotation information and draw images. 3 - #' @details Input takes a count, genelist and scImmuCC result, returns tsne, umap, Dotplot and pheatmaps. 4 - #' @param count a matrix with cell unique barcodes as column names and gene names as row names . 5 - #' @param genematrix a data frame with cell types as column names . 6 - #' @param ssGSEA_result a data frame , scImmuCC1.1 return result . 7 - #' @param filename custom file name, character . 8 - #' @return 4 pictures. 2 + #' @description Creating dynamic Seurat Object to add annotation information 3 + #' and draw images. 4 + #' @details Input takes a count, genelist and scImmuCC result, returns tsne, 5 + #' umap, Dotplot and pheatmaps. 6 + #' @param count a matrix with cell unique barcodes as column names and 7 + #' gene names as row names 8 + #' @param genematrix Data frame with cell types as column names 9 + #' @param ssGSEA_result Data frame, scImmuCC return result 10 + #' @param filename Custom file name, char 11 + #' @return 4 pictures 9 12 #' @import ggplot2 10 13 #' @import Seurat 11 - #' @importFrom Seurat CreateSeuratObject NormalizeData FindVariableFeatures ScaleData PercentageFeatureSet VariableFeatures RunPCA RunUMAP RunTSNE DimPlot DotPlot DoHeatmap ProjectDim JackStraw ScoreJackStraw 14 + #' @importFrom Seurat CreateSeuratObject NormalizeData FindVariableFeatures 15 + #' ScaleData PercentageFeatureSet VariableFeatures RunPCA RunUMAP RunTSNE 16 + #' DimPlot DotPlot DoHeatmap ProjectDim JackStraw ScoreJackStraw 12 17 13 - 14 - 15 - seurat_Heatmap <- function(count,genematrix,ssGSEA_result,filename){ 16 - 18 + seurat_Heatmap <- function(count, genematrix, ssGSEA_result, filename) { 17 19 count <- count[, !duplicated(colnames(count))] 18 - celltype <- intersect(colnames(count),ssGSEA_result[,1]) 19 - labels <- ssGSEA_result[which(ssGSEA_result[,1]%in%celltype),] 20 - count <- count[,labels[,1]] 21 - 22 - seurat.data <- CreateSeuratObject(counts = count, project = filename)#, min.cells = 3, min.features = 200) 20 + celltype <- intersect(colnames(count), ssGSEA_result[, 1]) 21 + labels <- ssGSEA_result[which(ssGSEA_result[, 1] %in% celltype), ] 22 + count <- count[, labels[, 1]] 23 + 24 + seurat.data <- CreateSeuratObject(counts = count, project = filename) 23 25 seurat.data 24 - seurat.data[["percent.mt"]] <- PercentageFeatureSet(seurat.data, pattern = "^MT-") 25 - HB.genes_total <- c("HBA1","HBA2","HBB","HBD","HBE1","HBG1","HBG2","HBM","HBQ1","HBZ") 26 - HB_m <- match(HB.genes_total,rownames(seurat.data@assays$RNA)) 26 + seurat.data[["percent.mt"]] <- PercentageFeatureSet(seurat.data, 27 + pattern = "^MT-" 28 + ) 29 + HB.genes_total <- c( 30 + "HBA1", "HBA2", "HBB", "HBD", "HBE1", "HBG1", "HBG2", 31 + "HBM", "HBQ1", "HBZ" 32 + ) 33 + HB_m <- match(HB.genes_total, rownames(seurat.data@assays$RNA)) 27 34 28 35 HB.genes <- rownames(seurat.data@assays$RNA)[HB_m] 29 36 HB.genes <- HB.genes[!is.na(HB.genes)] 30 - seurat.data[["percent.HB"]]<-PercentageFeatureSet(seurat.data,features=HB.genes) 37 + seurat.data[["percent.HB"]] <- PercentageFeatureSet(seurat.data, 38 + features = HB.genes 39 + ) 31 40 32 - seurat.data <- NormalizeData(seurat.data, normalization.method = "LogNormalize", scale.factor = 10000) 33 - seurat.data <- FindVariableFeatures(seurat.data, selection.method = "vst", nfeatures = 2000) 41 + seurat.data <- NormalizeData(seurat.data, 42 + normalization.method = "LogNormalize", 43 + scale.factor = 10000 44 + ) 45 + seurat.data <- FindVariableFeatures(seurat.data, 46 + selection.method = "vst", 47 + nfeatures = 2000 48 + ) 34 49 all.genes <- rownames(seurat.data) 35 50 seurat.data <- ScaleData(seurat.data, features = all.genes) 36 51 37 - #Perform linear dimensional reductionPerform linear dimensional reduction 38 - #counts <- seurat.data[["RNA"]]@counts 52 + # Perform linear dimensional reduction 39 53 counts <- seurat.data[["RNA"]]$counts 40 - cells <- length(counts[2,]) 41 - if(cells>50){ 42 - seurat.data <- RunPCA(seurat.data, features = VariableFeatures(object = seurat.data)) 43 - }else{ 44 - seurat.data <- RunPCA(seurat.data,npcs = (cells-1), features = VariableFeatures(object = seurat.data)) 54 + cells <- length(counts[2, ]) 55 + if (cells > 50) { 56 + seurat.data <- RunPCA(seurat.data, 57 + features = VariableFeatures(object = seurat.data) 58 + ) 59 + } else { 60 + seurat.data <- RunPCA(seurat.data, 61 + npcs = (cells - 1), 62 + features = VariableFeatures(object = seurat.data) 63 + ) 45 64 } 46 - 65 + 47 66 head(seurat.data@reductions$pca@cell.embeddings) 48 67 head(seurat.data@reductions$pca@feature.loadings) 49 68 seurat.data <- ProjectDim(object = seurat.data) 50 69 seurat.data <- JackStraw(seurat.data, num.replicate = 100) 51 70 seurat.data <- ScoreJackStraw(seurat.data, dims = 1:20) 52 - #seurat.data <- JackStraw(seurat.data, dims = 50) 53 - #seurat.data <- ScoreJackStraw(seurat.data, dims = 1:50) 54 71 55 72 seurat.data <- RunUMAP(seurat.data, dims = 1:10) 56 - n <- length(count[2,]) 57 - #seurat.data <- seurat.data[ ,!duplicated(colnames(seurat.data))] 58 - 59 - min_cell_count <- 100 60 - if(ncol(seurat.data) >= min_cell_count){ 61 - seurat.data <- RunTSNE(seurat.data, dims = 1:10,check_duplicates = FALSE ) 62 - } 63 - else{ 64 - seurat.data <- RunTSNE(seurat.data, dims = 1:10, perplexity = 5,check_duplicates = FALSE ) 73 + n <- length(count[2, ]) 74 + 75 + min_cell_count <- 100 76 + if (ncol(seurat.data) >= min_cell_count) { 77 + seurat.data <- RunTSNE(seurat.data, dims = 1:10, check_duplicates = FALSE) 78 + } else { 79 + seurat.data <- RunTSNE(seurat.data, 80 + dims = 1:10, perplexity = 5, 81 + check_duplicates = FALSE 82 + ) 65 83 } 66 84 67 85 head(seurat.data@reductions$tsne@cell.embeddings) 68 86 69 - #Add annotation information to Seurat object 70 - seurat.data@meta.data$cell_type_pred <-labels[,2] 87 + # Add annotation information to Seurat object 88 + seurat.data@meta.data$cell_type_pred <- labels[, 2] 71 89 72 - pdf(paste(filename, "_tSNE", ".pdf", sep=""), width=12, height=10) 73 - p1 <- DimPlot(seurat.data, reduction = "tsne", group.by = "cell_type_pred",label = TRUE, pt.size=1) 90 + pdf(paste(filename, "_tSNE", ".pdf", sep = ""), width = 12, height = 10) 91 + p1 <- DimPlot(seurat.data, 92 + reduction = "tsne", 93 + group.by = "cell_type_pred", label = TRUE, pt.size = 1 94 + ) 74 95 plot(p1) 75 96 dev.off() 76 - pdf(paste(filename, "_UMAP", ".pdf", sep=""), width=12, height=10) 77 - p2 <- DimPlot(seurat.data, reduction = "umap", group.by = "cell_type_pred",label = TRUE, pt.size=1) 97 + pdf(paste(filename, "_UMAP", ".pdf", sep = ""), width = 12, height = 10) 98 + p2 <- DimPlot(seurat.data, 99 + reduction = "umap", 100 + group.by = "cell_type_pred", label = TRUE, pt.size = 1 101 + ) 78 102 plot(p2) 79 103 dev.off() 80 104 81 105 genelist <- as.list(genematrix) 82 - genelist <- lapply(genelist,function(x) x[!is.na(x)]) 106 + genelist <- lapply(genelist, function(x) x[!is.na(x)]) 83 107 gene <- c() 84 - for(i in 1:length(genelist)){ 85 - gene <- c(gene,genelist[[i]]) 108 + for (i in 1:length(genelist)) { 109 + gene <- c(gene, genelist[[i]]) 86 110 } 111 + 87 112 length(gene) 88 113 gene <- unique(gene) 89 - Y <- intersect(gene,rownames(count)) 114 + Y <- intersect(gene, rownames(count)) 90 115 length(Y) 91 116 features <- Y 92 - pdf(paste(filename,"_UMAP_DotPlot",".pdf",sep=""), width=12, height=10) 93 - p3 <- DotPlot(seurat.data, features = features,group.by = "cell_type_pred") + RotatedAxis() 117 + pdf(paste(filename, "_UMAP_DotPlot", ".pdf", sep = ""), 118 + width = 12, 119 + height = 10 120 + ) 121 + p3 <- DotPlot(seurat.data, 122 + features = features, 123 + group.by = "cell_type_pred" 124 + ) + RotatedAxis() 94 125 plot(p3) 95 126 dev.off() 96 127 97 - pdf(paste(filename, "_DoHeatmap.pdf", sep=""), width=12, height=10) 98 - p4 <- DoHeatmap(seurat.data, features = Y,group.by = "cell_type_pred") + NoLegend() 128 + pdf(paste(filename, "_DoHeatmap.pdf", sep = ""), width = 12, height = 10) 129 + p4 <- DoHeatmap(seurat.data, 130 + features = Y, 131 + group.by = "cell_type_pred" 132 + ) + NoLegend() 99 133 plot(p4) 100 134 dev.off() 101 - 102 135 } 103 -
data/CR0_genelist.rda

This is a binary file and will not be displayed.

data/CR1_genelist.rda

This is a binary file and will not be displayed.

data/layer0_genelist.rda

This is a binary file and will not be displayed.

data/layer1_genelist.rda

This is a binary file and will not be displayed.

+21 -21
extdata/Bcell_layer2_genelist.csv extdata/Bcell_cr2_genelist.csv
··· 1 - Naive_B,Memory_B,Plasma_Cell 2 - TCL1A,MS4A1,TNFRSF17 3 - FCER2,LINC00926,GPRC5D 4 - LINC00926,BANK1,DERL3 5 - FCER2,CD79A,IGF1 6 - MS4A1,HLA-DQB1,GLDC 7 - CD79A,FCER2,HRASLS2 8 - BANK1,HLA-DQA1,SPACA3 9 - FCRL1,CD22,SDC1 10 - HLA-DQB1,FCRL2,MZB1 11 - HVCN1,ADAM28,TXNDC5 12 - HLA-DQA1,IGLL5,IgG 13 - ,P2RX5,IGHG4 14 - ,BLK,IGHG1 15 - ,,IGHG3 16 - ,,IGKC 17 - ,,SSR4 18 - ,,FKBP11 19 - ,,AREG 20 - ,,IGLC2 21 - ,,KLRD1 1 + Naive_B,Memory_B,Plasma_Cell 2 + TCL1A,MS4A1,TNFRSF17 3 + FCER2,LINC00926,GPRC5D 4 + LINC00926,BANK1,DERL3 5 + FCER2,CD79A,IGF1 6 + MS4A1,HLA-DQB1,GLDC 7 + CD79A,FCER2,HRASLS2 8 + BANK1,HLA-DQA1,SPACA3 9 + FCRL1,CD22,SDC1 10 + HLA-DQB1,FCRL2,MZB1 11 + HVCN1,ADAM28,TXNDC5 12 + HLA-DQA1,IGLL5,IgG 13 + ,P2RX5,IGHG4 14 + ,BLK,IGHG1 15 + ,,IGHG3 16 + ,,IGKC 17 + ,,SSR4 18 + ,,FKBP11 19 + ,,AREG 20 + ,,IGLC2 21 + ,,KLRD1
+37 -37
extdata/CD4_layer3_genelist.csv extdata/CD4_cr3_genelist.csv
··· 1 - CD4_naive,Treg,Th1,Th2,Th17,Tfh,CD4_Central_memory,CD4_Effector_memory 2 - TCF7,FOXP3,CD28,ADORA2A,CD274,CD200,MALT1,GFI1 3 - CCR7,CTLA4,CD274,APOE,IL10RA,CD83,PDK1,MALT1 4 - CD62L,CD25,IL2,C5AR1,PDCD1,CD84,SKIV2L,SERPINB6 5 - CD127,GITR,IL4,IL13RA1,IL6,B3GAT1,CCR7,LRRC32 6 - CD45RA,TIGIT,IL6,MMP9,IL17A,CDK5R1,IL23A,PDK1 7 - CD132,IL10,IL10RA,MYD88,IL17AF,IL21,CD27,SKIV2L 8 - IKBKE,AITR,IL12,PTPN13,IL17F,CXCR5,CD28,SPNS2 9 - LAMP3,LAG3,IL23A,SPI1,IL21,IL4,CD45RO,SSU72 10 - TRABD2A,LTA,MYD88,TBX21,IL22,STAT3,CD62L,TREX1 11 - LEF1,IL2RA,PDCD1,TLR4,IL23R,BCL6,CD44,CXCL14 12 - BCL11B,ITGAE,PLP1,STAT6,AHR,c-MAF,IL7R,NLRP3 13 - LDLRAP1,GARPh,PTPN2,TIGIT,BATF,BTLA,CD127,TNFRSF4 14 - ,LAPh,TGFB1,TNFRSF4,IL21R,CXCL13,TNFRSF25,SSU72 15 - ,CCR8,CASP8,TSLP,CCR6,B3GAT1,ETS1,TREX1 16 - ,TGFBR1,CRP,USP38,RORA,CD57,AKT3,CD127 17 - ,IL9,IL27RA,GATA3,RORγt,IRF4,ITK,KLRG1 18 - ,SKP2,ICAM1,IRF4,RORC,BATF,TNFSF8,KRG1 19 - ,IL2,IL12B,IL4,IL1R,SLAM,SF3A3,IL12RB1 20 - ,IL10R,TBET,IL5,CTSH,OX4OL,ZNF143,TNFSF4 21 - ,TSC1,IL12R,IL13,IL4I1,CD40L,SMAD3,GPATCH3 22 - ,RICTOR,CXCR3,IL25R,LGALS3,CMAF,CNOT4,PRPF38A 23 - ,,IL18,IL33R,,CD200,CCR4,ITCH 24 - ,,STAT1,BATF,,GNG4,SESN3,IL23R 25 - ,,STAT4,GATA-3,,POU2AF1,TRAT1,ATM 26 - ,,IFNG,STAT6,,IGFBP4,,PNMA1 27 - ,,IL3,CRTH2,,,,RORA 28 - ,,TNF,IL17RB,,,,BMI1 29 - ,,CSF2,ST2,,,,DLL1 30 - ,,,TIM1,,,,FCF1 31 - ,,,CCR4,,,,ATG5 32 - ,,,CCR8,,,, 33 - ,,,CRTH2,,,, 34 - ,,,PTGDR2,,,, 35 - ,,,SEMA5A,,,, 36 - ,,,AKAP12,,,, 37 - ,,,HPGDS,,,, 1 + CD4_naive,Treg,Th1,Th2,Th17,Tfh,CD4_Central_memory,CD4_Effector_memory 2 + TCF7,FOXP3,CD28,ADORA2A,CD274,CD200,MALT1,GFI1 3 + CCR7,CTLA4,CD274,APOE,IL10RA,CD83,PDK1,MALT1 4 + CD62L,CD25,IL2,C5AR1,PDCD1,CD84,SKIV2L,SERPINB6 5 + CD127,GITR,IL4,IL13RA1,IL6,B3GAT1,CCR7,LRRC32 6 + CD45RA,TIGIT,IL6,MMP9,IL17A,CDK5R1,IL23A,PDK1 7 + CD132,IL10,IL10RA,MYD88,IL17AF,IL21,CD27,SKIV2L 8 + IKBKE,AITR,IL12,PTPN13,IL17F,CXCR5,CD28,SPNS2 9 + LAMP3,LAG3,IL23A,SPI1,IL21,IL4,CD45RO,SSU72 10 + TRABD2A,LTA,MYD88,TBX21,IL22,STAT3,CD62L,TREX1 11 + LEF1,IL2RA,PDCD1,TLR4,IL23R,BCL6,CD44,CXCL14 12 + BCL11B,ITGAE,PLP1,STAT6,AHR,c-MAF,IL7R,NLRP3 13 + LDLRAP1,GARPh,PTPN2,TIGIT,BATF,BTLA,CD127,TNFRSF4 14 + ,LAPh,TGFB1,TNFRSF4,IL21R,CXCL13,TNFRSF25,SSU72 15 + ,CCR8,CASP8,TSLP,CCR6,B3GAT1,ETS1,TREX1 16 + ,TGFBR1,CRP,USP38,RORA,CD57,AKT3,CD127 17 + ,IL9,IL27RA,GATA3,RORγt,IRF4,ITK,KLRG1 18 + ,SKP2,ICAM1,IRF4,RORC,BATF,TNFSF8,KRG1 19 + ,IL2,IL12B,IL4,IL1R,SLAM,SF3A3,IL12RB1 20 + ,IL10R,TBET,IL5,CTSH,OX4OL,ZNF143,TNFSF4 21 + ,TSC1,IL12R,IL13,IL4I1,CD40L,SMAD3,GPATCH3 22 + ,RICTOR,CXCR3,IL25R,LGALS3,CMAF,CNOT4,PRPF38A 23 + ,,IL18,IL33R,,CD200,CCR4,ITCH 24 + ,,STAT1,BATF,,GNG4,SESN3,IL23R 25 + ,,STAT4,GATA-3,,POU2AF1,TRAT1,ATM 26 + ,,IFNG,STAT6,,IGFBP4,,PNMA1 27 + ,,IL3,CRTH2,,,,RORA 28 + ,,TNF,IL17RB,,,,BMI1 29 + ,,CSF2,ST2,,,,DLL1 30 + ,,,TIM1,,,,FCF1 31 + ,,,CCR4,,,,ATG5 32 + ,,,CCR8,,,, 33 + ,,,CRTH2,,,, 34 + ,,,PTGDR2,,,, 35 + ,,,SEMA5A,,,, 36 + ,,,AKAP12,,,, 37 + ,,,HPGDS,,,,
+23 -23
extdata/CD8_layer3_genelist.csv extdata/CD8_cr3_genelist.csv
··· 1 - CD8_naive,CD8_Cytotoxic,CD8_Exhausted,CD8_Central_memory,CD8_Effector_memory 2 - NELL2,AP20187,LAG3,MALT1,GFI1 3 - REG4,ERBB2,PD1,IDO1,IL23R 4 - CD248,GFI1,TIM3,SKIV2L,MALT1 5 - MGAT4A,IL18,2B4,TRAF2,JAK3 6 - NELL2,IL23R,CD200,SLC2A1,PDCD1LG2 7 - CCR7,MALT1,TOX2,CD40LG,SELPLG 8 - LEF1,MUC1,TOX,GZMK,SPNS2 9 - APBA2,TERT,PRDM1,CCL5,BRD4 10 - CARS,ADIPOQ,RBPJ,DUSP2,C1QBP 11 - PIK3IP1,CD274,PDCD1,LYAR,ITPR2 12 - ,INS,TIGIT,ZNF683,NLRP3 13 - ,IPMK,HAVCR2,IL32,TRAF2 14 - ,PRF1,ZNF683,CXCR3,GZMK 15 - ,GZMA,LAYN,IL7R,DUSP2 16 - ,GZMB,ITGAE,TYROBP,CCL5 17 - ,GZMK,ANO6,,CST7 18 - ,NKG7,CDX-1127,,GZMA 19 - ,GNLY,IL2RB,,CMC1 20 - ,CX3CR1,MALT1,,CCL4 21 - ,KLRG1,NR1H4,,GZMM 22 - ,FGFBP2,TNFRSF18,, 23 - ,FCGR3A,VTCN1,, 1 + CD8_naive,CD8_Cytotoxic,CD8_Exhausted,CD8_Central_memory,CD8_Effector_memory 2 + NELL2,AP20187,LAG3,MALT1,GFI1 3 + REG4,ERBB2,PD1,IDO1,IL23R 4 + CD248,GFI1,TIM3,SKIV2L,MALT1 5 + MGAT4A,IL18,2B4,TRAF2,JAK3 6 + NELL2,IL23R,CD200,SLC2A1,PDCD1LG2 7 + CCR7,MALT1,TOX2,CD40LG,SELPLG 8 + LEF1,MUC1,TOX,GZMK,SPNS2 9 + APBA2,TERT,PRDM1,CCL5,BRD4 10 + CARS,ADIPOQ,RBPJ,DUSP2,C1QBP 11 + PIK3IP1,CD274,PDCD1,LYAR,ITPR2 12 + ,INS,TIGIT,ZNF683,NLRP3 13 + ,IPMK,HAVCR2,IL32,TRAF2 14 + ,PRF1,ZNF683,CXCR3,GZMK 15 + ,GZMA,LAYN,IL7R,DUSP2 16 + ,GZMB,ITGAE,TYROBP,CCL5 17 + ,GZMK,ANO6,,CST7 18 + ,NKG7,CDX-1127,,GZMA 19 + ,GNLY,IL2RB,,CMC1 20 + ,CX3CR1,MALT1,,CCL4 21 + ,KLRG1,NR1H4,,GZMM 22 + ,FGFBP2,TNFRSF18,, 23 + ,FCGR3A,VTCN1,,
+19 -19
extdata/DC_layer2_genelist.csv extdata/DC_cr2_genelist.csv
··· 1 - cDC,pDC 2 - ENHO,LILRA4 3 - FCER1A,CLEC4C 4 - IGSF6,IL3RA 5 - CTSV,SMPD3 6 - ANXA2,SERPINF1 7 - H2AFZ,PLD4 8 - LGALS1,PTPRS 9 - HLA-DPA1,SCT 10 - CLSPN,PTCRA 11 - TUBA1B,IRF7 12 - CLEC10A,IRF8 13 - CD1C,CCDC50 14 - PKIB,TCF4 15 - CD1E,UGCG 16 - HLA-DQA1,ITM2C 17 - HLA-DQB1,LGMN 18 - HLA-DRB5,LILRA4 19 - CPVL,APP 1 + cDC,pDC 2 + ENHO,LILRA4 3 + FCER1A,CLEC4C 4 + IGSF6,IL3RA 5 + CTSV,SMPD3 6 + ANXA2,SERPINF1 7 + H2AFZ,PLD4 8 + LGALS1,PTPRS 9 + HLA-DPA1,SCT 10 + CLSPN,PTCRA 11 + TUBA1B,IRF7 12 + CLEC10A,IRF8 13 + CD1C,CCDC50 14 + PKIB,TCF4 15 + CD1E,UGCG 16 + HLA-DQA1,ITM2C 17 + HLA-DQB1,LGMN 18 + HLA-DRB5,LILRA4 19 + CPVL,APP
+62 -62
extdata/ILC_layer2_genelist.csv extdata/ILC_cr2_genelist.csv
··· 1 - ILC1,ILC2,ILC3 2 - SYNE2,GNLY,KIT 3 - CCL5,KLRD1,KLRB1 4 - HSPA1B,CCL4,KLRD1 5 - CD3E,CMC,GZMK 6 - FYB1,NKG7,GZMH 7 - TRAT1,IL5,CXCL8 8 - DNAJB1,IL13,CD83 9 - TBX21,IL1RL1,LST1 10 - EOMES,PDE4A,IL1R1 11 - CXCR3,RORA,CXCL2 12 - IL12RB1,BCL11B,ATP1B3 13 - IL12RB2,PTGDR2,NRIP1 14 - IL18RAP,KLRG1,VEGFA 15 - IL18R1,IL17RB,NCOA7 16 - KLRD1,CRLF2,RORC 17 - KLRC1,,NFIL3 18 - KLRF1,,AHR 19 - ,,IL23R 20 - ,,CSF2 21 - ,,TNF 22 - ,, 23 - ,, 24 - ,, 25 - ,, 26 - ,, 27 - ,, 28 - ,, 29 - ,, 30 - ,, 31 - ,, 32 - ,, 33 - ,, 34 - ,, 35 - ,, 36 - ,, 37 - ,, 38 - ,, 39 - ,, 40 - ,, 41 - ,, 42 - ,, 43 - ,, 44 - ,, 45 - ,, 46 - ,, 47 - ,, 48 - ,, 49 - ,, 50 - ,, 51 - ,, 52 - ,, 53 - ,, 54 - ,, 55 - ,, 56 - ,, 57 - ,, 58 - ,, 59 - ,, 60 - ,, 61 - ,, 62 - ,, 1 + ILC1,ILC2,ILC3 2 + SYNE2,GNLY,KIT 3 + CCL5,KLRD1,KLRB1 4 + HSPA1B,CCL4,KLRD1 5 + CD3E,CMC,GZMK 6 + FYB1,NKG7,GZMH 7 + TRAT1,IL5,CXCL8 8 + DNAJB1,IL13,CD83 9 + TBX21,IL1RL1,LST1 10 + EOMES,PDE4A,IL1R1 11 + CXCR3,RORA,CXCL2 12 + IL12RB1,BCL11B,ATP1B3 13 + IL12RB2,PTGDR2,NRIP1 14 + IL18RAP,KLRG1,VEGFA 15 + IL18R1,IL17RB,NCOA7 16 + KLRD1,CRLF2,RORC 17 + KLRC1,,NFIL3 18 + KLRF1,,AHR 19 + ,,IL23R 20 + ,,CSF2 21 + ,,TNF 22 + ,, 23 + ,, 24 + ,, 25 + ,, 26 + ,, 27 + ,, 28 + ,, 29 + ,, 30 + ,, 31 + ,, 32 + ,, 33 + ,, 34 + ,, 35 + ,, 36 + ,, 37 + ,, 38 + ,, 39 + ,, 40 + ,, 41 + ,, 42 + ,, 43 + ,, 44 + ,, 45 + ,, 46 + ,, 47 + ,, 48 + ,, 49 + ,, 50 + ,, 51 + ,, 52 + ,, 53 + ,, 54 + ,, 55 + ,, 56 + ,, 57 + ,, 58 + ,, 59 + ,, 60 + ,, 61 + ,, 62 + ,,
+62 -62
extdata/Macrophage_layer2_genelist.csv extdata/Macrophage_cr2_genelist.csv
··· 1 - Macrophage_M1,Macrophage_M2 2 - iNOS,ARG1 3 - IL12,ARG2 4 - CD64,FCER2 5 - CD80,IL10 6 - CXCR10,CD32 7 - IL23,CD163 8 - CXCL9,CD23 9 - CXCL10,CD200R1 10 - CXCL11,PD-L2 11 - CD86,PD-L1 12 - IL1A,MARCO 13 - IL1B,CSF1R 14 - IL6,CD206 15 - TNFa,Il1RA 16 - MHCII,Il1R2 17 - CCL5,IL4R 18 - IRF5,CCL4 19 - IRF1,CCL13 20 - CD40,CCL20 21 - IDO1,CCL17 22 - KYNU,CCL18 23 - CCR7,CCL22 24 - B7-1,CCL24 25 - B7-2,LYVE1 26 - ,VEGFA 27 - ,VEGFB 28 - ,VEGFC 29 - ,VEGFD 30 - ,EGF 31 - ,CTSA 32 - ,CTSB 33 - ,CSTC 34 - ,CTSD 35 - ,TGFB1 36 - ,TGFB2 37 - ,TGFB3 38 - ,MMP14 39 - ,MMP19 40 - ,MMP9 41 - ,CLEC7A 42 - ,WNT7b 43 - ,FASL 44 - ,TNFSF12 45 - ,TNFSF8 46 - ,CD276 47 - ,VTCN1 48 - ,MSR1 49 - ,FN1 50 - ,IRF4 51 - ,HLA-DR 52 - ,CD205 53 - ,CD14 54 - ,PDL2 55 - ,PDL1 56 - ,PDCD1LG2 57 - ,CD274 58 - ,MRC1 59 - ,IL1RN 60 - ,B7-H3 61 - ,BH-H4 62 - ,CD204 1 + Macrophage_M1,Macrophage_M2 2 + iNOS,ARG1 3 + IL12,ARG2 4 + CD64,FCER2 5 + CD80,IL10 6 + CXCR10,CD32 7 + IL23,CD163 8 + CXCL9,CD23 9 + CXCL10,CD200R1 10 + CXCL11,PD-L2 11 + CD86,PD-L1 12 + IL1A,MARCO 13 + IL1B,CSF1R 14 + IL6,CD206 15 + TNFa,Il1RA 16 + MHCII,Il1R2 17 + CCL5,IL4R 18 + IRF5,CCL4 19 + IRF1,CCL13 20 + CD40,CCL20 21 + IDO1,CCL17 22 + KYNU,CCL18 23 + CCR7,CCL22 24 + B7-1,CCL24 25 + B7-2,LYVE1 26 + ,VEGFA 27 + ,VEGFB 28 + ,VEGFC 29 + ,VEGFD 30 + ,EGF 31 + ,CTSA 32 + ,CTSB 33 + ,CSTC 34 + ,CTSD 35 + ,TGFB1 36 + ,TGFB2 37 + ,TGFB3 38 + ,MMP14 39 + ,MMP19 40 + ,MMP9 41 + ,CLEC7A 42 + ,WNT7b 43 + ,FASL 44 + ,TNFSF12 45 + ,TNFSF8 46 + ,CD276 47 + ,VTCN1 48 + ,MSR1 49 + ,FN1 50 + ,IRF4 51 + ,HLA-DR 52 + ,CD205 53 + ,CD14 54 + ,PDL2 55 + ,PDL1 56 + ,PDCD1LG2 57 + ,CD274 58 + ,MRC1 59 + ,IL1RN 60 + ,B7-H3 61 + ,BH-H4 62 + ,CD204
+12 -12
extdata/Monocyte_layer2_genelist.csv extdata/Monocyte_cr2_genelist.csv
··· 1 - Classical_Mono,NonClassical_Mono 2 - CD14,CD16 3 - VCAN,C1QA 4 - CD36,CDKN1C 5 - FOSL2,HES4 6 - S100A12,MS4A7 7 - PLAUR,FCGR3A 8 - LGALS2,TCF7L2 9 - MNDA,HMOX1 10 - SLC11A1,LYPD2 11 - ,IFITM3 12 - ,CSF1R 1 + Classical_Mono,NonClassical_Mono 2 + CD14,CD16 3 + VCAN,C1QA 4 + CD36,CDKN1C 5 + FOSL2,HES4 6 + S100A12,MS4A7 7 + PLAUR,FCGR3A 8 + LGALS2,TCF7L2 9 + MNDA,HMOX1 10 + SLC11A1,LYPD2 11 + ,IFITM3 12 + ,CSF1R
+25 -25
extdata/NK_layer2_genelist.csv extdata/NK_cr2_genelist.csv
··· 1 - NK_bright,NK_dim 2 - CD56,CD16 3 - ARH,ENC1 4 - BMP2,TTC38 5 - COL9A2,PRF1 6 - IL7R,CMKLR1 7 - GZMK,BOK 8 - JAML,CX3CR1 9 - CCDC141,DGKK 10 - ITM2C,SLC1A7 11 - XCL1,MYOM2 12 - SYPL1,MTSS1 13 - SETD7,FGFBP2 14 - RCAN3,LGR6 15 - KIT,KIR2DL1 16 - SPRY2,CD298 17 - ,ATP1B3 18 - ,ADGRG1 19 - ,TGFBR3 20 - ,SPON2 21 - ,ZEB2 22 - ,BNC2 23 - ,EBF4 24 - ,ASCL2 25 - ,TBX21 1 + NK_bright,NK_dim 2 + CD56,CD16 3 + ARH,ENC1 4 + BMP2,TTC38 5 + COL9A2,PRF1 6 + IL7R,CMKLR1 7 + GZMK,BOK 8 + JAML,CX3CR1 9 + CCDC141,DGKK 10 + ITM2C,SLC1A7 11 + XCL1,MYOM2 12 + SYPL1,MTSS1 13 + SETD7,FGFBP2 14 + RCAN3,LGR6 15 + KIT,KIR2DL1 16 + SPRY2,CD298 17 + ,ATP1B3 18 + ,ADGRG1 19 + ,TGFBR3 20 + ,SPON2 21 + ,ZEB2 22 + ,BNC2 23 + ,EBF4 24 + ,ASCL2 25 + ,TBX21
+19 -19
extdata/Tcell_layer2_genelist.csv extdata/Tcell_cr2_genelist.csv
··· 1 - CD4_T,CD8_T 2 - CD4,CD8A 3 - TRDC,CD8B 4 - IL2RA,GZMB 5 - CD25,EOMES 6 - STAT1,TNFA 7 - IL2,IFNG 8 - CD127,CCL5 9 - CD152,NKG7 10 - CTLA4,GZMH 11 - CTLA-4,GZMK 12 - FOXP3,GZMA 13 - IL4,CD8 14 - IL10, 15 - IL12, 16 - TGFB, 17 - IL18, 18 - STAT5, 19 - CD4, 1 + CD4_T,CD8_T 2 + CD4,CD8A 3 + TRDC,CD8B 4 + IL2RA,GZMB 5 + CD25,EOMES 6 + STAT1,TNFA 7 + IL2,IFNG 8 + CD127,CCL5 9 + CD152,NKG7 10 + CTLA4,GZMH 11 + CTLA-4,GZMK 12 + FOXP3,GZMA 13 + IL4,CD8 14 + IL10, 15 + IL12, 16 + TGFB, 17 + IL18, 18 + STAT5, 19 + CD4,
+25 -25
extdata/immune_non-immune_genelist(layer0).csv extdata/ImmuneOrNot_cr0_genelist.csv
··· 1 - Immune,Non_Immune 2 - PTPRC,MUC5A 3 - CD45,KRT5 4 - CSF3R,SFTPD 5 - FCGR3B,EPCAM 6 - KLRD1,CDH5 7 - FPR1,COL1A2 8 - CD8A,ACTA2 9 - CD1B,PECAM1 10 - TNFRSF17,COL3A1 11 - BANK1,TMSB10 12 - FCRL2,CALD1 13 - PNOC,FTH1 14 - CR2,COL6A2 15 - FCN1,FKBP1A 16 - GNLY, 17 - KIR2DL1, 18 - KIR3DL1, 19 - KIR3DL2, 20 - CD1E, 21 - CD1A, 22 - CD163, 23 - AIF1, 24 - CD79A, 25 - JCHAIN, 1 + Immune,Non_Immune 2 + PTPRC,MUC5A 3 + CD45,KRT5 4 + CSF3R,SFTPD 5 + FCGR3B,EPCAM 6 + KLRD1,CDH5 7 + FPR1,COL1A2 8 + CD8A,ACTA2 9 + CD1B,PECAM1 10 + TNFRSF17,COL3A1 11 + BANK1,TMSB10 12 + FCRL2,CALD1 13 + PNOC,FTH1 14 + CR2,COL6A2 15 + FCN1,FKBP1A 16 + GNLY, 17 + KIR2DL1, 18 + KIR3DL1, 19 + KIR3DL2, 20 + CD1E, 21 + CD1A, 22 + CD163, 23 + AIF1, 24 + CD79A, 25 + JCHAIN,
+45 -45
extdata/main_type_layer1_genelist.csv extdata/MainTypes_cr1_genelist.csv
··· 1 - Tcell,Bcell,DC,NK,Monocyte,Macrophage,ILC,Mast,Neutrophil 2 - CD3D,CD79A,IL3RA,GNLY,VCAN,APOE,IRF8,TPSB2,CSF3R 3 - CD3G,CD79B,CD1C,KLRC1,CSF3R,APOC1,PLD4,TPSAB1,FCGR3B 4 - CD3E,MS4A1,BATF3,FGFBP2,CDKN1C,C1QB,IRF7,TPSD1,FPR1 5 - CD4,CD19,THBD,KLRF1,LRRC25,C1QC,LILRA4,TESPA1,CEACAM3 6 - CD8A,CD20,CD209,GZMH,TCF7L2,RNASE1,TCF4,RGS13,TNFRSF10C 7 - CD8B,AFF3,HLA-DPB1,PRF1,LYN,ACP5,SERPINF1,SLC18A2,PLXNC1 8 - FOXP3,BANK1,HLA-DQA1,KLRD1,PILRA,GPNMB,CCDC50,CPA3,FCAR 9 - IL2RA,BLK,CSF2RA,NKG7,FCGR1A,PLD3,UGCG,MS4A2,ABTB1 10 - IL7R,BTLA,HLA-DRA,GZMB,CTSS,CTSB,APP,HPGDS,SLC25A37 11 - TRAC,CD138,HLA-DPA1,SPON2,FCN1,PLTP,PPP1R14B,ADCYAP1,CXCR1 12 - CTLA4,MZB1,HLA-DRB1,CD56,VCAN,CD9,IRF4,HDC,BCL6 13 - DFNB31,IGHM,HLA-DQB1,,CSF3R,PRDX1,TSPAN13,FCER1A,NCF2 14 - EOMES,IGHG3,LDLRAD4,,LYZ,CTSZ,SPIB,GATA2,CXCR2 15 - TIM3,IGHA2,HLA-DRB5,,FCN1,DAB2,TPM2,KIT,MGAM 16 - ,,RALA,,CTSS,CD63,LILRB4,,FAM65B 17 - ,,HLA-DRB6,,CD14,CD81,LRRC26,,THBD 18 - ,,AXL,,SA00A9,LIPA,BCL11A,,LILRA2 19 - ,,CD86,,IF130,GLUL,SOX4,,CAMP 20 - ,,HLA-DMB,,AIF1,SLCO2B1,KRT86,,TNFSF14 21 - ,,FCER1A,,,CREG1,KRT81,,SEPX1 22 - ,,HBB,,,LGALS3,IL23R,,XPO6 23 - ,,CPVL,,,LAMP1,PCDH9,,CD97 24 - ,,CD74,,,MARCO,DLL1,,TNFRSF1A 25 - ,,CST3,,,FABP4,RORC,, 26 - ,,CD123,,,MCEMP1,PDZK1,, 27 - ,,CD103,,,MERTK,TNFSF11,, 28 - ,,CD1E,,,CD163,ENPP1,, 29 - ,,CD1A,,,FCGR3A,B3GALT5,, 30 - ,,CLEC10A,,,LGMN,NCR2,, 31 - ,,SIGLEC1,,,PLA2G7,LIF,, 32 - ,,UBD,,,CSF1R,IL4I1,, 33 - ,,STAB1,,,CYBB,SLC4A10,, 34 - ,,CSF2RA,,,CD163,HOXA9,, 35 - ,,GPR109B,,,NPL,CSF2,, 36 - ,,SIGLEC5,,,FN1,TLE1,, 37 - ,,,,,IL1B,TNFSF4,, 38 - ,,,,,S100A8,IL1R1,, 39 - ,,,,,MS4A6A,B3GNT7,, 40 - ,,,,,FCER1Q,AMFR,, 41 - ,,,,,,HIF3A,, 42 - ,,,,,,MTRNR2L6,, 43 - ,,,,,,MTRNR2L10,, 44 - ,,,,,,LTB,, 45 - ,,,,,,MTRNR2L1,, 1 + Tcell,Bcell,DC,NK,Monocyte,Macrophage,ILC,Mast,Neutrophil 2 + CD3D,CD79A,IL3RA,GNLY,VCAN,APOE,IRF8,TPSB2,CSF3R 3 + CD3G,CD79B,CD1C,KLRC1,CSF3R,APOC1,PLD4,TPSAB1,FCGR3B 4 + CD3E,MS4A1,BATF3,FGFBP2,CDKN1C,C1QB,IRF7,TPSD1,FPR1 5 + CD4,CD19,THBD,KLRF1,LRRC25,C1QC,LILRA4,TESPA1,CEACAM3 6 + CD8A,CD20,CD209,GZMH,TCF7L2,RNASE1,TCF4,RGS13,TNFRSF10C 7 + CD8B,AFF3,HLA-DPB1,PRF1,LYN,ACP5,SERPINF1,SLC18A2,PLXNC1 8 + FOXP3,BANK1,HLA-DQA1,KLRD1,PILRA,GPNMB,CCDC50,CPA3,FCAR 9 + IL2RA,BLK,CSF2RA,NKG7,FCGR1A,PLD3,UGCG,MS4A2,ABTB1 10 + IL7R,BTLA,HLA-DRA,GZMB,CTSS,CTSB,APP,HPGDS,SLC25A37 11 + TRAC,CD138,HLA-DPA1,SPON2,FCN1,PLTP,PPP1R14B,ADCYAP1,CXCR1 12 + CTLA4,MZB1,HLA-DRB1,CD56,VCAN,CD9,IRF4,HDC,BCL6 13 + DFNB31,IGHM,HLA-DQB1,,CSF3R,PRDX1,TSPAN13,FCER1A,NCF2 14 + EOMES,IGHG3,LDLRAD4,,LYZ,CTSZ,SPIB,GATA2,CXCR2 15 + TIM3,IGHA2,HLA-DRB5,,FCN1,DAB2,TPM2,KIT,MGAM 16 + ,,RALA,,CTSS,CD63,LILRB4,,FAM65B 17 + ,,HLA-DRB6,,CD14,CD81,LRRC26,,THBD 18 + ,,AXL,,SA00A9,LIPA,BCL11A,,LILRA2 19 + ,,CD86,,IF130,GLUL,SOX4,,CAMP 20 + ,,HLA-DMB,,AIF1,SLCO2B1,KRT86,,TNFSF14 21 + ,,FCER1A,,,CREG1,KRT81,,SEPX1 22 + ,,HBB,,,LGALS3,IL23R,,XPO6 23 + ,,CPVL,,,LAMP1,PCDH9,,CD97 24 + ,,CD74,,,MARCO,DLL1,,TNFRSF1A 25 + ,,CST3,,,FABP4,RORC,, 26 + ,,CD123,,,MCEMP1,PDZK1,, 27 + ,,CD103,,,MERTK,TNFSF11,, 28 + ,,CD1E,,,CD163,ENPP1,, 29 + ,,CD1A,,,FCGR3A,B3GALT5,, 30 + ,,CLEC10A,,,LGMN,NCR2,, 31 + ,,SIGLEC1,,,PLA2G7,LIF,, 32 + ,,UBD,,,CSF1R,IL4I1,, 33 + ,,STAB1,,,CYBB,SLC4A10,, 34 + ,,CSF2RA,,,CD163,HOXA9,, 35 + ,,GPR109B,,,NPL,CSF2,, 36 + ,,SIGLEC5,,,FN1,TLE1,, 37 + ,,,,,IL1B,TNFSF4,, 38 + ,,,,,S100A8,IL1R1,, 39 + ,,,,,MS4A6A,B3GNT7,, 40 + ,,,,,FCER1Q,AMFR,, 41 + ,,,,,,HIF3A,, 42 + ,,,,,,MTRNR2L6,, 43 + ,,,,,,MTRNR2L10,, 44 + ,,,,,,LTB,, 45 + ,,,,,,MTRNR2L1,,