Get slot names and add or remove slots
Usage
Slots(data)
DropSlot(data, pattern = NULL)
AddSlot(data, name, matrix, set.to.default = FALSE, warn = TRUE)
Arguments
- data
A grandR object
- pattern
a regular expression matched against slot names
- name
the slot name
- matrix
the data matrix for the new slot
- set.to.default
set the new slot as the default slot?
- warn
issue a warning if the slot name already exists and is overwritten
Functions
Slots()
: Obtain the slot namesDropSlot()
: Remove one or several slots from this grandR objectAddSlot()
: Add an additional slot to this grandR object
Examples
sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
design=c("Cell",Design$dur.4sU,Design$Replicate))
#> Warning: Duplicate gene symbols (n=1, e.g. MATR3) present, making unique!
sars <- Normalize(sars) # default behavior is to update the default slot
sars
#> grandR:
#> Read from /tmp/RtmpNDZEZV/temp_libpath1765f21592dff/grandR/extdata/sars.tsv.gz
#> 1045 genes, 12 samples/cells
#> Available data slots: count,ntr,alpha,beta,norm
#> Available analyses:
#> Available plots:
#> Default data slot: norm
sars <- DropSlot(sars,"norm")
sars # note that the defauls slot reverted to count
#> grandR:
#> Read from /tmp/RtmpNDZEZV/temp_libpath1765f21592dff/grandR/extdata/sars.tsv.gz
#> 1045 genes, 12 samples/cells
#> Available data slots: count,ntr,alpha,beta
#> Available analyses:
#> Available plots:
#> Default data slot: count