View source: R/StoreRankings_UCell.R
StoreRankings_UCell | R Documentation |
Given a gene vs. cell matrix, calculates the rankings of expression for all genes in each cell.
StoreRankings_UCell(
matrix,
maxRank = 1500,
chunk.size = 100,
BPPARAM = NULL,
ncores = 1,
assay = "counts",
ties.method = "average",
force.gc = FALSE
)
matrix |
Input matrix, either stored in a SingleCellExperiment object
or as a raw matrix. |
maxRank |
Maximum number of genes to rank per cell; above this rank, a given gene is considered as not expressed |
chunk.size |
Number of cells to be processed simultaneously (lower size requires slightly more computation but reduces memory demands) |
BPPARAM |
A |
ncores |
Number of processors to parallelize computation. If
|
assay |
Assay where the data is to be found (for input in 'sce' format) |
ties.method |
How ranking ties should be resolved - passed on to data.table::frank |
force.gc |
Explicitly call garbage collector to reduce memory footprint |
While ScoreSignatures_UCell
can be used 'on the fly' to
evaluate signatures in a query dataset, it requires recalculating gene
ranks at every execution. If you have a large dataset and plan to experiment
with multiple signatures, evaluating the same dataset multiple times,
this function allows you to store pre-calculated ranks so they do not have to
be recomputed every time. Pre-calculated ranks can then be applied to the
function ScoreSignatures_UCell
to evaluate gene signatures in a
significantly faster way on successive iterations.
Returns a sparse matrix of pre-calculated ranks that can be used multiple times to evaluate different signatures
library(UCell)
data(sample.matrix)
ranks <- StoreRankings_UCell(sample.matrix)
ranks[1:5,1:5]
gene.sets <- list( Tcell_signature = c("CD2","CD3E","CD3D"),
Myeloid_signature = c("SPI1","FCER1G","CSF1R"))
scores <- ScoreSignatures_UCell(features=gene.sets, precalc.ranks=ranks)
head(scores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.