library(Seurat)
library(ggplot2)
require(sc2marker)
require(Seurat)

savedir <- "save"
dir.create(file.path(savedir))

download.file(url = "https://zenodo.org/record/5854754/files/human-PBMC.rds?download=1",
              destfile = file.path(savedir, "pbmc_multimodal.rds"), method = "curl")


human_PBMC <- readRDS(file.path(savedir, "pbmc_multimodal.rds"))
Idents(human_PBMC) <- "celltype.l1"
table(human_PBMC@active.ident)

Markers for B cell

b.markers <- Detect_single_marker(human_PBMC, id = "B", category = "Flow", min.pct = 0.06, assay = "SCT", min.fc = 0.02)
get_antibody(b.markers, org = "human")
# Ridge plot of top 9 markers of B cells
plot_ridge(human_PBMC, id = "B", genes = b.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)

Markers for Mono cell

Mono.markers <- Detect_single_marker(human_PBMC, id = "Mono", category = "Flow", org = "human", assay = "SCT")
get_antibody(Mono.markers, org = "human")
# Ridge plot of top 9 markers of Mono cells
plot_ridge(human_PBMC, id = "Mono", genes = Mono.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)

Markers for DC cell

DC.markers <- Detect_single_marker(human_PBMC, id = "DC", category = "Flow", org = "human", assay = "SCT")
get_antibody(DC.markers, org = "human")
# Ridge plot of top 9 markers of DC cells
plot_ridge(human_PBMC, id = "DC", genes = DC.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)

Markers for NK cell

NK.markers <- Detect_single_marker(human_PBMC, id = "NK", category = "Flow", org = "human", assay = "SCT")
get_antibody(NK.markers, org = "human")
# Ridge plot of top 9 markers of NK cells
plot_ridge(human_PBMC, id = "NK", genes = NK.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)

Markers for CD8 T cell

t.markers <- Detect_single_marker(human_PBMC, id = "CD8 T", category = "Flow", org = "human", assay = "SCT")
get_antibody(t.markers, org = "human")
# Ridge plot of top 9 markers of CD8 T cells
plot_ridge(human_PBMC, id = "CD8 T", genes = t.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)

Markers for CD4 T cell

t.markers <- Detect_single_marker(human_PBMC, id = "CD4 T", category = "Flow", org = "human", min.pct = 0.06, assay = "SCT", min.fc = 0.02)
get_antibody(t.markers, org = "human")
# Ridge plot of top 9 markers of CD4 T cells
plot_ridge(human_PBMC, id = "CD4 T", genes = t.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)


CostaLab/scMarkerDetect documentation built on May 12, 2022, 6:05 a.m.