-
Notifications
You must be signed in to change notification settings - Fork 0
/
02_iSEE.R
114 lines (82 loc) · 3.61 KB
/
02_iSEE.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
## ----load_iSEE-------------------------------------------------------------------
# if (!require("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#
# BiocManager::install("iSEE")
packageVersion("iSEE")
library("iSEE")
## ----vignettes_iSEE, eval=FALSE--------------------------------------------------
## browseVignettes("iSEE")
## ----quick_launch, eval=interactive()--------------------------------------------
## Launch iSEE for the se ("SummarizedExperiment" object)
iSEE(se)
## Launch iSEE for the sce ("SingleCellExperiment" object)
iSEE(sce)
## ----download_sce_layer----------------------------------------------------------
## Lets get some data using spatialLIBD
sce_layer <- spatialLIBD::fetch_data("sce_layer")
sce_layer
## We can check how big the object is with lobstr
lobstr::obj_size(sce_layer)
## --------------------------------------------------------------------------------
curl::curl_version()$version
## ## Install homebrew from https://brew.sh/
## brew install curl pkg-config
## ----eval = FALSE----------------------------------------------------------------
## Sys.setenv(PKG_CONFIG_PATH = "/opt/homebrew/opt/curl/lib/pkgconfig")
## install.packages("curl", type = "source")
## ----"sce_layer_manual_workaround"-----------------------------------------------
tmp_sce_layer <- tempfile("sce_layer.RData")
download.file(
"https://www.dropbox.com/s/bg8xwysh2vnjwvg/Human_DLPFC_Visium_processedData_sce_scran_sce_layer_spatialLIBD.Rdata?dl=1",
tmp_sce_layer,
mode = "wb"
)
load(tmp_sce_layer, verbose = TRUE)
sce_layer
## ----explore_iSEE, eval = FALSE--------------------------------------------------
## ## Load library
## library("iSEE")
##
## ## Deploy
## iSEE(sce_layer)
## ----load_scRNAseq_data----------------------------------------------------------
library("scRNAseq")
library("scater")
library("iSEE")
# Load the dataset
sce <- ReprocessedAllenData(assays = "tophat_counts")
# Normalize counts and perform PCA
sce <- logNormCounts(sce, exprs_values = "tophat_counts")
sce <- runPCA(sce, ncomponents = 4)
## ----single_geneExpr-------------------------------------------------------------
## Initial settings for a single gene expression
initial_single <- list(
FeatureAssayPlot(Assay = "logcounts", YAxisFeatureName = "Serpine2"),
ReducedDimensionPlot(Type = "PCA", ColorBy = "Column selection", ColumnSelectionSource = "FeatureAssayPlot1")
)
## Launch iSEE with the initial settings
if (interactive()) {
iSEE(sce, initial = initial_single)
}
## ----2_genesExpr-----------------------------------------------------------------
## Initial settings for 2 genes expression on the same "FeatureAssayPlot"
initial_combined <- list(
FeatureAssayPlot(Assay = "logcounts", XAxis = "Feature name", XAxisFeatureName = "Serpine2", YAxisFeatureName = "Bcl6"),
ReducedDimensionPlot(Type = "PCA", ColorBy = "Column selection", ColumnSelectionSource = "FeatureAssayPlot1")
)
## Launch iSEE with the initial settings
if (interactive()) {
iSEE(sce, initial = initial_combined)
}
## ----chain_FeatureAssayPlots-----------------------------------------------------
## Initial settings chainning multiple "FeatureAssayPlot"
initial_double <- list(
FeatureAssayPlot(Assay = "logcounts", YAxisFeatureName = "Serpine2"),
FeatureAssayPlot(Assay = "logcounts", YAxisFeatureName = "Bcl6", ColumnSelectionSource = "FeatureAssayPlot1", ColumnSelectionRestrict = TRUE),
ReducedDimensionPlot(Type = "PCA", ColorBy = "Column selection", ColumnSelectionSource = "FeatureAssayPlot2")
)
## Launch iSEE with the initial settings
if (interactive()) {
iSEE(sce, initial = initial_double)
}