rankGenes.Rd
The rankGenes
function is a generic function that can deal
with mutilple types of inputs. Given a matrix of gene expression that has
samples in columns, genes in rows, and values being gene expression
intensity,rankGenes
ranks gene expression intensities in each sample.
It can also work with S4 objects that have gene expression matrix as a
component (i.e ExpressionSet, DGEList,SummarizedExperiment). It calls the
rank
function in the base package which ranks the gene expression
matrix by its absolute expression level. If the input is S4 object of
DGEList, ExpressionSet, or SummarizedExperiment
, it will extract the
gene expression matrix from the object and rank the genes. The default
'tiesMethod' is set to 'min'.
rankGenes(expreMatrix, tiesMethod = "min") # S4 method for matrix rankGenes(expreMatrix, tiesMethod = "min") # S4 method for data.frame rankGenes(expreMatrix, tiesMethod = "min") # S4 method for DGEList rankGenes(expreMatrix, tiesMethod = "min") # S4 method for ExpressionSet rankGenes(expreMatrix, tiesMethod = "min") # S4 method for SummarizedExperiment rankGenes(expreMatrix, tiesMethod = "min")
expreMatrix | A gene expression matrix (matrix,data.frame) or S4 object (ExpressionSet,DGEList, SummarizedExperiment) |
---|---|
tiesMethod | A character indicating what method to use when dealing with ties |
The ranked gene expression matrix that has samples in columns and genes in rows
rank
ExpressionSet
SummarizedExperiment
DGEList
rankGenes(toy_expr_se) # toy_expr_se is a gene expression dataset#> D_Ctrl_R1 D_TGFb_R1 #> 2 2 2 #> 9 13 12 #> 10 4 5 #> 12 10 8 #> 13 8 7 #> 14 18 18 #> 15 3 1 #> 16 20 20 #> 18 6 10 #> 19 14 14 #> 20 9 9 #> 21 11 11 #> 22 17 16 #> 23 19 19 #> 24 5 4 #> 25 16 17 #> 26 1 3 #> 27 12 13 #> 28 7 6 #> 29 15 15tiesMethod = 'min' # get counts from toy_expr_se counts <- SummarizedExperiment::assay(toy_expr_se) # or it can be a ExpressionSet object e <- Biobase::ExpressionSet(assayData = as.matrix(counts)) rankGenes(e)#> D_Ctrl_R1 D_TGFb_R1 #> 2 2 2 #> 9 13 12 #> 10 4 5 #> 12 10 8 #> 13 8 7 #> 14 18 18 #> 15 3 1 #> 16 20 20 #> 18 6 10 #> 19 14 14 #> 20 9 9 #> 21 11 11 #> 22 17 16 #> 23 19 19 #> 24 5 4 #> 25 16 17 #> 26 1 3 #> 27 12 13 #> 28 7 6 #> 29 15 15