GSEA.GeneRanking: Ranks genes according to the specified ranking metric

Description Usage Details

View source: R/GSEA.GeneRanking.R

Description

'GSEA.GeneRanking' computes the GSEA ranking metric for each gene in the gene list

Usage

1
2
3
GSEA.GeneRanking(A, class.labels, gene.labels, nperm,
  permutation.type = 0, sigma.correction = "GeneCluster",
  fraction = 1, replace = F, reverse.sign = F, rank.metric)

Details

Compute the GSEA ranking metric for each gene in the gene list. Current implementation supports ranking genes by Signal2Noise ratio, or by t-test metric. This function ranks the genes for the actual phenotype and also random permutations and bootstrap subsamples of both the observed and random phenotypes. It uses matrix operations to implement the rank calculations in stages and achieves fast execution speed. It supports two types of permutations: random (unbalanced) and balanced. It also supports subsampling and bootstrap by using masking and multiple-count variables. When 'fraction' is set to 1 (default) the there is no subsampling or boostrapping and the matrix of observed rank metrics will have the same value for all permutations. This is wasteful but allows to support all the multiple options with the same code. Notice that the second matrix for the null distribution will still have the values for the random permutations (null distribution). This mode (fraction = 1.0) is the default, the recommended one and the one used in the examples. It is also the one that has be tested more thoroughly. The resampling and boostrapping options are intersting to obtain smooth estimates of the observed distribution but its is left for the expert user who may want to perform some sanity checks before trusting the code. Inputs: A: Matrix of gene expression values (rows are genes, columns are samples) class.labels: Phenotype of class disticntion of interest. A vector of binary labels having first the 1's and then the 0's gene.labels: gene labels. Vector of probe ids or accession numbers for the rows of the expression matrix nperm: Number of random permutations/bootstraps to perform permutation.type: Permutation type: 0 = unbalanced, 1 = balanced. For experts only (default: 0) sigma.correction: Correction to the signal to noise ratio (Default = GeneCluster, a choice to support the way it was handled in a previous package) fraction: Subsampling fraction. Set to 1.0 (no resampling). For experts only (default: 1.0) replace: Resampling mode (replacement or not replacement). For experts only (default: F) reverse.sign: Reverse direction of gene list (default = F) rank.metric: metric to use for ranking genes, supports "S2N" (signal to noise ratio) which ranks by the difference of means scaled by the standard deviation or "ttest" which ranks by the difference of means scaled by the standard deviation and number of samples Outputs: rnk.matrix: Matrix with random permuted or bootstraps rank metrics signal to noise ratios by default (rows are genes, columns are permutations or bootstrap subsamplings obs.rnk.matrix: Matrix with observed rank metrics (rows are genes, columns are boostraps subsamplings. If fraction is set to 1.0 then all the columns have the same values order.matrix: Matrix with the orderings that will sort the columns of the obs.rnk.matrix in decreasing rnk order obs.order.matrix: Matrix with the orderings that will sort the columns of the rnk.matrix in decreasing rnk order.


GSEA-MSigDB/GSEA_R documentation built on Nov. 30, 2021, 4:50 a.m.