scSample: Build groupSize pools according to cellIDs

Description Usage Arguments Value Examples

View source: R/MakeSigMatrix.R

Description

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

Usage

1
2
3
4
5
6
scSample(
  RNAcounts,
  cellIDs = colnames(RNAcounts),
  groupSize = 3,
  randomize = TRUE
)

Arguments

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)

Value

a list with a multiple sets

Examples

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

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