@@ -21,7 +21,8 @@ knitr::opts_chunk$set(
2121```
2222
2323``` {r, echo=FALSE, out.height = "139px", out.width = "120px"}
24- knitr::include_graphics("inst/logo.png")
24+ system.file("logo.png", package="CuratedAtlasQueryR") |>
25+ knitr::include_graphics()
2526```
2627
2728## Load the package
@@ -37,13 +38,15 @@ library(stringr)
3738### Load the metadata
3839
3940``` {r}
40- get_metadata()
41+ meta <- get_metadata()
4142```
4243
44+ The ` meta ` variable can then be re-used for all subsequent queries.
45+
4346### Explore the tissue
4447
4548``` {r, eval=FALSE}
46- get_metadata() |>
49+ meta |>
4750 dplyr::distinct(tissue, file_id)
4851```
4952
@@ -74,7 +77,7 @@ get_metadata() |>
7477``` {r}
7578
7679single_cell_counts =
77- get_metadata() |>
80+ meta |>
7881 dplyr::filter(
7982 ethnicity == "African" &
8083 stringr::str_like(assay, "%10x%") &
@@ -92,7 +95,7 @@ This is helpful if just few genes are of interest, as they can be compared acros
9295
9396``` {r}
9497single_cell_counts =
95- get_metadata() |>
98+ meta |>
9699 dplyr::filter(
97100 ethnicity == "African" &
98101 stringr::str_like(assay, "%10x%") &
@@ -108,7 +111,7 @@ single_cell_counts
108111
109112``` {r}
110113single_cell_counts =
111- get_metadata() |>
114+ meta |>
112115 dplyr::filter(
113116 ethnicity == "African" &
114117 stringr::str_like(assay, "%10x%") &
@@ -127,7 +130,7 @@ This convert the H5 SingleCellExperiment to Seurat so it might take long time an
127130
128131``` {r}
129132single_cell_counts =
130- get_metadata() |>
133+ meta |>
131134 dplyr::filter(
132135 ethnicity == "African" &
133136 stringr::str_like(assay, "%10x%") &
@@ -147,7 +150,7 @@ We can gather all natural killer cells and plot the distribution of CD56 (NCAM1)
147150library(tidySingleCellExperiment)
148151library(ggplot2)
149152
150- get_metadata() |>
153+ meta |>
151154
152155 # Filter and subset
153156 filter(cell_type_harmonised=="nk") |>
@@ -172,7 +175,8 @@ get_metadata() |>
172175```
173176
174177``` {r, echo=FALSE, message=FALSE, warning=FALSE}
175- knitr::include_graphics("inst/NCAM1_figure.png")
178+ system.file("NCAM1_figure.png", package="CuratedAtlasQueryR") |>
179+ knitr::include_graphics()
176180```
177181
178182# Cell metadata
0 commit comments