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
)
matrix of single-cell RNAseq expression data
vector of cluster ids
how to handle rank ties
if giotto object is given then only genes present in both datasets will be considered
matrix
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 17 12 12
#> Lmo1 22 4 22
#> F3 21 9 17
#> Cnih3 20 7 19
#> Ppp1r3c 19 15 7
#> Rims2 7 23 8
#> Gfap 14 14 13
#> Gjc3 27 25 28
#> Chrna4 8 18 15
#> Prkcd 5 30 6
#> Prr18 25 27 1
#> Grb14 23 13 3
#> Tprn 18 8 25
#> Clic1 9 11 23
#> Olig2 2 16 30
#> Hrh3 6 20 20
#> Tmbim1 15 19 4
#> Carhsp1 26 1 18
#> Tmem88b 12 3 27
#> Ugt8a 16 10 21
#> Arpp19 10 17 11
#> Lamp5 29 24 2
#> Galnt6 28 2 9
#> Hlf 30 26 29
#> Hs3st2 11 21 5
#> Tbr1 4 22 24
#> Myl4 3 28 14
#> Cygb 1 29 16
#> Ttc9b 24 6 10
#> Ipcef1 13 5 26