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

Commit b4ffb9c

Browse files
committed
Avoid datasets with only 1 matching cell
1 parent 1af7b26 commit b4ffb9c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

R/dev.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ downsample_metadata <- function(output = "sample_meta.parquet"){
232232
purrr::map(function(filter){
233233
all_ids <- metadata |>
234234
dplyr::filter(!!filter) |>
235+
dplyr::group_by(file_id_db) |>
236+
# Remove datasets that only have 1 matching cell, which will
237+
# break downstream
238+
dplyr::filter(dplyr::n() > 1) |>
235239
dplyr::pull(.data$file_id_db)
236240

237241
dataset_sizes |>

vignettes/Introduction.Rmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ We can gather all CD14 monocytes cells and plot the distribution of HLA-A across
217217

218218
```{r, echo=FALSE}
219219
suppressPackageStartupMessages({
220-
library(tidySingleCellExperiment)
221220
library(ggplot2)
222221
})
223222
@@ -231,7 +230,7 @@ counts <- metadata |>
231230
get_single_cell_experiment(assays = "cpm", features = "HLA-A") |>
232231
233232
# Add feature to table
234-
join_features("HLA-A", shape = "wide") |>
233+
tidySingleCellExperiment::join_features("HLA-A", shape = "wide") |>
235234
236235
# Rank x axis
237236
as_tibble()
@@ -291,8 +290,8 @@ metadata |>
291290
# Get counts per million for HCA-A gene
292291
get_single_cell_experiment(assays = "cpm", features = "HLA-A") |>
293292
294-
# Plot (styling code have been omitted)
295-
join_features("HLA-A", shape = "wide") |>
293+
# Plot (styling code have been omitted)
294+
tidySingleCellExperiment::join_features("HLA-A", shape = "wide") |>
296295
ggplot(aes( tissue_harmonised, `HLA.A`,color = file_id)) +
297296
geom_jitter(shape=".")
298297
```

0 commit comments

Comments
 (0)