-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue-60-from-seurat
- Loading branch information
Showing
49 changed files
with
542 additions
and
907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,41 @@ Package: anndataR | |
Title: AnnData interoperability in R | ||
Version: 0.0.0.9000 | ||
Authors@R: c( | ||
person("Robrecht", "Cannoodt", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood")), | ||
person("Luke", "Zappia", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0001-7744-8565", github = "lazappi")), | ||
person("Martin", "Morgan", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0002-5874-8148", github = "mtmorgan")), | ||
person("Louise", "Deconinck", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0001-8100-6823", github = "LouiseDck")), | ||
person("Danila", "Bredikhin", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0001-8089-6983", github = "gtca")) | ||
person( | ||
"Robrecht", | ||
"Cannoodt", | ||
email = "[email protected]", | ||
role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood") | ||
), | ||
person( | ||
"Luke", | ||
"Zappia", | ||
email = "[email protected]", | ||
role = "aut", | ||
comment = c(ORCID = "0000-0001-7744-8565", github = "lazappi") | ||
), | ||
person( | ||
"Martin", | ||
"Morgan", | ||
email = "[email protected]", | ||
role = "aut", | ||
comment = c(ORCID = "0000-0002-5874-8148", github = "mtmorgan") | ||
), | ||
person( | ||
"Louise", | ||
"Deconinck", | ||
email = "[email protected]", | ||
role = "aut", | ||
comment = c(ORCID = "0000-0001-8100-6823", github = "LouiseDck") | ||
), | ||
person( | ||
"Danila", | ||
"Bredikhin", | ||
email = "[email protected]", | ||
role = "ctb", | ||
comment = c(ORCID = "0000-0001-8089-6983", github = "gtca") | ||
) | ||
) | ||
Description: Bring the power and flexibility of AnnData to the R | ||
ecosystem, allowing you to effortlessly manipulate and analyze your | ||
|
@@ -29,6 +54,7 @@ Imports: | |
R6 | ||
Suggests: | ||
anndata, | ||
BiocStyle, | ||
knitr, | ||
reticulate, | ||
rhdf5, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#' Read H5AD | ||
#' | ||
#' Read data from a H5AD file | ||
#' | ||
#' @param path Path to the H5AD file to read | ||
#' @param to The type of object to return. Must be one of: "SingleCellExperiment", | ||
#' "Seurat", "HDF5AnnData", "InMemoryAnnData" | ||
#' | ||
#' @return The object specified by `to` | ||
#' @export | ||
#' | ||
#' @examples | ||
#' h5ad_file <- system.file("extdata", "example.h5ad", package = "anndataR") | ||
#' # Read the H5AD as a SingleCellExperiment object | ||
#' if (requireNamespace("SingleCellExperiment", quietly = TRUE)) { | ||
#' sce <- read_h5ad(h5ad_file, to = "SingleCellExperiment") | ||
#' } | ||
#' # Read the H5AD as a Seurat object | ||
#' if (requireNamespace("SeuratObject", quietly = TRUE)) { | ||
#' seurat <- read_h5ad(h5ad_file, to = "Seurat") | ||
#' } | ||
read_h5ad <- function(path, to = c("SingleCellExperiment", "Seurat", "HDF5AnnData", "InMemoryAnnData")) { | ||
to <- match.arg(to) | ||
|
||
adata <- HDF5AnnData$new(path) | ||
|
||
switch(to, | ||
"SingleCellExperiment" = to_SingleCellExperiment(adata), | ||
"Seurat" = to_Seurat(adata), | ||
"HDF5AnnData" = adata, | ||
"InMemoryAnnData" = to_InMemoryAnnData(adata) | ||
) | ||
} |
Oops, something went wrong.