Function to convert a single-cell RNAseq matrix into a format
that can be used with runDWLSDeconv
.
makeSignMatrixDWLSfromMatrix(matrix, sign_gene, cell_type_vector)
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")
makeSignMatrixDWLSfromMatrix(
matrix = sign_matrix, sign_gene = sign_gene,
cell_type_vector = c("cell_type1", "cell_type2", "cell_type3")
)
#> cell_type1 cell_type2 cell_type3
#> Bcl11b -0.36492622 -1.76288757 -0.905983614
#> Lmo1 -0.57516527 1.28216226 0.729135590
#> F3 -1.38737744 -1.35071695 -0.600081029
#> Cnih3 0.46183890 0.67407652 -0.114531292
#> Ppp1r3c -0.15938625 -0.06167017 1.905616370
#> Rims2 -1.84502059 1.45798595 1.163705760
#> Gfap 0.52295463 -0.31356092 -1.036468525
#> Gjc3 0.87182537 -1.60161919 -2.302272367
#> Chrna4 -0.11653988 0.19084505 -1.076627504
#> Prkcd -0.50734127 1.40691856 1.320100778
#> Prr18 -0.47805553 1.22091450 -0.216994995
#> Grb14 -0.85839631 -0.29022672 1.803572255
#> Tprn 0.60066153 0.46876818 -0.262717941
#> Clic1 -0.62554821 0.57627995 -0.442510101
#> Olig2 0.56260836 -0.85061249 -1.704407180
#> Hrh3 -0.22911308 -0.62265004 -0.217436233
#> Tmbim1 0.12115279 -0.83638568 -0.154484358
#> Carhsp1 0.12113854 -0.33892601 -0.807510235
#> Tmem88b 0.60429619 0.30366915 -0.387423815
#> Ugt8a 1.41313399 -0.32850836 -0.540870162
#> Arpp19 -1.02602705 -0.77070797 1.264930236
#> Lamp5 -0.08240688 0.54556564 1.388318513
#> Galnt6 -0.75858014 0.66695485 1.689350121
#> Hlf -1.07365103 0.98080280 -2.419962889
#> Hs3st2 -2.20540967 -2.11207943 -0.329864731
#> Tbr1 -0.68287348 1.06264791 -0.699270681
#> Myl4 0.23529974 0.23113068 -0.009544949
#> Cygb -1.94456088 0.56915852 -0.693064189
#> Ttc9b 0.95491163 0.45226822 1.573878523
#> Ipcef1 -0.79270563 0.18696229 -0.544155498