-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchetah.R
38 lines (29 loc) · 1.13 KB
/
chetah.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
###CHETAH###
library(scater)
library(Seurat)
library(cowplot)
#Convert to single cell experiment
#pbmc.sce <- as.SingleCellExperiment(dat)
#p2 <- plotPCA(pbmc.sce, colour_by = "ident")
#p2
Mouseseq <- MouseRNAseqData(ensembl = FALSE, cell.ont = c("all", "nonna", "none"))
celltypes_hn <- Mouseseq$label.main
counts_hn <- assay(Mouseseq)
class(counts_hn)
counts_hn[1:5,1:5]
counts <- GetAssayData(object=dat)
pbmc.sce <- as.SingleCellExperiment(dat)
umap <- reducedDim(pbmc.sce,type="UMAP")
input_mel <- SingleCellExperiment(assays = list(counts = counts),
reducedDims = SimpleList(UMAP = umap))
class(counts)
umap[1:5,]
all.equal(rownames(umap), colnames(counts))
headneck_ref <- SingleCellExperiment(assays = list(counts = counts_hn),
colData = DataFrame(celltypes = celltypes_hn))
input_mel <- CHETAHclassifier(input = input_mel,
ref_cells = headneck_ref)
PlotCHETAH(input = input_mel)
PlotCHETAH(input = input_mel, interm = TRUE)
input_mel <- Classify(input_mel, 0)
PlotCHETAH(input = input_mel, tree = FALSE)