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 1.068182066 -0.13853259 0.75999353
#> Lmo1 2.361464621 2.18603731 -1.75180742
#> F3 -0.785996165 0.38646232 -0.66634178
#> Cnih3 1.729333444 0.43655495 0.39475675
#> Ppp1r3c -1.694198249 -0.57035475 0.37270322
#> Rims2 1.141383501 -1.97902584 0.48687370
#> Gfap 0.726879505 0.43920644 1.20217674
#> Gjc3 0.029480109 0.21566772 -1.46038692
#> Chrna4 0.546886539 -1.19619136 -1.53239558
#> Prkcd 0.479983754 1.32774402 -0.18315175
#> Prr18 0.005258809 1.41514297 0.41949731
#> Grb14 0.110917364 0.74951127 0.47503046
#> Tprn 1.142474742 -1.12524476 -1.46388165
#> Clic1 1.719383004 0.69374584 -0.60716462
#> Olig2 -0.688176101 -0.37482551 0.79407516
#> Hrh3 0.953801506 1.76183498 0.26956404
#> Tmbim1 0.966492680 0.12558816 -0.96763874
#> Carhsp1 1.371811955 -0.59203850 0.58966838
#> Tmem88b -0.377596485 1.00985412 -0.52835512
#> Ugt8a 1.158070869 0.06884724 -0.22502133
#> Arpp19 -0.026400040 0.54450022 0.54491887
#> Lamp5 0.553371247 -0.74034508 1.30973253
#> Galnt6 -0.037302501 -0.74281669 -1.08679789
#> Hlf -0.877947238 -1.38760229 0.48374155
#> Hs3st2 -0.998671076 -1.37454306 -1.14758252
#> Tbr1 0.402367799 -1.14763141 -0.43601935
#> Myl4 -0.281900377 -0.09890926 1.05152160
#> Cygb -1.919209956 1.07320265 -0.56635126
#> Ttc9b -0.374250265 1.97914906 -0.08574765
#> Ipcef1 -0.734514398 -0.01792488 1.56047701