splitSCdata: Split a single cell dataset into multiple sets

Description Usage Arguments Value Examples

View source: R/MakeSigMatrix.R

Description

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

Usage

1
2
3
4
5
6
7
splitSCdata(
  RNAcounts,
  cellIDs = colnames(RNAcounts),
  numSets = 3,
  verbose = TRUE,
  randomize = TRUE
)

Arguments

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)

Value

a list with a multiple sets

Examples

1
2
3
4
5
6
7
8
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)

yxinyi2/ADAPTS1.0.3 documentation built on Aug. 5, 2020, 12:09 a.m.