Function to convert a single-cell count matrix and a corresponding single-cell cluster vector into a rank matrix that can be used with the Rank enrichment option.

makeSignMatrixRank(
  sc_matrix,
  sc_cluster_ids,
  ties_method = c("random", "max"),
  gobject = NULL
)

Arguments

sc_matrix

matrix of single-cell RNAseq expression data

sc_cluster_ids

vector of cluster ids

ties_method

how to handle rank ties

gobject

if giotto object is given then only genes present in both datasets will be considered

Value

matrix

See also

rankEnrich

Examples

sign_gene <- c(
    "Bcl11b", "Lmo1", "F3", "Cnih3", "Ppp1r3c", "Rims2", "Gfap",
    "Gjc3", "Chrna4", "Prkcd", "Prr18", "Grb14", "Tprn", "Clic1", "Olig2",
    "Hrh3", "Tmbim1", "Carhsp1", "Tmem88b", "Ugt8a", "Arpp19", "Lamp5",
    "Galnt6", "Hlf", "Hs3st2", "Tbr1", "Myl4", "Cygb", "Ttc9b", "Ipcef1"
)

sign_matrix <- matrix(rnorm(length(sign_gene) * 3), nrow = length(sign_gene))
rownames(sign_matrix) <- sign_gene
colnames(sign_matrix) <- c("cell_type1", "cell_type2", "cell_type3")

makeSignMatrixRank(
    sc_matrix = sign_matrix,
    sc_cluster_ids = c("cell_type1", "cell_type2", "cell_type3")
)
#> Warning: NaNs produced
#> Warning: NaNs produced
#> 30 x 3 Matrix of class "dgeMatrix"
#>         cell_type1 cell_type2 cell_type3
#> Bcl11b          27          2         23
#> Lmo1            28         29         27
#> F3              13         18         18
#> Cnih3           30         17          4
#> Ppp1r3c         24          8         13
#> Rims2            1         30         30
#> Gfap            19         27          2
#> Gjc3             2         28          1
#> Chrna4           9          9         24
#> Prkcd           16         19         14
#> Prr18            3          1         26
#> Grb14           26          7         15
#> Tprn            15         12         21
#> Clic1           18         21          9
#> Olig2           14         13         20
#> Hrh3            29          3         12
#> Tmbim1          21         16         10
#> Carhsp1          4         10         29
#> Tmem88b         23         23          3
#> Ugt8a            5          6         25
#> Arpp19          22         22          5
#> Lamp5           10         24         11
#> Galnt6          17         14         17
#> Hlf              6         15         22
#> Hs3st2          11          4         28
#> Tbr1             8         25          8
#> Myl4             7         20         16
#> Cygb            20          5         19
#> Ttc9b           12         26          6
#> Ipcef1          25         11          7