View source: R/MakeSigMatrix.R
scSample | R Documentation |
This function is intended to collapse many single cells into 3 (groupsize) groups with the average count across all cells in each of the groups. These groups can then be used to perform a t-test (for example) between the 3 groups of CellX with 3 groups of CellY
scSample( RNAcounts, cellIDs = colnames(RNAcounts), groupSize = 3, randomize = TRUE, mc.cores = 1 )
RNAcounts |
The single cell matrix |
cellIDs |
A vector will cell types for each column in scCountMatrix (DEFAULT: colnames(RNAcounts)) |
groupSize |
The number of sets to break it up into (DEFAULT: 3) |
randomize |
Set to TRUE to randomize the sets (DEFAULT: TRUE) |
mc.cores |
The number of cores to use (DEFAULT: 1) |
a list with a multiple sets
RNAcounts <- matrix(0, nrow=10, ncol=100) rownames(RNAcounts) <- make.names(rep('Gene', nrow(RNAcounts)), unique=TRUE) colnames(RNAcounts) <- make.names(c('CellX', rep('CellY', 39), rep('CellZ', 30), rep('CellB', 30)), unique=TRUE) RNAcounts[, grepl('CellY', colnames(RNAcounts))] <- 1 RNAcounts[, grepl('CellZ', colnames(RNAcounts))] <- 2 RNAcounts[, grepl('CellB', colnames(RNAcounts))] <- 3 scSample(RNAcounts, groupSize=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.