Mechanisms for registration of scdisk
subclass generators for
use in functions that rely on the class definition instead of an object.
GetSCDisk(r6class = NULL) RegisterSCDisk(r6class)
r6class | 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) { RegisterSCDisk(classgen) # Other code to be run on load }
GetSCDisk()#> [1] "h5Seurat"GetSCDisk("h5Seurat")#> <h5Seurat> object generator #> Inherits from: <scdisk> #> Public: #> index: function () #> set.version: function (version) #> version: function () #> Private: #> index.internal: list #> versions: 3.1.2 3.1.5.9900 #> 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: TRUEif (FALSE) { RegisterSCDisk(h5Seurat) }