Skip to content

Commit

Permalink
Add installation information when anndataR is not installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseDck committed Nov 13, 2024
1 parent f79a2ad commit 6d29506
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ readTable <- function(x, anndataR = FALSE) {
#' @importFrom basilisk basiliskStart basiliskStop basiliskRun
#' @export
readTable_basilisk <- function(x) {
# TODO: temporary, until AnnDataR supports
# reading AnnData from .zarr (.h5ad only atm)
proc <- basiliskStart(.env)
on.exit(basiliskStop(proc))
basiliskRun(proc, zarr=x, \(zarr) {
Expand All @@ -106,7 +104,9 @@ readTable_basilisk <- function(x) {
#' @importFrom anndataR read_zarr to_SingleCellExperiment
#' @export
readTable_anndataR <- function(x) {
requireNamespace("anndataR")
if (!requireNamespace('anndataR', quietly = TRUE)){
stop("Install 'anndataR' to use this function.\nInstall this version: `remotes::install_github(\"keller-mark/anndataR\", ref = \"spatialdata\")`")
}
adata <- anndataR::read_zarr(x)
anndataR::to_SingleCellExperiment(adata)
}
Expand Down

0 comments on commit 6d29506

Please sign in to comment.