Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions R/GSE148946/DiabetesFibroblastGSE148946Nuclei.r
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/musMusculus/GSE124952/GSE124952.r
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we still use the hashed versions, then if_log also needs to be changed

Copy link
Collaborator Author

@SidhantPuntambekar SidhantPuntambekar Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raysinensis Do you mean just change it to FALSE on line 37?

head(new_ref_matrix)
tail(new_ref_matrix)
Expand Down
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957Beadneg1.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957Beadneg2.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957TumorADT.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957TumorGex.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957WTNaive.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957WTNaiveADT.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957ccr7k0Naive.R
Original file line number Diff line number Diff line change
@@ -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")
41 changes: 41 additions & 0 deletions R/musMusculus/GSE131957/GSE131957ccr7koADT.R
Original file line number Diff line number Diff line change
@@ -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")
Loading