generateNull_intl: Permutation test for the derived scores of each sample

View source: R/permuTest.R

generateNull_intlR Documentation

Permutation test for the derived scores of each sample

Description

This function generates a number of random gene sets that have the same number of genes as the scored gene set. It scores each random gene set and returns a matrix of scores for all samples. The empirical scores are used to calculate the empirical p-values and plot the null distribution. The implementation uses BiocParallel::bplapply() for easy access to parallel backends. Note that one should pass the same values to the upSet, downSet, centerScore and knownDirection arguments as what they provide for the simpleScore() function to generate a proper null distribution.

Usage

generateNull_intl(
  upSet,
  downSet = NULL,
  rankData,
  subSamples = NULL,
  centerScore = TRUE,
  knownDirection = TRUE,
  B = 1000,
  ncores = 1,
  seed = sample.int(1e+06, 1),
  useBPPARAM = NULL
)

Arguments

downSet

A GeneSet object, down regulated gene set

rankData

matrix, outcome of function rankGenes()

centerScore

A Boolean, specifying whether scores should be centered around 0, default as TRUE

knownDirection

A boolean flag, it deterimines whether the scoring method should derive the scores in a directional mannar when the gene signature only contains one set of gene set (passing the gene set via upSet). It is default as TRUE but one can set the argument to be FALSE to derive the score for a single gene set in a undirectional way. This parameter becomes irrelevant when both upSet and downSet are provided.

B

integer, the number of permutation repeats or the number of random gene sets to be generated, default as 1,000

ncores

integer, the number of CPU cores the function can use

seed

integer, set the seed for randomisation

useBPPARAM

the backend the function uses, if NULL is provided, the function uses the default parallel backend which is the first on the list returned by BiocParallel::registered() i.e BiocParallel::registered()[[1]] for your machine. It can be changed explicitly by passing a BPPARAM

Value

A matrix of empirical scores for all samples

Author(s)

Ruqian Lyu

See Also

Post about BiocParallel browseVignettes("BiocParallel")


DavisLaboratory/singscore documentation built on Nov. 21, 2024, 8:17 a.m.