View source: R/computeMinRank.R
computeMinRank | R Documentation |
Compute the minimum rank in a matrix of statistics, usually effect sizes from a set of differential comparisons.
computeMinRank(x, ties.method = "min", decreasing = TRUE)
x |
A matrix of statistics from multiple differential comparisons (columns) and genes (rows). |
ties.method |
String specifying how ties should be handled. |
decreasing |
Logical scalar indicating whether to obtain ranks for decreasing magnitude of values in |
For each gene, the minimum rank, a.k.a., “min-rank” is defined by ranking values within each column of x
, and then taking the minimum rank value across columns.
This is most useful when the columns of x
contain significance statistics or effect sizes from a single differential comparison, where larger values represent stronger differences.
In this setting, the min-rank represents the highest rank that each gene achieves in any comparison.
Taking all genes with min-ranks less than or equal to T
yields the union of the top T
DE genes from all comparisons.
To illustrate, the set of genes with min-rank values of 1 will contain the top gene from each pairwise comparison to every other cluster.
If we instead take all genes with min-ranks less than or equal to, say, T = 5
, the set will consist of the union of the top 5 genes from each pairwise comparison.
Multiple genes can have the same min-rank as different genes may have the same rank across different pairwise comparisons.
Conversely, the marker set may be smaller than the product of T
and the number of other clusters, as the same gene may be shared across different comparisons.
In the context of marker detection with pairwise comparisons between groups of cells, sorting by the min-rank guarantees the inclusion of genes that can distinguish between any two groups. More specifically, this approach does not explicitly favour genes that are uniquely expressed in a cluster. Rather, it focuses on combinations of genes that - together - drive separation of a cluster from the others. This is more general and robust but tends to yield a less focused marker set compared to the other methods of ranking potential markers.
A numeric vector containing the minimum (i.e., top) rank for each gene across all comparisons.
scoreMarkers
, where this function is used to compute one of the effect size summaries.
combineMarkers
, where the same principle is used for the Top
field.
# Get min-rank by log-FC:
lfcs <- matrix(rnorm(100), ncol=5)
computeMinRank(lfcs)
# Get min-rank by p-value:
pvals <- matrix(runif(100), ncol=5)
computeMinRank(pvals, decreasing=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.