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

Commit ba92715

Browse files
authored
Merge pull request #52 from stemangiola/no-remote-db
Remove references to the remote DB
2 parents b14eaf8 + c11b90a commit ba92715

File tree

4 files changed

+26
-65
lines changed

4 files changed

+26
-65
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ Imports:
2929
cli,
3030
assertthat,
3131
SeuratObject,
32+
Seurat,
3233
methods,
3334
rlang,
3435
stats,
35-
RPostgres,
3636
RSQLite
3737
Suggests:
3838
here,

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
S3method(as.sparse,DelayedMatrix)
44
export(get_SingleCellExperiment)
55
export(get_metadata)
6-
export(get_metadata_local)
76
export(get_seurat)
87
importClassesFrom(SingleCellExperiment,SingleCellExperiment)
98
importFrom(BiocGenerics,cbind)
109
importFrom(DBI,dbConnect)
1110
importFrom(HDF5Array,HDF5RealizationSink)
1211
importFrom(HDF5Array,loadHDF5SummarizedExperiment)
13-
importFrom(RPostgres,Postgres)
1412
importFrom(RSQLite,SQLITE_RO)
1513
importFrom(RSQLite,SQLite)
1614
importFrom(S4Vectors,DataFrame)

R/query.R

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -335,53 +335,9 @@ get_seurat <- function(...) {
335335
get_SingleCellExperiment(...) |> as.Seurat(data = NULL)
336336
}
337337

338-
339-
#' Returns a data frame of Human Cell Atlas metadata, which should be filtered
340-
#' and ultimately passed into get_SingleCellExperiment.
341-
#'
342-
#' @param connection Optional list of postgres connection parameters used to
343-
#' connect to the metadata database. Possible parameters are described here:
344-
#' https://rpostgres.r-dbi.org/reference/postgres.
345-
#' @return A lazy data.frame subclass containing the metadata. You can interact
346-
#' with this object using most standard dplyr functions. For string matching,
347-
#' it is recommended that you use `stringr::str_like` to filter character
348-
#' columns, as `stringr::str_match` will not work.
349-
#' @export
350-
#' @examples
351-
#' library(dplyr)
352-
#' library(stringr)
353-
#' filtered_metadata <- get_metadata() |>
354-
#' filter(
355-
#' ethnicity == "African" &
356-
#' str_like(assay, "%10x%") &
357-
#' tissue == "lung parenchyma" &
358-
#' str_like(cell_type, "%CD4%")
359-
#' )
360-
#'
361-
#' @importFrom DBI dbConnect
362-
#' @importFrom RPostgres Postgres
363-
#' @importFrom dplyr tbl
364-
#'
365-
get_metadata <- function(
366-
connection = list(
367-
dbname="metadata",
368-
host="xwwtauhwze2.db.cloud.edu.au",
369-
port="5432",
370-
password="password",
371-
user="public_access"
372-
)
373-
) {
374-
Postgres() |>
375-
list(drv=_) |>
376-
c(connection) |>
377-
do.call(dbConnect, args=_) |>
378-
tbl("metadata")
379-
}
380-
381-
382-
#' Downloads an SQLite database of the Human Cell Atlas metadata to a local
383-
#' cache, and then opens it as a data frame. It can then be filtered and
384-
#' passed into [get_SingleCellExperiment()]
338+
#' Downloads an SQLite database of the Human Cell Atlas metadata to a local
339+
#' cache, and then opens it as a data frame. It can then be filtered and
340+
#' passed into [get_SingleCellExperiment()]
385341
#' to obtain a [`SingleCellExperiment`](SingleCellExperiment::SingleCellExperiment-class)
386342
#'
387343
#' @param remote_url Optional character vector of length 1. An HTTP URL pointing
@@ -396,7 +352,7 @@ get_metadata <- function(
396352
#' @export
397353
#' @examples
398354
#' library(dplyr)
399-
#' filtered_metadata <- get_metadata_local() |>
355+
#' filtered_metadata <- get_metadata() |>
400356
#' filter(
401357
#' ethnicity == "African" &
402358
#' assay %LIKE% "%10x%" &
@@ -410,7 +366,7 @@ get_metadata <- function(
410366
#' @importFrom httr progress
411367
#' @importFrom cli cli_alert_info
412368
#'
413-
get_metadata_local <- function(
369+
get_metadata <- function(
414370
remote_url = "https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.tar.xz",
415371
cache_directory = get_default_cache_dir()
416372
) {

man/get_metadata.Rd

Lines changed: 20 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)