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

Commit 98c1773

Browse files
authored
Merge pull request #72 from stemangiola/fix-65
Fix 65
2 parents 0b54987 + bb75741 commit 98c1773

File tree

4 files changed

+16
-30
lines changed

4 files changed

+16
-30
lines changed

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ importFrom(tibble,column_to_rownames)
5555
importFrom(tools,R_user_dir)
5656
importFrom(utils,head)
5757
importFrom(utils,packageName)
58-
importFrom(utils,untar)

R/query.R

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +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-
#' @noRd
16-
#' @param x The value to return
17-
#' @param ... Expressions to evaluate
18-
aside <- function(x, ...) {
19-
# Courtesy of Hadley: https://fosstodon.org/@hadleywickham/109558265769090930
20-
list(...)
21-
x
22-
}
23-
2413
REMOTE_URL <- "https://swift.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/harmonised-human-atlas"
2514

2615
#' Given a data frame of HCA metadata, returns a SingleCellExperiment object
@@ -94,29 +83,27 @@ get_SingleCellExperiment <- function(
9483

9584
cache_directory |> dir.create(showWarnings = FALSE)
9685

97-
cells_of_interest <- raw_data |>
98-
pull(.data$.cell) |>
99-
unique() |>
100-
as.character()
101-
10286
subdirs <- assay_map[assays]
10387

10488
# The repository is optional. If not provided we load only from the cache
10589
if (!is.null(repository)) {
10690
cli_alert_info("Synchronising files")
91+
parsed_repo <- parse_url(repository)
92+
parsed_repo$scheme |>
93+
`%in%`(c("http", "https")) |>
94+
assert_that()
95+
10796
files_to_read <-
10897
raw_data |>
10998
pull(.data$file_id_db) |>
11099
unique() |>
111-
as.character()
112-
parsed_repo <- parse_url(repository)
113-
(parsed_repo$scheme %in% c("http", "https")) |> assert_that()
114-
sync_assay_files(
115-
url = parsed_repo,
116-
cache_dir = cache_directory,
117-
files = files_to_read,
118-
subdirs = subdirs
119-
)
100+
as.character() |>
101+
sync_assay_files(
102+
url = parsed_repo,
103+
cache_dir = cache_directory,
104+
files = _,
105+
subdirs = subdirs
106+
)
120107
}
121108

122109
cli_alert_info("Reading files.")
@@ -316,7 +303,8 @@ get_default_cache_dir <- function() {
316303
R_user_dir(
317304
"cache"
318305
) |>
319-
normalizePath()
306+
normalizePath() |>
307+
suppressWarnings()
320308
}
321309

322310
#' @importFrom assertthat assert_that
@@ -375,7 +363,6 @@ get_seurat <- function(...) {
375363
#' @importFrom dplyr tbl
376364
#' @importFrom httr progress
377365
#' @importFrom cli cli_alert_info
378-
#' @importFrom utils untar
379366
get_metadata <- function(
380367
remote_url = "https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.parquet",
381368
cache_directory = get_default_cache_dir()

man/get_SingleCellExperiment.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.

man/get_seurat.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.

0 commit comments

Comments
 (0)