permuteExplVar: Permute the expression values and retrieve the explained...

View source: R/tab_dimensionreduction.R

permuteExplVarR Documentation

Permute the expression values and retrieve the explained variance

Description

The function permuteExplVar determines the explained variance of the permuted expression matrix (x). It is used to determine the optimal number of PCs for tSNE.

Usage

permuteExplVar(x, n = 10, center = TRUE, scale = TRUE, sample_n = NULL)

Arguments

x

matrix or data.frame, samples in columns and features in rows

n

numeric, number of permutation rounds

center

logical, passed to the function explVar

scale

logical, passed to the function explVar

sample_n

numeric(1), number of features (subset) to be taken for calculation of permuted explained variance, the top sample_n varying values based on their standard deviation will be taken

Details

For the input of tSNE, typically, we want to reduce the initial number of dimensions linearly with PCA (used as the initial_dims arguments in the Rtsne funtion). The reduced data set is used for feeding into tSNE. By plotting the percentage of variance explained by the Princical Components (PCs) we can estimate how many PCs we keep as input into tSNE. However, if we select too many PCs, noise will be included as input to tSNE; if we select too few PCs we might loose the important data structures. To get a better understanding how many PCs to include, randomization will be employed and the observed variance will be compared to the permuted variance.

Value

matrix with explained variance

Author(s)

Thomas Naake

Examples

 
x <- matrix(seq_len(100), nrow = 10, ncol = 10,
    dimnames = list(seq_len(10), paste("sample", seq_len(10))))
permuteExplVar(x = x, n = 10, center = TRUE, scale = TRUE, sample_n = NULL)


tnaake/MatrixQCvis documentation built on July 1, 2024, 10:49 a.m.