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
#> 30 x 3 Matrix of class "dgeMatrix"
#>         cell_type1 cell_type2 cell_type3
#> Bcl11b          26          8         15
#> Lmo1            22          9         17
#> F3               9         16         22
#> Cnih3           25         12         10
#> Ppp1r3c         18          5         25
#> Rims2           30          1         24
#> Gfap            21          3         27
#> Gjc3             2         19         26
#> Chrna4          17         25          6
#> Prkcd           20         13         11
#> Prr18            8         17         23
#> Grb14           28         11          9
#> Tprn             7         26         16
#> Clic1            5         22         21
#> Olig2            4         28          2
#> Hrh3             6         23         20
#> Tmbim1          12          6         29
#> Carhsp1          1         24         28
#> Tmem88b         19         21          7
#> Ugt8a           23         14          8
#> Arpp19          13          4         30
#> Lamp5           24         10         14
#> Galnt6          15         30          4
#> Hlf             29          7         13
#> Hs3st2          11         20         18
#> Tbr1            27          2          1
#> Myl4            10         29          3
#> Cygb            16         18         12
#> Ttc9b           14         15         19
#> Ipcef1           3         27          5