From 383ce8407750ff07326c2b8499052caf927cd442 Mon Sep 17 00:00:00 2001 From: Emil Kriukov <77118598+mcrewcow@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:11:14 -0500 Subject: [PATCH] Create composition_analysis.R --- composition_analysis.R | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 composition_analysis.R diff --git a/composition_analysis.R b/composition_analysis.R new file mode 100644 index 0000000..ae925fd --- /dev/null +++ b/composition_analysis.R @@ -0,0 +1,17 @@ +library(scDC) +exprsMat <- GetAssayData(object = lydia, assay = "RNA", slot = "data") +cellTypes <- lydia$anno2 +subject <- lydia$background +cond <- lydia$background +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("WT","DFcKO")) +densityCI(res_scDC_noClust, c("WT",'DFcKO')) +res_GLM <- fitGLM(res_scDC_noClust, c("WT",'DFcKO'), + pairwise = T) +summary(res_GLM$pool_res_fixed) +summary(res_GLM$pool_res_random)