| Title: | Google Cloud Storage-Backed AnnData for R |
|---|---|
| Description: | Extends the 'anndataR' package to provide Google Cloud Storage-backed AnnData functionality for R. This package allows users to work with AnnData objects stored in Google Cloud Storage without downloading the entire file, enabling efficient access to large single-cell datasets directly from the cloud. |
| Authors: | Masahiro Kanai |
| Maintainer: | Masahiro Kanai <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-04 07:02:30 UTC |
| Source: | https://github.com/mkanai/GCSanndataR |
This function installs the gcs_anndata Python package using reticulate. The gcs_anndata package allows for reading AnnData objects directly from Google Cloud Storage.
install_gcs_anndata(...)install_gcs_anndata(...)
... |
Additional arguments passed to reticulate::py_install() |
Invisible NULL, called for side effect of installing the package
py_install for more details on installation options
## Not run: install_gcs_anndata() ## End(Not run)## Not run: install_gcs_anndata() ## End(Not run)
Read data from a H5AD file, either from a local file or from Google Cloud Storage
read_h5ad( path, as = c("HDF5AnnData", "InMemoryAnnData", "SingleCellExperiment", "Seurat"), mode = c("r", "r+", "a", "w", "w-", "x"), ... )read_h5ad( path, as = c("HDF5AnnData", "InMemoryAnnData", "SingleCellExperiment", "Seurat"), mode = c("r", "r+", "a", "w", "w-", "x"), ... )
path |
Path to the H5AD file to read. If the path starts with "gs://", it will be treated as a Google Cloud Storage path and will automatically use the GCSAnnData backend. |
as |
The type of object to return. Must be one of: "HDF5AnnData", "InMemoryAnnData", "GCSAnnData", "SingleCellExperiment", "Seurat". Default is "HDF5AnnData". Note that for paths starting with "gs://", this parameter is ignored and "GCSAnnData" is used. A warning will be issued if a different value is provided for GCS paths. |
mode |
The mode to open the HDF5 file. Default is "r" (read-only). Note that for paths starting with "gs://", this parameter is ignored and read-only mode is used. A warning will be issued if a different value is provided for GCS paths. * 'a' creates a new file or opens an existing one for read/write. * 'r' opens an existing file for reading. * 'r+' opens an existing file for read/write. * 'w' creates a file, truncating any existing ones. * 'w-'/'x' are synonyms, creating a file and failing if it already exists. |
... |
Extra arguments provided to 'adata$to_SingleCellExperiment()' or 'adata$to_Seurat()'. See [AnnData()] for more information on the arguments of these functions. Note: update this documentation when ['r-lib/roxygen2#955'](https://github.com/r-lib/roxygen2/issues/955) is resolved. |
The object specified by 'to'
## Not run: h5ad_file <- system.file("extdata", "example.h5ad", package = "anndataR") # Read the H5AD as a SingleCellExperiment object sce <- read_h5ad(h5ad_file, as = "SingleCellExperiment") # Read the H5AD as a Seurat object seurat <- read_h5ad(h5ad_file, as = "Seurat") # Read an H5AD file from Google Cloud Storage # This will automatically use GCSAnnData gcs_adata <- read_h5ad("gs://my-bucket/my-file.h5ad") # Access specific rows and columns gcs_adata$X[1:10, 1:5] # Access using names gcs_adata$X[c("cell1", "cell2"), c("gene1", "gene2")] ## End(Not run)## Not run: h5ad_file <- system.file("extdata", "example.h5ad", package = "anndataR") # Read the H5AD as a SingleCellExperiment object sce <- read_h5ad(h5ad_file, as = "SingleCellExperiment") # Read the H5AD as a Seurat object seurat <- read_h5ad(h5ad_file, as = "Seurat") # Read an H5AD file from Google Cloud Storage # This will automatically use GCSAnnData gcs_adata <- read_h5ad("gs://my-bucket/my-file.h5ad") # Access specific rows and columns gcs_adata$X[1:10, 1:5] # Access using names gcs_adata$X[c("cell1", "cell2"), c("gene1", "gene2")] ## End(Not run)