-
Notifications
You must be signed in to change notification settings - Fork 2
/
02_marker_genes.R
executable file
·58 lines (48 loc) · 1.21 KB
/
02_marker_genes.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
## Automatically style the code in this script:
styler::style_file(
here::here("analysis", "02_marker_genes.R"),
transformers = biocthis::bioc_style()
)
## utils
library("here")
library("sessioninfo")
## reading the data
library("SpatialExperiment")
## vis
library("spatialLIBD")
## Load SPE raw data
load(here::here("rdata", "spe", "spe_raw.Rdata"), verbose = TRUE)
## Filter down to spots in tissue
spe <- spe_raw[, which(inTissue(spe_raw))]
## Find marker genes
human_markers <-
c(
"SNAP25",
"MBP",
"PCP4",
"RELN",
"AQP4",
"CUX2",
"CCK",
"HPCAL1",
"NR4A2",
"RORB"
)
## Locate the marker genes
human_markers_search <- rowData(spe)$gene_search[match(human_markers, rowData(spe)$gene_id)]
## Create plots directory
dir.create(here::here("plots", "human_markers"), showWarnings = FALSE)
for (i in human_markers_search) {
vis_grid_gene(
spe = spe,
geneid = i,
pdf = here::here("plots", "human_markers", paste0(gsub("; ", "_", i), ".pdf")),
assayname = "counts"
)
}
## Reproducibility information
print("Reproducibility information:")
Sys.time()
proc.time()
options(width = 120)
session_info()