diff --git a/DESCRIPTION b/DESCRIPTION index b913140..298081e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: anndata Title: 'anndata' for R Version: 0.7.5.6 -Authors@R: +Authors@R: c(person(given = "Philipp", family = "Angerer", role = "ccp", @@ -47,7 +47,7 @@ Suggests: rmarkdown Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.2.9000 Config/reticulate: list( packages = list( diff --git a/NAMESPACE b/NAMESPACE index 0788113..a91b043 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -28,6 +28,7 @@ S3method(py_to_r,anndata._core.aligned_mapping.LayersBase) S3method(py_to_r,anndata._core.anndata.AnnData) S3method(py_to_r,anndata._core.raw.Raw) S3method(py_to_r,anndata._core.sparse_dataset.SparseDataset) +S3method(py_to_r,anndata.abc._AbstractCSDataset) S3method(py_to_r,collections.abc.KeysView) S3method(py_to_r,collections.abc.Mapping) S3method(py_to_r,collections.abc.Set) @@ -58,7 +59,6 @@ export(write_csvs) export(write_h5ad) export(write_loom) export(write_zarr) -importFrom(Matrix,sparseMatrix) importFrom(R6,R6Class) importFrom(assertthat,assert_that) importFrom(methods,as) diff --git a/R/concat.R b/R/concat.R index 1e1d11b..592b2a0 100644 --- a/R/concat.R +++ b/R/concat.R @@ -15,7 +15,7 @@ #' @param uns_merge How the elements of `.uns` are selected. Uses the same set of strategies as the `merge` argument, except applied recursively. #' @param label Column in axis annotation (i.e. `.obs` or `.var`) to place batch information in. If it's NULL, no column is added. #' @param keys Names for each object being added. These values are used for column values for `label` or appended to the index if `index_unique` is not `NULL`. Defaults to incrementing integer labels. -#' @param index_unique Whether to make the index unique by using the keys. If provided, this is the delimeter between "{orig_idx}{index_unique}{key}". When `NULL`, the original indices are kept. +#' @param index_unique Whether to make the index unique by using the keys. If provided, this is the delimeter between `{orig_idx}{index_unique}{key}`. When `NULL`, the original indices are kept. #' @param fill_value When `join="outer"`, this is the value that will be used to fill the introduced indices. By default, sparse arrays are padded with zeros, while dense arrays and DataFrames are padded with missing values. #' @param pairwise Whether pairwise elements along the concatenated dimension should be included. This is FALSE by default, since the resulting arrays are often not meaningful. #' diff --git a/R/reticulate_conversions.R b/R/reticulate_conversions.R index a1a2480..b061f73 100644 --- a/R/reticulate_conversions.R +++ b/R/reticulate_conversions.R @@ -89,17 +89,7 @@ py_to_r.collections.abc.KeysView <- function(x) { x_list } - -#' @importFrom Matrix sparseMatrix -py_to_r.scipy.sparse.csc.csc_matrix <- function(x) { - Matrix::sparseMatrix( - i = as.integer(py_to_r_ifneedbe(x$indices)) + 1, - p = as.integer(py_to_r_ifneedbe(x$indptr)), - x = as.vector(py_to_r_ifneedbe(x$data)), - dims = as.integer(dim(x)) - ) -} - +#' @export py_to_r.anndata.abc._AbstractCSDataset <- function(x) { py_to_r_ifneedbe(x$to_memory()) } diff --git a/man/concat.Rd b/man/concat.Rd index 66ac0ff..e8bfdb5 100644 --- a/man/concat.Rd +++ b/man/concat.Rd @@ -32,7 +32,7 @@ concat( \item{keys}{Names for each object being added. These values are used for column values for \code{label} or appended to the index if \code{index_unique} is not \code{NULL}. Defaults to incrementing integer labels.} -\item{index_unique}{Whether to make the index unique by using the keys. If provided, this is the delimeter between "{orig_idx}{index_unique}{key}". When \code{NULL}, the original indices are kept.} +\item{index_unique}{Whether to make the index unique by using the keys. If provided, this is the delimeter between \verb{\{orig_idx\}\{index_unique\}\{key\}}. When \code{NULL}, the original indices are kept.} \item{fill_value}{When \code{join="outer"}, this is the value that will be used to fill the introduced indices. By default, sparse arrays are padded with zeros, while dense arrays and DataFrames are padded with missing values.}