topVarRowIndByMeanBinning: Bin rows by mean expression, and return integer indices of...

View source: R/pca.R

topVarRowIndByMeanBinningR Documentation

Bin rows by mean expression, and return integer indices of rows with the highest variations from each bin

Description

Bin rows by mean expression, and return integer indices of rows with the highest variations from each bin

Usage

topVarRowIndByMeanBinning(matrix, ntop = NULL, nbin = NULL)

Arguments

matrix

A numeric matrix

ntop

Integer, the total number of rows that are expected to be returned

nbin

Integer, how many bins should be formed? If NULL, an automatic value is used.

Value

An integer vector of rows, containing indices

The function first bin rows by their average expression profile, and choose rows with the highest variation from each bin.

Note

In case ntop is not a multiple of nbin, the modulo genes with the loweset variation are removed to garantee that the resulting matrix has exactly ntop rows.

Examples

# myMat <- matrix(rnorm(2000), ncol=10, byrow=FALSE)
# myTopVarMatInd <- topVarRowIndByMeanBinning(myMat, ntop=130, nbin=15)
# myTopVarMatInd2 <- topVarRowIndByMeanBinning(myMat, ntop=135, nbin=15)

bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.