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

Commit 8e7c421

Browse files
committed
Fix #65
1 parent 44dd7e7 commit 8e7c421

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

R/query.R

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ assay_map <- c(
1010
cpm = "cpm"
1111
)
1212

13-
#' Used in a pipeline to run one or more expressions with side effects, but
14-
#' return the input value as the output value unaffected
15-
aside <- function(x, ...) {
16-
# Courtesy of Hadley: https://fosstodon.org/@hadleywickham/109558265769090930
17-
list(...)
18-
x
19-
}
20-
2113
REMOTE_URL <- "https://swift.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/harmonised-human-atlas"
2214

2315
#' Given a data frame of HCA metadata, returns a SingleCellExperiment object
@@ -91,29 +83,27 @@ get_SingleCellExperiment <- function(
9183

9284
cache_directory |> dir.create(showWarnings = FALSE)
9385

94-
cells_of_interest <- raw_data |>
95-
pull(.data$.cell) |>
96-
unique() |>
97-
as.character()
98-
9986
subdirs <- assay_map[assays]
10087

10188
# The repository is optional. If not provided we load only from the cache
10289
if (!is.null(repository)) {
10390
cli_alert_info("Synchronising files")
91+
parsed_repo <- parse_url(repository)
92+
parsed_repo$scheme |>
93+
`%in`(c("http", "https")) |>
94+
assert_that()
95+
10496
files_to_read <-
10597
raw_data |>
10698
pull(.data$file_id_db) |>
10799
unique() |>
108-
as.character()
109-
parsed_repo <- parse_url(repository)
110-
(parsed_repo$scheme %in% c("http", "https")) |> assert_that()
111-
sync_assay_files(
112-
url = parsed_repo,
113-
cache_dir = cache_directory,
114-
files = files_to_read,
115-
subdirs = subdirs
116-
)
100+
as.character() |>
101+
sync_assay_files(
102+
url = parsed_repo,
103+
cache_dir = cache_directory,
104+
files = _,
105+
subdirs = subdirs
106+
)
117107
}
118108

119109
cli_alert_info("Reading files.")
@@ -313,7 +303,8 @@ get_default_cache_dir <- function() {
313303
R_user_dir(
314304
"cache"
315305
) |>
316-
normalizePath()
306+
normalizePath() |>
307+
suppressWarnings()
317308
}
318309

319310
#' @importFrom assertthat assert_that
@@ -372,7 +363,6 @@ get_seurat <- function(...) {
372363
#' @importFrom dplyr tbl
373364
#' @importFrom httr progress
374365
#' @importFrom cli cli_alert_info
375-
#' @importFrom utils untar
376366
get_metadata <- function(
377367
remote_url = "https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.parquet",
378368
cache_directory = get_default_cache_dir()

0 commit comments

Comments
 (0)