-
Notifications
You must be signed in to change notification settings - Fork 0
/
integrated using seurat method.txt
46 lines (37 loc) · 1.72 KB
/
integrated using seurat method.txt
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
### Part #1: Data Integration ###
## Data integration in EWS Cell Lines ##
# Get Ewing Sarcoma Cell Lines CHLA9 and CHLA10
# From: https://www.mdpi.com/2072-6694/12/4/948
CHLA10_mat <- read.csv("CHLA10_matrix.csv.gz", row.names = 1)
CHLA9_mat <- read.csv("CHLA9_matrix.csv.gz", row.names = 1)
cells <- merge(x = CreateSeuratObject(CHLA9_mat, project = "CHLA9"),
y = CreateSeuratObject(CHLA10_mat, project = "CHLA10")) %>%
PercentageFeatureSet(pattern = "^MT-", col.name = "percent.mt") %>%
subset(nFeature_RNA > 2500 & nCount_RNA > 12000 & percent.mt < 18) %>%
NormalizeData() %>%
FindVariableFeatures() %>%
ScaleData() %>%
RunPCA() %>%
FindNeighbors() %>%
FindClusters() %>%
RunUMAP(dims = 1:50)
# Dim Plots
DimPlot(cells, group.by = "orig.ident")
DimPlot(cells, group.by = "orig.ident") + DimPlot(cells, group.by = "seurat_clusters")
# perform integration to correct for batch effects ------
obj.list <- SplitObject(merged_seurat_filtered, split.by = 'Patient')
for(i in 1:length(obj.list)){
obj.list[[i]] <- NormalizeData(object = obj.list[[i]])
obj.list[[i]] <- FindVariableFeatures(object = obj.list[[i]])
}
# select integration features
features <- SelectIntegrationFeatures(object.list = obj.list)
# find integration anchors (CCA)
anchors <- FindIntegrationAnchors(object.list = obj.list,
anchor.features = features)
# integrate data
seurat.integrated <- IntegrateData(anchorset = anchors)
# Scale data, run PCA and UMAP and visualize integrated data
seurat.integrated <- ScaleData(object = seurat.integrated)
seurat.integrated <- RunPCA(object = seurat.integrated)
seurat.integrated <- RunUMAP(object = seurat.integrated, dims = 1:50)