RegisterSCDisk: Get and Register 'scdisk' Subclasses

View source: R/scdisk.R

RegisterSCDiskR Documentation

Get and Register scdisk Subclasses

Description

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

Usage

GetSCDisk(r6class = NULL)

RegisterSCDisk(r6class)

Arguments

r6class

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

Details

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
}

Value

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

Examples

GetSCDisk()
GetSCDisk("h5Seurat")

## Not run: 
RegisterSCDisk(h5Seurat)

## End(Not run)


mojaveazure/seurat-disk documentation built on Nov. 5, 2023, 9:40 a.m.