Commit dcb0bf5f authored by Matteo Barcella's avatar Matteo Barcella
Browse files

Adding Fig2C dataset markers

parent 73467876
...@@ -18,7 +18,7 @@ library(dplyr) ...@@ -18,7 +18,7 @@ library(dplyr)
# load seurat object # load seurat object
obj <- readRDS("CultureDataset.rds") obj <- readRDS("Fig2C_Dataset.rds")
# setting color palette: # setting color palette:
......
...@@ -18,7 +18,7 @@ library(dplyr) ...@@ -18,7 +18,7 @@ library(dplyr)
# load seurat object # load seurat object
obj <- readRDS("CultureDataset.rds") obj <- readRDS("Fig2C_Dataset.rds")
obj <- subset(obj, cells = WhichCells(object = obj,expression = orig.ident %in% c("C04","C02","C03"))) obj <- subset(obj, cells = WhichCells(object = obj,expression = orig.ident %in% c("C04","C02","C03")))
obj <- SetIdent(object = obj, value = "Population") obj <- SetIdent(object = obj, value = "Population")
......
library(Seurat)
library(ggplot2)
library(harmony)
library(RColorBrewer)
library(plotly)
library(htmlwidgets)
library(ComplexHeatmap)
library(openxlsx)
library(dplyr)
library(future)
library(gridExtra)
options(future.globals.maxSize = 96 * 1024^3)
cur_dir <- getwd()
obj <- readRDS(file = "Fig2C_Dataset.rds")
markers_dir <- "tables/"
sampleid <- "Full"
integration.var <- "orig.ident"
# setup multiprocess with future library
no_cores <- availableCores() - 1
plan("multicore", workers = no_cores)
markers <- list()
start <- Sys.time()
obj <- SetIdent(object = obj, value = "Population")
markers <- FindAllMarkers(object = obj, logfc.threshold = 0, min.pct = 0.2, only.pos = F, return.thresh = 1.1)
end <- Sys.time()
time2process <- as.numeric(end - start, units = "secs")
print(paste0("Time to complete Markers on", length(Cells(obj)), " cells with ", no_cores, " Population ", time2process))
saveRDS(markers, file = paste0(markers_dir,sampleid,"_GSEA_markers_Population_Fig2C_Dataset.rds"))
df <- split(x = markers, f = markers$cluster)
write.xlsx(x = df, file = paste0(markers_dir,sampleid,"_GSEA_markers_Population_Fig2C_Dataset.xlsx"), asTable = T, overwrite = T)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment