AUCell_buildRankings {AUCell} | R Documentation

## Build gene expression rankings for each cell

### Description

Builds the "rankings" for each cell: expression-based ranking for all the genes in each cell.

The genes with same expression value are shuffled. Therefore, genes with expression '0' are randomly sorted at the end of the ranking.

These "rankings" can be seen as a new representation of the original dataset. Once they are calculated, they can be saved for future analyses.

### Usage

    AUCell_buildRankings(
      exprMat,
      plotStats = TRUE,
      nCores = 1,
      mctype = c("domc")[1],
      keepZeroesAsNA = FALSE,
      verbose = TRUE,
      ...
    )

    ## S4 method for signature 'matrix'
    AUCell_buildRankings(
      exprMat,
      plotStats = TRUE,
      nCores = 1,
      mctype = c("domc")[1],
      keepZeroesAsNA = FALSE,
      verbose = TRUE
    )

    ## S4 method for signature 'dgCMatrix'
    AUCell_buildRankings(
      exprMat,
      plotStats = TRUE,
      nCores = 1,
      mctype = c("domc")[1],
      keepZeroesAsNA = FALSE,
      verbose = TRUE
    )

    ## S4 method for signature 'SummarizedExperiment'
    AUCell_buildRankings(
      exprMat,
      plotStats = TRUE,
      nCores = 1,
      mctype = c("domc")[1],
      keepZeroesAsNA = FALSE,
      verbose = TRUE,
      assayName = NULL
    )

    ## S4 method for signature 'ExpressionSet'
    AUCell_buildRankings(
      exprMat,
      plotStats = TRUE,
      nCores = 1,
      mctype = c("domc")[1],
      keepZeroesAsNA = FALSE,
      verbose = TRUE
    )

### Arguments

`exprMat` | Expression matrix (genes as rows, cells as columns) The expression matrix can also be provided as one of the Bioconductor classes: RangedSummarizedExperiment and derived classes (e.g. SingleCellExperiment ): The matrix will be obtained through assay(exprMatrix), -which will extract the first assay (usually the counts)- or the assay name given in 'assayName' dgCMatrix-class: Sparse matrix `ExpressionSet`: The matrix will be obtained through exprs(exprMatrix)
`plotStats` | Should the function plot the expression boxplots/histograms? (TRUE / FALSE). These plots can also be produced with the function `plotGeneCount`.
`nCores` | Number of cores to use for computation.
`mctype` | Experimental feature (use at your own risk): Alternative methods to run the parallel compuations (e.g. through different packages)
`keepZeroesAsNA` | Experimental feature (use at your own risk): convert zeroes to NA instead of locating randomly at the end of the ranking.
`verbose` | Should the function show progress messages? (TRUE / FALSE)
`...` | Other arguments
`assayName` | Name of the assay containing the expression matrix (e.g. in SingleCellExperiment objects)

### Details

It is important to check that most cells have at least the number of expressed/detected genes that are going to be used to calculate the AUC ('aucMaxRank' in 'calcAUC()'). The histogram provided by 'AUCell_buildRankings()' allows to quickly check this distribution. 'plotGeneCount(exprMatrix)' allows to obtain only the plot before building the rankings.

### Value

data.table of genes (row) by cells (columns) with the ranking of the gene within the cell.

### See Also

Next step in the workflow: `AUCell_calcAUC`.

See the package vignette for examples and more details: `vignette("AUCell")`

### Examples

    # This example is run using a fake expression matrix.
    # Therefore, the output will be meaningless.

    ############# Fake expression matrix #############
    set.seed(123)
    exprMatrix <- matrix(data=sample(c(rep(0, 5000), sample(1:3, 5000, replace=TRUE))),
                         nrow=20,
                         dimnames=list(paste("Gene", 1:20, sep=""),
                                       paste("Cell", 1:500, sep="")))
    ##################################################

    cells_rankings <- AUCell_buildRankings(exprMatrix, plotStats=TRUE)
    cells_rankings

[Package AUCell version 1.9.8 Index]