-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubset.R
More file actions
60 lines (46 loc) · 1.56 KB
/
Copy pathsubset.R
File metadata and controls
60 lines (46 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
library(ArchR)
library(future)
library(ggplot2)
library(patchwork)
library(Matrix)
library(dplyr)
library(pheatmap)
library(chromVARmotifs)
library(EnsDb.Mmusculus.v79)
library(BSgenome.Mmusculus.UCSC.mm10)
setwd("/nfs/turbo/umms-thahoang/sherine/mouseCutandTag/archr")
addArchRThreads(threads = 4)
addArchRGenome("mm10")
project_name ="OCT4RBPJ"
proj_subset <- loadArchRProject(path = project_name, force = FALSE, showLogo = TRUE)
clusters <- c("C2", "C3","C4", "C5", "C6", "C8", "C9", "C10", "C11", "C13", "C14", "C15", "C16", "C17", "C18", "C19", "C20", "C21", "C22", "C23", "C24")
proj_Clean = subsetArchRProject(proj_ALL,proj_ALL$cellNames[proj_ALL$Clusters_Combined %in% clusters] , outputDirectory = "OCT4_Clean" ,force =TRUE,dropCells = TRUE)
saveArchRProject(ArchRProj = proj_Clean, outputDirectory = "OCT4_Clean", load = FALSE)
Newlabel <- c(
"C1" = "Cone",
"C2" ="Rod",
"C3"= "Cone",
"C4"="Bipolar",
"C5"="Bipolar",
"C6"="Amacrine",
"C7"= "KO MG",
"C8"="KO MG",
"C9"="WT MG",
"C10"="WT MG",
"C11"="WT MG",
"C12"="WT MG",
"C13"="WT MG",
"C14"="KO MG",
"C15"="WT MG",
"C16"="WT MG",
"C17"="KO MG",
"C18"="MGPC",
"C19"="WT MG",
"C20"="KO MG",
"C21"="KO MG",
"C22"="KO MG")
proj_Clean$Celltype <- mapLabels(proj_Clean$Clusters_Combined, newLabels = Newlabel)
saveArchRProject(ArchRProj = proj_Clean, outputDirectory = "OCT4_Clean", load = FALSE)
#SUBET by celltype WT_MG and KO_MG
celltypes <- c("WT MG","KO MG")
proj_subset = subsetArchRProject(proj_Clean,proj_Clean$cellNames[proj_Clean$Celltype %in% celltypes] , outputDirectory = "OCT4subset" ,force =TRUE,dropCells = TRUE)