diff --git a/R/GSE148946/DiabetesFibroblastGSE148946Nuclei.r b/R/GSE148946/DiabetesFibroblastGSE148946Nuclei.r index 0400615..2eb5084 100644 --- a/R/GSE148946/DiabetesFibroblastGSE148946Nuclei.r +++ b/R/GSE148946/DiabetesFibroblastGSE148946Nuclei.r @@ -4,18 +4,22 @@ library(patchwork) library(clustifyr) library(tidyverse) -mat_FibroblastNucleiDiabetes <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE148nnn/GSE148946/suppl/GSE148946_wholecell_normdata.csv.gz") +mat_FibroblastNucleiDiabetesExtraCol <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE148nnn/GSE148946/suppl/GSE148946_wholecell_normdata.csv.gz") +mat_FibroblastNucleiDiabetes = subset(mat_FibroblastNucleiDiabetesExtraCol, select = -c(gene_1)) mat_FibroblastNucleiDiabetes <- mat_FibroblastNucleiDiabetes %>% - as.data.frame() %>% - column_to_rownames('gene') %>% - as.matrix() %>% - t() + #as.data.frame() %>% + column_to_rownames('gene') + #as.matrix() %>% + #t() mat_FibroblastNucleiDiabetes[1:5, 1:5] meta_FibroblastNucleiDiabetes <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE148nnn/GSE148946/suppl/GSE148946_wholecell_metadata.csv.gz") sum(colnames(mat_FibroblastNucleiDiabetes) %in% meta_FibroblastNucleiDiabetes$orig.ident) ncol(mat_FibroblastNucleiDiabetes) +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_FibroblastNucleiDiabetes)) + new_ref_matrix <- average_clusters(mat = mat_FibroblastNucleiDiabetes, metadata = meta_FibroblastNucleiDiabetes$trt, if_log = TRUE) head(new_ref_matrix) tail(new_ref_matrix) diff --git a/R/musMusculus/GSE124952/GSE124952.r b/R/musMusculus/GSE124952/GSE124952.r index 546ceff..299da1a 100644 --- a/R/musMusculus/GSE124952/GSE124952.r +++ b/R/musMusculus/GSE124952/GSE124952.r @@ -34,7 +34,7 @@ checkRawCounts(as.matrix(mat_PFC)) GSE124952Normalized <- NormalizeData(mat_PFC) GSE124952Normalized -new_ref_matrix <- average_clusters(mat = mat_PFC, metadata = meta_PFC$CellType, if_log = TRUE) +new_ref_matrix <- average_clusters(mat = GSE124952Normalized, metadata = meta_PFC$CellType, if_log = FALSE) new_ref_matrix_hashed <- average_clusters(mat = mat_PFC, metadata = meta_PFC$CellType, if_log = FALSE) head(new_ref_matrix) tail(new_ref_matrix) diff --git a/R/musMusculus/GSE131957/GSE131957Beadneg1.R b/R/musMusculus/GSE131957/GSE131957Beadneg1.R new file mode 100644 index 0000000..96bbe1c --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957Beadneg1.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832743_beadneg_dc1_1.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957Beadneg1.rds") diff --git a/R/musMusculus/GSE131957/GSE131957Beadneg2.R b/R/musMusculus/GSE131957/GSE131957Beadneg2.R new file mode 100644 index 0000000..815395a --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957Beadneg2.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832744_beadneg_dc1_2.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957Beadneg1.rds") diff --git a/R/musMusculus/GSE131957/GSE131957TumorADT.R b/R/musMusculus/GSE131957/GSE131957TumorADT.R new file mode 100644 index 0000000..8ad84ce --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957TumorADT.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832738_wt_tumor_adt.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957WTTumorADT.rds") diff --git a/R/musMusculus/GSE131957/GSE131957TumorGex.R b/R/musMusculus/GSE131957/GSE131957TumorGex.R new file mode 100644 index 0000000..6c5ad1b --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957TumorGex.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832737_wt_tumor_gex.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957WTTumor.rds") diff --git a/R/musMusculus/GSE131957/GSE131957WTNaive.R b/R/musMusculus/GSE131957/GSE131957WTNaive.R new file mode 100644 index 0000000..2b6cfe5 --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957WTNaive.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832735_wt_naive_gex.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957.rds") diff --git a/R/musMusculus/GSE131957/GSE131957WTNaiveADT.R b/R/musMusculus/GSE131957/GSE131957WTNaiveADT.R new file mode 100644 index 0000000..d925cca --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957WTNaiveADT.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832736_wt_naive_adt.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957WTNaiveADT.rds") diff --git a/R/musMusculus/GSE131957/GSE131957ccr7k0Naive.R b/R/musMusculus/GSE131957/GSE131957ccr7k0Naive.R new file mode 100644 index 0000000..1feb551 --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957ccr7k0Naive.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832739_ccr7ko_naive_gex.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957ccr7koNaive.rds") diff --git a/R/musMusculus/GSE131957/GSE131957ccr7koADT.R b/R/musMusculus/GSE131957/GSE131957ccr7koADT.R new file mode 100644 index 0000000..93bc623 --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957ccr7koADT.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832740_ccr7ko_naive_adt.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957ccr7koNaiveADT.rds") diff --git a/R/musMusculus/GSE131957/GSE131957ccr7koTumor.R b/R/musMusculus/GSE131957/GSE131957ccr7koTumor.R new file mode 100644 index 0000000..4e9460b --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957ccr7koTumor.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832741_ccr7ko_naive_gex.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957ccr7koNaive.rds") diff --git a/R/musMusculus/GSE131957/GSE131957ccr7koTumorADT.R b/R/musMusculus/GSE131957/GSE131957ccr7koTumorADT.R new file mode 100644 index 0000000..67cda75 --- /dev/null +++ b/R/musMusculus/GSE131957/GSE131957ccr7koTumorADT.R @@ -0,0 +1,41 @@ +library(dplyr) +library(Seurat) +library(patchwork) +library(clustifyr) +library(tidyverse) +library(digest) +library(here) + +proj_dir <- here() +GSE131957 <- file.path(proj_dir, "Reference-Matrix-Generation", "data", "GSE131957_Raw 2", "GSM3832742_ccr7ko_tumor_adt.csv.gz") + +mat_mouseLungLesions <- read.csv(GSE131957) +mat_mouseLungLesions <- mat_mouseLungLesions %>% + # as.data.frame() %>% + column_to_rownames('X') +# as.matrix() %>% +# t() +mat_mouseLungLesions[1:5, 1:5] + +meta_mouseLungLesions <- read_csv("ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE131nnn/GSE131957/suppl/GSE131957_single_cell_metadata.csv.gz") +meta_mouseLungLesions <- meta_mouseLungLesions %>% column_to_rownames("X1") %>% t() %>% as.data.frame() +meta2 <- meta_mouseLungLesions[colnames(mat_mouseLungLesions),] +meta_mouseLungLesions +sum(colnames(mat_mouseLungLesions) %in% meta_mouseLungLesions$cluster) +ncol(mat_mouseLungLesions) + +source("~/Reference-Matrix-Generation/R/utils/utils.r") +checkRawCounts(as.matrix(mat_mouseLungLesions)) + +GSE131957WTNaiveNormalized <- NormalizeData(mat_mouseLungLesions) + +new_ref_matrix <- average_clusters(mat = GSE131957WTNaiveNormalized, metadata = meta2, cluster_col = "cluster_annotation", if_log = FALSE) +new_ref_matrix_hashed <- average_clusters(mat = mat_mouseLungLesions, metadata = meta_mouseLungLesions, if_log = FALSE) +head(new_ref_matrix) +tail(new_ref_matrix) +newcols <- sapply(colnames(new_ref_matrix_hashed), digest, algo = "sha1") +colnames(new_ref_matrix_hashed) <- newcols +head(new_ref_matrix_hashed) +tail(new_ref_matrix_hashed) +saveRDS(new_ref_matrix_hashed, "GSE131957Hashed.rds") +saveRDS(new_ref_matrix, "GSE131957ccr7koTumorADT.rds") diff --git a/R/musMusculus/mouseAtlas.r b/R/musMusculus/mouseAtlas.r index 5716d4c..90e38bd 100644 --- a/R/musMusculus/mouseAtlas.r +++ b/R/musMusculus/mouseAtlas.r @@ -10,7 +10,7 @@ library(here) proj_dir <- here() # get scripts -source(file.path(proj_dir, "R", "utils", "utils.r")) +source(file.path(proj_dir, "Reference-Matrix-Generation", "R", "utils", "utils.r")) # path to matrices ref_matrix_dir <- file.path(proj_dir, "Reference-Matrix-Generation", "ref_matrices", "musMusculus") diff --git a/atlas/musMusculus/MouseAtlas.rds b/atlas/musMusculus/MouseAtlas.rds index 2059e3a..6c760c3 100644 Binary files a/atlas/musMusculus/MouseAtlas.rds and b/atlas/musMusculus/MouseAtlas.rds differ diff --git a/data/GSE131957_RAW 2/GSM3832735_wt_naive_gex.csv.gz b/data/GSE131957_RAW 2/GSM3832735_wt_naive_gex.csv.gz new file mode 100644 index 0000000..a648117 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832735_wt_naive_gex.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832736_wt_naive_adt.csv.gz b/data/GSE131957_RAW 2/GSM3832736_wt_naive_adt.csv.gz new file mode 100644 index 0000000..8eb18a4 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832736_wt_naive_adt.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832737_wt_tumor_gex.csv.gz b/data/GSE131957_RAW 2/GSM3832737_wt_tumor_gex.csv.gz new file mode 100644 index 0000000..76101d9 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832737_wt_tumor_gex.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832738_wt_tumor_adt.csv.gz b/data/GSE131957_RAW 2/GSM3832738_wt_tumor_adt.csv.gz new file mode 100644 index 0000000..7118c78 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832738_wt_tumor_adt.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832739_ccr7ko_naive_gex.csv.gz b/data/GSE131957_RAW 2/GSM3832739_ccr7ko_naive_gex.csv.gz new file mode 100644 index 0000000..490adda Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832739_ccr7ko_naive_gex.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832740_ccr7ko_naive_adt.csv.gz b/data/GSE131957_RAW 2/GSM3832740_ccr7ko_naive_adt.csv.gz new file mode 100644 index 0000000..4e8cdfc Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832740_ccr7ko_naive_adt.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832741_ccr7ko_tumor_gex.csv.gz b/data/GSE131957_RAW 2/GSM3832741_ccr7ko_tumor_gex.csv.gz new file mode 100644 index 0000000..d98152b Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832741_ccr7ko_tumor_gex.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832742_ccr7ko_tumor_adt.csv.gz b/data/GSE131957_RAW 2/GSM3832742_ccr7ko_tumor_adt.csv.gz new file mode 100644 index 0000000..c6a60d1 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832742_ccr7ko_tumor_adt.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832743_beadneg_dc1_1.csv.gz b/data/GSE131957_RAW 2/GSM3832743_beadneg_dc1_1.csv.gz new file mode 100644 index 0000000..b416894 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832743_beadneg_dc1_1.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832744_beadneg_dc1_2.csv.gz b/data/GSE131957_RAW 2/GSM3832744_beadneg_dc1_2.csv.gz new file mode 100644 index 0000000..aa7988e Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832744_beadneg_dc1_2.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832745_beadneg_dc1_3.csv.gz b/data/GSE131957_RAW 2/GSM3832745_beadneg_dc1_3.csv.gz new file mode 100644 index 0000000..b3f75a9 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832745_beadneg_dc1_3.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832746_beadpos_dc1_1.csv.gz b/data/GSE131957_RAW 2/GSM3832746_beadpos_dc1_1.csv.gz new file mode 100644 index 0000000..3412c95 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832746_beadpos_dc1_1.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832747_beadpos_dc1_2.csv.gz b/data/GSE131957_RAW 2/GSM3832747_beadpos_dc1_2.csv.gz new file mode 100644 index 0000000..ba93fe0 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832747_beadpos_dc1_2.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832748_beadpos_dc1_3.csv.gz b/data/GSE131957_RAW 2/GSM3832748_beadpos_dc1_3.csv.gz new file mode 100644 index 0000000..eeb4ae2 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832748_beadpos_dc1_3.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832749_gfpneg_dc1_1.csv.gz b/data/GSE131957_RAW 2/GSM3832749_gfpneg_dc1_1.csv.gz new file mode 100644 index 0000000..4fc7918 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832749_gfpneg_dc1_1.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832750_gfpneg_dc1_2.csv.gz b/data/GSE131957_RAW 2/GSM3832750_gfpneg_dc1_2.csv.gz new file mode 100644 index 0000000..a020a07 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832750_gfpneg_dc1_2.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832751_gfppos_dc1_1.csv.gz b/data/GSE131957_RAW 2/GSM3832751_gfppos_dc1_1.csv.gz new file mode 100644 index 0000000..a564c07 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832751_gfppos_dc1_1.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832752_gfppos_dc1_2.csv.gz b/data/GSE131957_RAW 2/GSM3832752_gfppos_dc1_2.csv.gz new file mode 100644 index 0000000..c4ac59a Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832752_gfppos_dc1_2.csv.gz differ diff --git a/data/GSE131957_RAW 2/GSM3832753_gfppos_dc1_3.csv.gz b/data/GSE131957_RAW 2/GSM3832753_gfppos_dc1_3.csv.gz new file mode 100644 index 0000000..3b02944 Binary files /dev/null and b/data/GSE131957_RAW 2/GSM3832753_gfppos_dc1_3.csv.gz differ diff --git a/meta-analysis/Mouse-Meta-Analysis.r b/meta-analysis/Mouse-Meta-Analysis.r index 6223f0b..434f37b 100644 --- a/meta-analysis/Mouse-Meta-Analysis.r +++ b/meta-analysis/Mouse-Meta-Analysis.r @@ -69,7 +69,7 @@ mouseMetaAnalysis.markers <- FindAllMarkers(mouseMetaAnalysis, only.pos = TRUE, mouseMetaAnalysis.markers %>% group_by(cluster) %>% top_n(n = 2, wt = avg_logFC) cluster1.markers <- FindMarkers(mouseMetaAnalysis, ident.1 = 0, logfc.threshold = 0.25, test.use = "roc", only.pos = TRUE) top10 <- mouseMetaAnalysis.markers %>% group_by(cluster) %>% top_n(n = 10, wt = avg_logFC) #Create top 10 markers for each cluster -DoHeatmap(pbmc, features = top10$gene) + NoLegend() #Create heat map of top 10 markers +DoHeatmap(mouseMetaAnalysis, features = top10$gene) + NoLegend() #Create heat map of top 10 markers #Assign cell types/Annotate UMAP new.cluster.ids <- colnames(mouseAtlas) diff --git a/ref_matrices/musMusculus/GSE124952/GSE124952.rds b/ref_matrices/musMusculus/GSE124952/GSE124952.rds index 4fec3cc..2ad6265 100644 Binary files a/ref_matrices/musMusculus/GSE124952/GSE124952.rds and b/ref_matrices/musMusculus/GSE124952/GSE124952.rds differ diff --git a/ref_matrices/musMusculus/GSE131957/GSE131957WTNaive.rds b/ref_matrices/musMusculus/GSE131957/GSE131957WTNaive.rds new file mode 100644 index 0000000..c50ee33 Binary files /dev/null and b/ref_matrices/musMusculus/GSE131957/GSE131957WTNaive.rds differ diff --git a/ref_matrices/musMusculus/GSE131957/GSE131957WTTumor.rds b/ref_matrices/musMusculus/GSE131957/GSE131957WTTumor.rds new file mode 100644 index 0000000..bb16c98 Binary files /dev/null and b/ref_matrices/musMusculus/GSE131957/GSE131957WTTumor.rds differ diff --git a/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koNaive.rds b/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koNaive.rds new file mode 100644 index 0000000..2517a77 Binary files /dev/null and b/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koNaive.rds differ diff --git a/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koTumor.rds b/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koTumor.rds new file mode 100644 index 0000000..774c0c7 Binary files /dev/null and b/ref_matrices/musMusculus/GSE131957/GSE131957ccr7koTumor.rds differ