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.31091163 0.20036664 0.122391764
#> Lmo1 -1.15609418 0.14503245 0.414915504
#> F3 0.87626888 1.44473499 -0.449266651
#> Cnih3 0.64519426 0.28929523 1.194585860
#> Ppp1r3c -2.45450571 -0.11746111 -0.742167598
#> Rims2 0.84690259 0.47249099 -0.477203714
#> Gfap 1.06411528 2.25476414 0.824925307
#> Gjc3 -1.27326164 0.36993922 0.055315812
#> Chrna4 0.88740813 -0.36321106 0.103634360
#> Prkcd 0.95966200 0.70079623 -1.301161158
#> Prr18 -0.45455067 -0.58631122 -0.329938782
#> Grb14 -0.85470527 0.22240216 -0.882945062
#> Tprn 1.63054980 0.73702112 1.467834929
#> Clic1 1.68814116 -0.24251998 -0.777371514
#> Olig2 2.83202325 -0.27874095 -0.125583917
#> Hrh3 0.33457433 0.65731980 0.809700370
#> Tmbim1 0.94781651 0.41060575 -0.886407775
#> Carhsp1 -0.41109244 -1.74331165 -0.210810479
#> Tmem88b -0.85649294 -0.96022345 -0.124433351
#> Ugt8a 0.86424497 0.08002093 -0.405155513
#> Arpp19 -0.52194364 -0.70651552 -1.724825822
#> Lamp5 -0.95384718 -1.20922773 -0.439286388
#> Galnt6 -0.77163539 -1.12710216 0.073506875
#> Hlf 0.17772122 1.65236949 0.875505985
#> Hs3st2 -0.04726448 -0.88368682 1.348081624
#> Tbr1 -0.20108418 -0.34526603 -0.003289201
#> Myl4 0.36974062 0.94386790 -0.997038012
#> Cygb 1.55688676 -0.79361815 0.393942482
#> Ttc9b -0.70229174 -0.21658982 -0.457607751
#> Ipcef1 2.00125964 -1.05701235 -0.071483473