# Only run example code if Seurat package is available
if (requireNamespace("Seurat", quietly=TRUE) &&
requireNamespace("SeuratObject", quietly=TRUE)) {
# See vignettes for more examples
seurat <- CAMML(seurat=SeuratObject::pbmc_small,
gene.set.df = data.frame(cbind(ensembl.id = c("ENSG00000172005",
"ENSG00000173114","ENSG00000139187"),
cell.type = c("T cell","T cell","T cell"))))
cite <- matrix(c(rnorm(40), rnorm(40,2,1)),
nrow = length(rownames(seurat@assays$CAMML)),
ncol = length(colnames(seurat@assays$CAMML)))
rownames(cite) <- "marker"
colnames(cite) <- colnames(seurat)
assay <- SeuratObject::CreateAssayObject(counts = cite)
seurat[["ADT"]] <- assay
citelist <- list()
citelist[[1]] = "marker"
names(citelist) = "T cell"
seurat <- ChIMP(seurat, citelist)
seurat@assays$ChIMP@data
}
Run the code above in your browser using DataLab