Mechanisms for registration of scdisk subclass generators for use in functions that rely on the class definition instead of an object.

GetSCDisk(r6class = NULL)




An R6 class generator or a character name of an R6 class generator


GetSCDisk: if r6class is NULL, then a vector of all registered scdisk subclasses; otherwise, a generator for the requested scdisk subclass

RegisterSCDisk: adds r6class to the internal subclass registry and invisibly returns NULL


While scdisk-subclassed objects (eg. h5Seurat objects) follow traditional inheritance patterns (can be determined through inherits), the class definitions and object generators do not. These functions provide a simple mechanism for adding and getting the defintions of scdisk subclasses for functions that utilize the object generators or other aspects of the class definition (such as Convert)

To register a subclass of scdisk, simply add a call to RegisterSCDisk in your load hook

.onLoad <- function(libname, pkgname) {
  # Other code to be run on load


#> [1] "h5Seurat"
#> <h5Seurat> object generator #> Inherits from: <scdisk> #> Public: #> index: function () #> set.version: function (version) #> version: function () #> Private: #> index.internal: list #> versions: 3.1.2 #> build.index: function (version) #> create: function (version, verbose = TRUE) #> validate: function (verbose = TRUE, ...) #> v3.1.2: function () #> v3.2.0: function () #> Parent env: <environment: namespace:SeuratDisk> #> Locked objects: TRUE #> Locked class: TRUE #> Portable: TRUE
if (FALSE) { RegisterSCDisk(h5Seurat) }