1+ # These are hacks to force the above packages to be loaded, and also to
2+ # satisfy R CMD check. We don't need to attach them at all.
3+ # ' @import dbplyr
4+ # ' @import Seurat
5+ NULL
6+
17# Maps user provided assay names to their corresponding paths in the repository
28assay_map <- c(
39 counts = " original" ,
410 cpm = " cpm"
511)
612
7- # ' Used in a pipeline to run one or more expressions with side effects, but
8- # ' return the input value as the output value unaffected
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
915aside <- function (x , ... ) {
1016 # Courtesy of Hadley: https://fosstodon.org/@hadleywickham/109558265769090930
1117 list (... )
@@ -120,7 +126,7 @@ get_SingleCellExperiment <- function(
120126 )
121127
122128 raw_data | >
123- dplyr :: group_by(file_id_db ) | >
129+ dplyr :: group_by(.data $ file_id_db ) | >
124130 # Load each file and attach metadata
125131 dplyr :: summarise(sces = list (group_to_sce(
126132 dplyr :: cur_group_id(),
@@ -146,18 +152,17 @@ get_SingleCellExperiment <- function(
146152
147153# ' Converts a data frame into a single SCE
148154# '
149- # ' @param prefix Prefix to be added to the column names
155+ # ' @param i Suffix to be added to the column names, to make them unique
150156# ' @param df The data frame to be converted
151157# ' @param dir_prefix The path to the single cell experiment, minus the final segment
152158# ' @param features The list of genes/rows of interest
153- # '
154159# ' @return A SingleCellExperiment object
155160# ' @importFrom dplyr mutate
156161# ' @importFrom HDF5Array loadHDF5SummarizedExperiment
157162# ' @importFrom SummarizedExperiment colData<-
158163# ' @importFrom tibble column_to_rownames
159- # ' @importClassesFrom SingleCellExperiment SingleCellExperiment
160- # '
164+ # ' @importFrom utils head
165+ # ' @noRd
161166group_to_sce <- function (i , df , dir_prefix , features ) {
162167 sce_path <- df $ file_id_db | >
163168 head(1 ) | >
@@ -183,7 +188,7 @@ group_to_sce <- function(i, df, dir_prefix, features) {
183188 # variable
184189 new_cellnames <- paste0(cells , " _" , i )
185190 new_coldata <- df | >
186- mutate(original_cell_id = .cell , .cell = new_cellnames ) | >
191+ mutate(original_cell_id = .data $ . cell , .cell = new_cellnames ) | >
187192 column_to_rownames(" .cell" ) | >
188193 as(" DataFrame" )
189194
@@ -300,18 +305,20 @@ sync_remote_file <- function(full_url, output_file, ...) {
300305# '
301306# ' @return A length one character vector.
302307# ' @importFrom tools R_user_dir
308+ # ' @importFrom utils packageName
303309# ' @noRd
304310# '
305311get_default_cache_dir <- function () {
306312 packageName() | >
307313 R_user_dir(
308314 " cache"
309- )
315+ ) | >
316+ normalizePath()
310317}
311318
312- # ' @importFrom SeuratObject as.sparse
313319# ' @importFrom assertthat assert_that
314320# ' @importFrom methods as
321+ # ' @importFrom SeuratObject as.sparse
315322# ' @exportS3Method
316323as.sparse.DelayedMatrix <- function (x ) {
317324 # This is glue to ensure the SCE -> Seurat conversion works properly with
@@ -323,7 +330,7 @@ as.sparse.DelayedMatrix <- function(x) {
323330# ' the samples in that data frame
324331# '
325332# ' @inheritDotParams get_SingleCellExperiment
326- # ' @importFrom Seurat as.Seurat
333+ # ' @importFrom SeuratObject as.Seurat
327334# ' @export
328335# ' @return A Seurat object containing the same data as a call to
329336# ' get_SingleCellExperiment.
@@ -365,7 +372,7 @@ get_seurat <- function(...) {
365372# ' @importFrom dplyr tbl
366373# ' @importFrom httr progress
367374# ' @importFrom cli cli_alert_info
368- # '
375+ # ' @importFrom utils untar
369376get_metadata <- function (
370377 remote_url = " https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.tar.xz" ,
371378 cache_directory = get_default_cache_dir()
0 commit comments