Convert discrete annotations to dummy variable matrices.
codeY(sce, phenotypes, method = c("-1,1", "0,1"))
Arguments
- sce
SingleCellExperiment object.
- phenotypes
Which phenotype annotations (e.g. cell types) to convert.
- method
Which coding to use, either (-1,1) or (0,1).
Value
- YY
A dummy variable matrix encoding discrete annotation
Examples
sce <- scuttle::mockSCE(ncells = 20, ngenes = 10)
YY <- codeY(sce, phenotypes = c("Cell_Cycle", "Treatment"))
head(YY)