@@ -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-
2413REMOTE_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
379366get_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()
0 commit comments