#' a function to do variable selection on expression matrices.
#'
#' This funtino will I.e. remove genes with low variation
#' It returns a vector of row ids to keep. Note, rownames() must be specified.
#'
#' @param exprMat a matrix of expression levels, rows contain genes and columns contain samples.
#' @param removeLowVaryingGenes the proportion of low varying genes to be removed.
#'
#' @return a vector of row ids to keep
doVariableSelection <- function(exprMat, removeLowVaryingGenes)
{
vars <- apply(exprMat, 1, var)
return(order(vars, decreasing=TRUE)[seq(1:as.integer(nrow(exprMat)*(1-removeLowVaryingGenes)))])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.