testAllSigMatrices {ADAPTS}R Documentation

Generate all the signature matrices one time with the option to leave out half of the data as a test set

Description

This wrapper is helpful for repetitively matrix generation. It generates seed matrix, all-gene matrix, augmented matrix, shrunk matrix, and all the clustered matrices in one call.

Usage

testAllSigMatrices(
  exprData,
  randomize = TRUE,
  skipShrink = FALSE,
  proportional = FALSE,
  handMetaCluster = NULL,
  testOnHalf = TRUE,
  condTol = 1.01,
  numChunks = 100,
  plotIt = TRUE,
  fastStop = TRUE,
  singleCore = TRUE
)

Arguments

exprData

The gene express data. Each row is a gene, and each column is an example of a particular cell type.

randomize

Set to to TRUE randomize the sets selected by ADAPTS::scSample (DEFAULT: TRUE)

skipShrink

Set to TRUE to skip shrinking the signatrure matrix (DEFAULT: TRUE)

proportional

Set to true to make the training set cell type proportional. Ignores group size (DEFAULT: FALSE)

handMetaCluster

A List of pre-defined meta clusters.Set to NULL to automatically group indistinguishable cells into same cluster using clustWspillOver.(DEFAULT: NULL)

testOnHalf

Set to TRUE to leave half the data as a test set

condTol

The tolerance in the reconstruction algorithm. 1.0 = no tolerance, 1.05 = 5% tolerance (DEFAULT: 1.01)

numChunks

The number of groups of genes to remove while shrinking (DEFAULT: NULL, i.e. 1)

plotIt

Set to FALSE to suppress plots (DEFAULT: TRUE)

fastStop

Halt early when the condition number changes by less than 1 for 3 iterations (DEFAULT: TRUE)

singleCore

TRUE for a single core (DEFAULT: TRUE)

Value

A list of results including prediction accuracy and cell enrichment

Examples

ct1 <- runif(1000, 0, 100)
ct2 <- runif(1000, 0, 100)
ct3 <- runif(1000, 0, 100)
ct4 <- runif(1000, 0, 100)
dataMat <- cbind(ct1, ct1, ct1, ct1, ct1, ct1, ct2, ct2, ct2, ct2, ct3, ct3, ct3,ct3,ct4,ct4)
rownames(dataMat) <- make.names(rep('gene', nrow(dataMat)), unique=TRUE)
noise <- matrix(runif(nrow(dataMat)*ncol(dataMat), -2, 2), nrow = nrow(dataMat), byrow = TRUE)
dataMat <- dataMat + noise
metaList <- list()
colnames(dataMat) <- sub('\\..*','', colnames(dataMat))
metaList[[1]] <- c(unique(colnames(dataMat))[1])  #Cell Type 1
metaList[[2]] <- c(unique(colnames(dataMat))[2])  #Cell Type 2
metaList[[3]] <- c(unique(colnames(dataMat))[3])  #Cell Type 3
metaList[[4]] <- c(unique(colnames(dataMat))[4:length(unique(colnames(dataMat)))])  #Cell Type 4
#options(mc.cores=2)
#  This is a meta-function that calls other functions, 
#  The execution speed is too slow for the CRAN automated check
#testAllSigMatrices(exprData=dataMat, randomize = TRUE, skipShrink=FALSE, 
#    proportional=FALSE, handMetaCluster=metaList, testOnHalf=TRUE, numChunks=NULL)

[Package ADAPTS version 1.0.22 Index]