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

Commit 5103c18

Browse files
authored
Merge pull request #80 from stemangiola/change-cell-name-convention
change to cell_
2 parents 63419a1 + 50649d7 commit 5103c18

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: CuratedAtlasQueryR
33
Title: Queries the Human Cell Atlas
4-
Version: 0.4.0
4+
Version: 0.4.1
55
Authors@R: c(
66
person(
77
"Stefano",

R/query.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ get_SingleCellExperiment <- function(
8383
cli_alert_info("Realising metadata.")
8484
raw_data <- collect(data)
8585
inherits(raw_data, "tbl") |> assert_that()
86-
has_name(raw_data, c("_cell", "file_id_db")) |> assert_that()
86+
has_name(raw_data, c("cell_", "file_id_db")) |> assert_that()
8787

8888
versioned_cache_directory = file.path(cache_directory, COUNTS_VERSION)
8989
versioned_cache_directory |> dir.create(showWarnings = FALSE, recursive = TRUE)
@@ -177,14 +177,14 @@ group_to_sce <- function(i, df, dir_prefix, features) {
177177
sce <- loadHDF5SummarizedExperiment(sce_path)
178178
# The cells we select here are those that are both available in the SCE
179179
# object, and requested for this particular file
180-
cells <- colnames(sce) |> intersect(df$`_cell`)
180+
cells <- colnames(sce) |> intersect(df$cell_)
181181
# We need to make the cell names globally unique, which we can guarantee
182182
# by adding a suffix that is derived from file_id_db, which is the grouping
183183
# variable
184184
new_cellnames <- paste0(cells, "_", i)
185185
new_coldata <- df |>
186-
mutate(original_cell_id = .data$`_cell`, `_cell` = new_cellnames) |>
187-
column_to_rownames("_cell") |>
186+
mutate(original_cell_id = .data$cell_, cell_ = new_cellnames) |>
187+
column_to_rownames("cell_") |>
188188
as("DataFrame")
189189

190190
features |>
@@ -406,10 +406,10 @@ get_seurat <- function(...) {
406406
#' - `.sample_name`: How samples were defined
407407
#'
408408
get_metadata <- function(
409-
remote_url = "https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata/metadata.0.2.2.parquet",
409+
remote_url = "https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata/metadata.0.2.3.parquet",
410410
cache_directory = get_default_cache_dir()
411411
) {
412-
db_path <- file.path(cache_directory, "metadata.0.2.2.parquet")
412+
db_path <- file.path(cache_directory, "metadata.0.2.3.parquet")
413413
sync_remote_file(
414414
remote_url,
415415
db_path,

README.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ Dataset-specific columns (definitions available at cellxgene.cziscience.com)
259259

260260
Sample-specific columns (definitions available at cellxgene.cziscience.com)
261261

262-
`.sample`, `.sample_name`, `age_days`, `assay`, `assay_ontology_term_id`, `development_stage`, `development_stage_ontology_term_id`, `ethnicity`, `ethnicity_ontology_term_id`, `experiment___`, `organism`, `organism_ontology_term_id`, `sample_placeholder`, `sex`, `sex_ontology_term_id`, `tissue`, `tissue_harmonised`, `tissue_ontology_term_id`, `disease`, `disease_ontology_term_id`, `is_primary_data.x`
262+
`sample_`, `sample_name`, `age_days`, `assay`, `assay_ontology_term_id`, `development_stage`, `development_stage_ontology_term_id`, `ethnicity`, `ethnicity_ontology_term_id`, `experiment___`, `organism`, `organism_ontology_term_id`, `sample_placeholder`, `sex`, `sex_ontology_term_id`, `tissue`, `tissue_harmonised`, `tissue_ontology_term_id`, `disease`, `disease_ontology_term_id`, `is_primary_data.x`
263263

264264
Cell-specific columns (definitions available at cellxgene.cziscience.com)
265265

266-
`.cell`, `cell_type`, `cell_type_ontology_term_idm`, `cell_type_harmonised`, `confidence_class`, `cell_annotation_azimuth_l2`, `cell_annotation_blueprint_singler`
266+
`cell_`, `cell_type`, `cell_type_ontology_term_idm`, `cell_type_harmonised`, `confidence_class`, `cell_annotation_azimuth_l2`, `cell_annotation_blueprint_singler`
267267

268268
Through harmonisation and curation we introduced custom column, not present in the original CELLxGENE metadata
269269

@@ -276,8 +276,8 @@ Through harmonisation and curation we introduced custom column, not present in t
276276
- `cell_annotation_blueprint_monaco`: SingleR cell annotation using Monaco reference
277277
- `sample_id_db`: Sample subdivision for internal use
278278
- `file_id_db`: File subdivision for internal use
279-
- `.sample`: Sample ID
280-
- `.sample_name`: How samples were defined
279+
- `sample_`: Sample ID
280+
- `sample_name`: How samples were defined
281281

282282
# RNA abundance
283283

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ get_metadata() |>
8282
#> 8 heart right ventricle 16
8383
#> 9 left cardiac atrium 7
8484
#> 10 interventricular septum 16
85+
8586
#> # … with more rows
8687
```
8788

@@ -273,9 +274,8 @@ cellxgene.cziscience.com)
273274
Sample-specific columns (definitions available at
274275
cellxgene.cziscience.com)
275276

276-
`.sample`, `.sample_name`, `age_days`, `assay`,
277-
`assay_ontology_term_id`, `development_stage`,
278-
`development_stage_ontology_term_id`, `ethnicity`,
277+
`sample_`, `sample_name`, `age_days`, `assay`, `assay_ontology_term_id`,
278+
`development_stage`, `development_stage_ontology_term_id`, `ethnicity`,
279279
`ethnicity_ontology_term_id`, `experiment___`, `organism`,
280280
`organism_ontology_term_id`, `sample_placeholder`, `sex`,
281281
`sex_ontology_term_id`, `tissue`, `tissue_harmonised`,
@@ -285,7 +285,7 @@ cellxgene.cziscience.com)
285285
Cell-specific columns (definitions available at
286286
cellxgene.cziscience.com)
287287

288-
`.cell`, `cell_type`, `cell_type_ontology_term_idm`,
288+
`cell_`, `cell_type`, `cell_type_ontology_term_idm`,
289289
`cell_type_harmonised`, `confidence_class`,
290290
`cell_annotation_azimuth_l2`, `cell_annotation_blueprint_singler`
291291

@@ -307,8 +307,8 @@ present in the original CELLxGENE metadata
307307
Monaco reference
308308
- `sample_id_db`: Sample subdivision for internal use
309309
- `file_id_db`: File subdivision for internal use
310-
- `.sample`: Sample ID
311-
- `.sample_name`: How samples were defined
310+
- `sample_`: Sample ID
311+
- `sample_name`: How samples were defined
312312

313313
# RNA abundance
314314

man/get_metadata.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-query.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library(CuratedAtlasQueryR)
22

33
test_that("get_SingleCellExperiment() correctly handles duplicate cell IDs", {
44
meta <- get_metadata() |>
5-
dplyr::filter(`_cell` == "868417_1") |>
5+
dplyr::filter(cell_ == "868417_1") |>
66
dplyr::collect()
77
sce <- get_SingleCellExperiment(meta)
88
# This query should return multiple cells, despite querying only 1 cell ID

vignettes/Introduction.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ Dataset-specific columns (definitions available at cellxgene.cziscience.com)
279279

280280
Sample-specific columns (definitions available at cellxgene.cziscience.com)
281281

282-
`.sample`, `.sample_name`, `age_days`, `assay`, `assay_ontology_term_id`, `development_stage`, `development_stage_ontology_term_id`, `ethnicity`, `ethnicity_ontology_term_id`, `experiment___`, `organism`, `organism_ontology_term_id`, `sample_placeholder`, `sex`, `sex_ontology_term_id`, `tissue`, `tissue_harmonised`, `tissue_ontology_term_id`, `disease`, `disease_ontology_term_id`, `is_primary_data.x`
282+
`sample_`, `sample_name`, `age_days`, `assay`, `assay_ontology_term_id`, `development_stage`, `development_stage_ontology_term_id`, `ethnicity`, `ethnicity_ontology_term_id`, `experiment___`, `organism`, `organism_ontology_term_id`, `sample_placeholder`, `sex`, `sex_ontology_term_id`, `tissue`, `tissue_harmonised`, `tissue_ontology_term_id`, `disease`, `disease_ontology_term_id`, `is_primary_data.x`
283283

284284
Cell-specific columns (definitions available at cellxgene.cziscience.com)
285285

286-
`.cell`, `cell_type`, `cell_type_ontology_term_idm`, `cell_type_harmonised`, `confidence_class`, `cell_annotation_azimuth_l2`, `cell_annotation_blueprint_singler`
286+
`cell_`, `cell_type`, `cell_type_ontology_term_idm`, `cell_type_harmonised`, `confidence_class`, `cell_annotation_azimuth_l2`, `cell_annotation_blueprint_singler`
287287

288288
Through harmonisation and curation we introduced custom column, not present in the original CELLxGENE metadata
289289

@@ -296,7 +296,7 @@ Through harmonisation and curation we introduced custom column, not present in t
296296
- `cell_annotation_blueprint_monaco`: SingleR cell annotation using Monaco reference
297297
- `sample_id_db`: Sample subdivision for internal use
298298
- `file_id_db`: File subdivision for internal use
299-
- `.sample`: Sample ID
299+
- `sample_`: Sample ID
300300
- `.sample_name`: How samples were defined
301301

302302
# RNA abundance

0 commit comments

Comments
 (0)