From b4e1239b5d666b6d682ae429e0ed629190a667e5 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Wed, 20 Sep 2023 09:15:38 +0200 Subject: [PATCH] add missing *_keys functions --- R/AbstractAnnData.R | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/R/AbstractAnnData.R b/R/AbstractAnnData.R index 4576c250..424e5ee7 100644 --- a/R/AbstractAnnData.R +++ b/R/AbstractAnnData.R @@ -97,13 +97,13 @@ AbstractAnnData <- R6::R6Class("AbstractAnnData", # nolint NULL } if (length(keys) > 0) { - cat( - " ", attribute, ":", + cat( + " ", attribute, ":", paste("'", keys, "'", collapse = ", "), - "\n", sep = "" - ) - } + "\n", sep = "" + ) } + } }, #' @description Dimensions (observations x variables) of the AnnData object. @@ -133,6 +133,22 @@ AbstractAnnData <- R6::R6Class("AbstractAnnData", # nolint layers_keys = function() { names(self$layers) }, + #' @description Keys (element names) of `obsm`. + obsm_keys = function() { + names(self$obsm) + }, + #' @description Keys (element names) of `varm`. + varm_keys = function() { + names(self$varm) + }, + #' @description Keys (element names) of `obsp`. + obsp_keys = function() { + names(self$obsp) + }, + #' @description Keys (element names) of `varp`. + varp_keys = function() { + names(self$varp) + }, #' @description Convert to SingleCellExperiment to_SingleCellExperiment = function() { to_SingleCellExperiment(self)