splitSCdata {ADAPTS} | R Documentation |
Take a matrix of single cell data with genes as rows and each column corresponding to a single cells. Break it up into rougly equal subsets, taking care to make sure that each cell type is represented in each set if possible
splitSCdata( RNAcounts, cellIDs = colnames(RNAcounts), numSets = 3, verbose = TRUE, randomize = TRUE )
RNAcounts |
The single cell matrix |
cellIDs |
A vector will cell types for each column in scCountMatrix (DEFAULT: colnames(RNAcounts)) |
numSets |
The number of sets to break it up into (DEFAULT: 3) |
verbose |
Set to TRUE to print cell counts as it goes (DEFAULT: TRUE) |
randomize |
Set to TRUE to randomize the sets (DEFAULT: TRUE) |
a list with a multiple sets
RNAcounts <- matrix(0, nrow=10, ncol=30) rownames(RNAcounts) <- make.names(rep('Gene', nrow(RNAcounts)), unique=TRUE) colnames(RNAcounts) <- make.names(c('CellX', rep('CellY', 9), rep('CellZ', 10), rep('CellB', 10)), unique=TRUE) RNAcounts[, grepl('CellY', colnames(RNAcounts))] <- 1 RNAcounts[, grepl('CellZ', colnames(RNAcounts))] <- 2 RNAcounts[, grepl('CellB', colnames(RNAcounts))] <- 3 splitSCdata(RNAcounts, numSets=3)