-
Notifications
You must be signed in to change notification settings - Fork 1
/
bayesian_decomposition.R
37 lines (34 loc) · 1.96 KB
/
bayesian_decomposition.R
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
library(Seurat)
library(SeuratDisk)
sunye_norm <- LoadH5Seurat('C://Users/rodri/Downloads/sunyennorm.h5Seurat', misc = F)
sunye_WTOIR <- LoadH5Seurat('C://Users/rodri/Downloads/sunyeOIRWT.h5Seurat', misc = F)
sunye_KOOIR <- LoadH5Seurat('C://Users/rodri/Downloads/sunyeOIRKO.h5Seurat', misc = F)
sunye_norm$labels <- [email protected]
sunye.combined <- merge(sunye_norm, y = sunye_WTOIR)
sunye.combined <- merge(sunye.combined, y = sunye_KOOIR)
library(scDC)
library(broom.mixed)
exprsMat <- GetAssayData(object = sunye.combined, assay = "RNA", slot = "data")
cellTypes <- sunye.combined$labels
subject <- sunye.combined$group
cond <- sunye.combined$group
dim(exprsMat)
table(subject, cellTypes)
table(cond, cellTypes)
res_scDC_noClust <- scDC_noClustering(cellTypes, subject, calCI = TRUE,
calCI_method = c("percentile", "BCa", "multinom"),
nboot = 50)
barplotCI(res_scDC_noClust, c("Normal","WTOIR", 'KOOIR'))
densityCI(res_scDC_noClust, c("Normal", 'Normal',"Normal", 'Normal',"Normal", 'Normal',
"Normal", 'Normal',"Normal", 'Normal', 'Normal',
"WTOIR","WTOIR","WTOIR","WTOIR","WTOIR","WTOIR","WTOIR",
"WTOIR","WTOIR","WTOIR","WTOIR",'KOOIR','KOOIR','KOOIR',
'KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR'))
res_GLM <- fitGLM(res_scDC_noClust, c("Normal", 'Normal',"Normal", 'Normal',"Normal", 'Normal',
"Normal", 'Normal',"Normal", 'Normal', 'Normal',
"WTOIR","WTOIR","WTOIR","WTOIR","WTOIR","WTOIR","WTOIR",
"WTOIR","WTOIR","WTOIR","WTOIR",'KOOIR','KOOIR','KOOIR',
'KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR','KOOIR'),
pairwise = T)
summary(res_GLM$pool_res_fixed)
summary(res_GLM$pool_res_random)