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

Commit 8dcfa2e

Browse files
committed
Implement postgres metadata, nectar object storage, bump dbplyr
1 parent 34e6900 commit 8dcfa2e

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Imports:
3232
Seurat,
3333
methods,
3434
rlang,
35-
stats
35+
stats,
36+
RPostgres
3637
Suggests:
3738
here,
3839
stringr,
@@ -46,9 +47,9 @@ Suggests:
4647
SingleR,
4748
tools,
4849
rmarkdown,
49-
dbplyr,
5050
knitr,
51-
testthat
51+
testthat,
52+
dbplyr (>= 2.3.0)
5253
Biarch: true
5354
biocViews:
5455
AssayDomain,

NAMESPACE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ importFrom(BiocGenerics,cbind)
99
importFrom(DBI,dbConnect)
1010
importFrom(HDF5Array,HDF5RealizationSink)
1111
importFrom(HDF5Array,loadHDF5SummarizedExperiment)
12-
importFrom(RSQLite,SQLITE_RO)
13-
importFrom(RSQLite,SQLite)
12+
importFrom(RPostgres,Postgres)
1413
importFrom(S4Vectors,DataFrame)
1514
importFrom(Seurat,as.Seurat)
1615
importFrom(SeuratObject,as.sparse)
@@ -38,7 +37,6 @@ importFrom(glue,glue)
3837
importFrom(httr,GET)
3938
importFrom(httr,modify_url)
4039
importFrom(httr,parse_url)
41-
importFrom(httr,progress)
4240
importFrom(httr,stop_for_status)
4341
importFrom(httr,write_disk)
4442
importFrom(methods,as)

R/query.R

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ aside <- function(x, ...) {
1212
x
1313
}
1414

15-
REMOTE_URL <- "https://harmonised-human-atlas.s3.amazonaws.com/"
15+
REMOTE_URL <- "https://swift.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/harmonised-human-atlas"
1616

1717
#' Given a data frame of HCA metadata, returns a SingleCellExperiment object
1818
#' corresponding to the samples in that data frame
@@ -339,11 +339,9 @@ get_seurat <- function(...) {
339339
#' Returns a data frame of Human Cell Atlas metadata, which should be filtered
340340
#' and ultimately passed into get_SingleCellExperiment.
341341
#'
342-
#' @param repository Optional character vector of length 1. An HTTP URL pointing
343-
#' to the location of the sqlite database.
344-
#' @param cache_directory Optional character vector of length 1. A file path on
345-
#' your local system to a directory (not a file) that will be used to store
346-
#' metadata.sqlite
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.
347345
#' @return A lazy data.frame subclass containing the metadata. You can interact
348346
#' with this object using most standard dplyr functions. However, it is
349347
#' recommended that you use the %LIKE% operator for string matching, as most
@@ -360,21 +358,21 @@ get_seurat <- function(...) {
360358
#' )
361359
#'
362360
#' @importFrom DBI dbConnect
363-
#' @importFrom RSQLite SQLite SQLITE_RO
361+
#' @importFrom RPostgres Postgres
364362
#' @importFrom dplyr tbl
365-
#' @importFrom httr progress
366363
#'
367364
get_metadata <- function(
368-
repository = "https://harmonised-human-atlas.s3.amazonaws.com/metadata.sqlite",
369-
cache_directory = get_default_cache_dir()
370-
) {
371-
sqlite_path <- file.path(cache_directory, "metadata.sqlite")
372-
sync_remote_file(
373-
repository,
374-
sqlite_path,
375-
progress(type = "down", con = stderr())
365+
connection = list(
366+
dbname="metadata",
367+
host="zki3lfhznsa.db.cloud.edu.au",
368+
port="5432",
369+
password="password",
370+
user="public_access"
376371
)
377-
SQLite() |>
378-
dbConnect(drv = _, dbname = sqlite_path, flags = SQLITE_RO) |>
372+
) {
373+
Postgres() |>
374+
list(drv=_) |>
375+
c(connection) |>
376+
do.call(dbConnect, args=_) |>
379377
tbl("metadata")
380378
}

man/get_metadata.Rd

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

0 commit comments

Comments
 (0)