Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 25d5399

Browse files
committed
update code
1 parent 5103c18 commit 25d5399

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

README.Rmd

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ library(stringr)
5656
### Load the metadata
5757

5858
```{r}
59-
get_metadata()
59+
metadata = get_metadata()
60+
61+
metadata
6062
```
6163

6264
### Explore the number of datasets per tissue
6365

6466
```{r}
65-
get_metadata() |>
67+
metadata |>
6668
dplyr::distinct(tissue, dataset_id) |>
6769
dplyr::count(tissue)
6870
```
@@ -76,7 +78,7 @@ get_metadata() |>
7678
```{r}
7779
7880
single_cell_counts =
79-
get_metadata() |>
81+
metadata |>
8082
dplyr::filter(
8183
ethnicity == "African" &
8284
stringr::str_like(assay, "%10x%") &
@@ -94,7 +96,7 @@ This is helpful if just few genes are of interest, as they can be compared acros
9496

9597
```{r}
9698
single_cell_counts =
97-
get_metadata() |>
99+
metadata |>
98100
dplyr::filter(
99101
ethnicity == "African" &
100102
stringr::str_like(assay, "%10x%") &
@@ -110,7 +112,7 @@ single_cell_counts
110112

111113
```{r}
112114
single_cell_counts =
113-
get_metadata() |>
115+
metadata |>
114116
dplyr::filter(
115117
ethnicity == "African" &
116118
stringr::str_like(assay, "%10x%") &
@@ -129,7 +131,7 @@ This convert the H5 SingleCellExperiment to Seurat so it might take long time an
129131

130132
```{r}
131133
single_cell_counts =
132-
get_metadata() |>
134+
metadata |>
133135
dplyr::filter(
134136
ethnicity == "African" &
135137
stringr::str_like(assay, "%10x%") &
@@ -152,7 +154,7 @@ library(ggplot2)
152154
# Plots with styling
153155
154156
# Plot by disease
155-
get_metadata() |>
157+
metadata |>
156158
# Filter and subset
157159
filter(cell_type_harmonised=="cd14 mono") |>
158160
filter(file_id_db != "c5a05f23f9784a3be3bfa651198a48eb") |>
@@ -180,7 +182,7 @@ get_metadata() |>
180182
ggtitle("HLA-A in CD14 monocytes by disease")
181183
182184
# Plot by tissue
183-
get_metadata() |>
185+
metadata |>
184186
# Filter and subset
185187
filter(cell_type_harmonised=="cd14 mono") |>
186188
filter(file_id_db != "c5a05f23f9784a3be3bfa651198a48eb") |>
@@ -213,7 +215,7 @@ get_metadata() |>
213215
library(tidySingleCellExperiment)
214216
library(ggplot2)
215217
216-
get_metadata() |>
218+
metadata |>
217219
# Filter and subset
218220
filter(cell_type_harmonised=="cd14 mono") |>
219221
@@ -232,7 +234,7 @@ knitr::include_graphics("man/figures/HLA_A_disease_plot.png")
232234

233235
```{r, eval=FALSE}
234236
235-
get_metadata() |>
237+
metadata |>
236238
237239
# Filter and subset
238240
filter(cell_type_harmonised=="nk") |>

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ library(stringr)
3838
### Load the metadata
3939

4040
``` r
41-
get_metadata()
41+
metadata = get_metadata()
42+
43+
metadata
4244
#> # Source: table</stornext/Home/data/allstaff/m/mangiola.s/.cache/R/CuratedAtlasQueryR/metadata.0.2.2.parquet> [?? x 56]
4345
#> # Database: DuckDB 0.7.0 [unknown@Linux 3.10.0-1160.81.1.el7.x86_64:R 4.2.0/:memory:]
4446
#> `_cell` _samp…¹ cell_…² cell_…³ confi…⁴ cell_…⁵ cell_…⁶ cell_…⁷ sampl…⁸
@@ -65,7 +67,7 @@ get_metadata()
6567
### Explore the number of datasets per tissue
6668

6769
``` r
68-
get_metadata() |>
70+
metadata |>
6971
dplyr::distinct(tissue, dataset_id) |>
7072
dplyr::count(tissue)
7173
#> # Source: SQL [?? x 2]
@@ -82,7 +84,6 @@ get_metadata() |>
8284
#> 8 heart right ventricle 16
8385
#> 9 left cardiac atrium 7
8486
#> 10 interventricular septum 16
85-
8687
#> # … with more rows
8788
```
8889

@@ -93,7 +94,7 @@ get_metadata() |>
9394
``` r
9495

9596
single_cell_counts =
96-
get_metadata() |>
97+
metadata |>
9798
dplyr::filter(
9899
ethnicity == "African" &
99100
stringr::str_like(assay, "%10x%") &
@@ -128,7 +129,7 @@ compared across samples.
128129

129130
``` r
130131
single_cell_counts =
131-
get_metadata() |>
132+
metadata |>
132133
dplyr::filter(
133134
ethnicity == "African" &
134135
stringr::str_like(assay, "%10x%") &
@@ -160,7 +161,7 @@ single_cell_counts
160161

161162
``` r
162163
single_cell_counts =
163-
get_metadata() |>
164+
metadata |>
164165
dplyr::filter(
165166
ethnicity == "African" &
166167
stringr::str_like(assay, "%10x%") &
@@ -196,7 +197,7 @@ requesting.
196197

197198
``` r
198199
single_cell_counts =
199-
get_metadata() |>
200+
metadata |>
200201
dplyr::filter(
201202
ethnicity == "African" &
202203
stringr::str_like(assay, "%10x%") &
@@ -226,7 +227,7 @@ We can gather all natural killer cells and plot the distribution of CD56
226227
library(tidySingleCellExperiment)
227228
library(ggplot2)
228229

229-
get_metadata() |>
230+
metadata |>
230231
# Filter and subset
231232
filter(cell_type_harmonised=="cd14 mono") |>
232233

@@ -239,11 +240,11 @@ get_metadata() |>
239240
geom_jitter(shape=".")
240241
```
241242

242-
<img src="man/figures/HLA_A_disease_plot.png" width="497" />
243+
<img src="man/figures/HLA_A_disease_plot.png" width="525" />
243244

244245
``` r
245246

246-
get_metadata() |>
247+
metadata |>
247248

248249
# Filter and subset
249250
filter(cell_type_harmonised=="nk") |>
@@ -257,7 +258,7 @@ get_metadata() |>
257258
geom_jitter(shape=".")
258259
```
259260

260-
<img src="man/figures/HLA_A_tissue_plot.png" width="499" />
261+
<img src="man/figures/HLA_A_tissue_plot.png" width="525" />
261262

262263
# Cell metadata
263264

vignettes/Introduction.Rmd

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ library(stringr)
5757
### Load the metadata
5858

5959
```{r}
60-
meta <- get_metadata()
60+
metadata <- get_metadata()
6161
```
6262

63-
The `meta` variable can then be re-used for all subsequent queries.
63+
The `metadata` variable can then be re-used for all subsequent queries.
6464

6565
### Explore the tissue
6666

6767
```{r, eval=FALSE}
68-
meta |>
68+
metadata |>
6969
dplyr::distinct(tissue, file_id)
7070
```
7171

@@ -96,7 +96,7 @@ meta |>
9696
```{r}
9797
9898
single_cell_counts =
99-
meta |>
99+
metadata |>
100100
dplyr::filter(
101101
ethnicity == "African" &
102102
stringr::str_like(assay, "%10x%") &
@@ -114,7 +114,7 @@ This is helpful if just few genes are of interest, as they can be compared acros
114114

115115
```{r}
116116
single_cell_counts =
117-
meta |>
117+
metadata |>
118118
dplyr::filter(
119119
ethnicity == "African" &
120120
stringr::str_like(assay, "%10x%") &
@@ -130,7 +130,7 @@ single_cell_counts
130130

131131
```{r}
132132
single_cell_counts =
133-
meta |>
133+
metadata |>
134134
dplyr::filter(
135135
ethnicity == "African" &
136136
stringr::str_like(assay, "%10x%") &
@@ -149,7 +149,7 @@ This convert the H5 SingleCellExperiment to Seurat so it might take long time an
149149

150150
```{r}
151151
single_cell_counts =
152-
meta |>
152+
metadata |>
153153
dplyr::filter(
154154
ethnicity == "African" &
155155
stringr::str_like(assay, "%10x%") &
@@ -172,7 +172,7 @@ library(ggplot2)
172172
# Plots with styling
173173
174174
# Plot by disease
175-
get_metadata() |>
175+
metadata |>
176176
# Filter and subset
177177
filter(cell_type_harmonised=="cd14 mono") |>
178178
filter(file_id_db != "c5a05f23f9784a3be3bfa651198a48eb") |>
@@ -200,7 +200,7 @@ get_metadata() |>
200200
ggtitle("HLA-A in CD14 monocytes by disease")
201201
202202
# Plot by tissue
203-
get_metadata() |>
203+
metadata |>
204204
# Filter and subset
205205
filter(cell_type_harmonised=="cd14 mono") |>
206206
filter(file_id_db != "c5a05f23f9784a3be3bfa651198a48eb") |>
@@ -233,7 +233,7 @@ get_metadata() |>
233233
library(tidySingleCellExperiment)
234234
library(ggplot2)
235235
236-
get_metadata() |>
236+
metadata |>
237237
# Filter and subset
238238
filter(cell_type_harmonised=="cd14 mono") |>
239239
@@ -252,7 +252,7 @@ knitr::include_graphics("../man/figures/HLA_A_disease_plot.png")
252252

253253
```{r, eval=FALSE}
254254
255-
get_metadata() |>
255+
metadata |>
256256
257257
# Filter and subset
258258
filter(cell_type_harmonised=="nk") |>

0 commit comments

Comments
 (0)