-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.R
62 lines (53 loc) · 2.02 KB
/
run.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
library(SingleR)
library(scRNAseq)
library(celldex)
library(alabaster.base)
z_sce <- fetchDataset("zeisel-brain-2015", "2023-12-14", realize.assays=TRUE)
immgen_ref <- fetchReference("immgen", "2024-02-26", realize.assays=TRUE)
l_sce <- fetchDataset("lamanno-brain-2016", "2023-12-17", path = "human-es", realize.assays=TRUE)
blueprint_ref <- fetchReference("blueprint_encode", "2024-02-26", realize.assays=TRUE)
h_sce <- fetchDataset("he-organs-2020", "2023-12-21", path="blood", realize.assays=TRUE)
dice_ref <- fetchReference("dice", "2024-02-26", realize.assays=TRUE)
matches <- SingleR(z_sce, immgen_ref, labels=immgen_ref$label.main, assay.type.test=1)
unlink("r_basic_scenario_1", recursive=TRUE)
saveObject(matches, "r_basic_scenario_1")
matches <- SingleR(l_sce, blueprint_ref, labels=blueprint_ref$label.main, assay.type.test=1)
unlink("r_basic_scenario_2", recursive=TRUE)
saveObject(matches, "r_basic_scenario_2")
#######################
matches <- SingleR(
h_sce,
list(blueprint=blueprint_ref, dice=dice_ref),
labels=list(blueprint=blueprint_ref$label.main, dice=dice_ref$label.main),
assay.type.test=1
)
unlink("r_integrated_scenario", recursive=TRUE)
saveObject(matches, "r_integrated_scenario")
#######################
m_sce <- fetchDataset("muraro-pancreas-2016", "2023-12-19", realize.assays=TRUE)
p_sce <- fetchDataset("grun-pancreas-2016", "2023-12-14", realize.assays=TRUE)
matches <- SingleR(
p_sce,
{
counts <- assay(m_sce)
scrapper::normalizeCounts(counts, size.factors=scrapper::centerSizeFactors(colSums(counts)))
},
labels=m_sce$label,
de.method="wilcox",
assay.type.test=1
)
unlink("r_sc_de", recursive=TRUE)
saveObject(matches, "r_sc_de")
matches <- SingleR(
p_sce,
{
counts <- assay(m_sce)
scrapper::normalizeCounts(counts, size.factors=scrapper::centerSizeFactors(colSums(counts)))
},
labels=m_sce$label,
aggr.ref=TRUE,
de.method="t",
assay.type.test=1
)
unlink("r_sc_aggr", recursive=TRUE)
saveObject(matches, "r_sc_aggr")