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.8238382 0.61704482 1.22553453
#> Lmo1 -0.1349218 -0.69131863 0.20173921
#> F3 -0.7959346 -0.99288074 -0.46447342
#> Cnih3 0.4281197 -0.99967681 -2.04136387
#> Ppp1r3c 1.2039203 0.35993496 0.71876924
#> Rims2 1.6401921 -1.29307696 -1.51673819
#> Gfap 1.8171074 -1.20099430 0.47282530
#> Gjc3 0.1629464 0.68692357 1.36536590
#> Chrna4 0.8093333 -0.08618519 -0.08165745
#> Prkcd -0.1641177 1.23291124 -0.03101319
#> Prr18 0.4821334 0.66117954 0.83201844
#> Grb14 1.3028753 -0.60756312 -0.77213576
#> Tprn -1.3830808 0.81815801 -0.76483617
#> Clic1 -1.3328310 0.47074487 -0.12474830
#> Olig2 -2.1522721 -0.56739305 -0.23013025
#> Hrh3 0.3595989 -0.64760874 -0.68304060
#> Tmbim1 -0.7120629 1.18755929 -1.66018744
#> Carhsp1 0.7595427 1.29613370 1.94457303
#> Tmem88b -0.3048478 0.80475188 -1.69380616
#> Ugt8a -0.3790739 1.93586406 -0.04246824
#> Arpp19 0.5250832 -0.07853379 0.23483831
#> Lamp5 0.3373262 0.33003953 -0.78180268
#> Galnt6 1.1568725 -0.37853437 2.02219747
#> Hlf 0.7236919 0.07204898 0.06399838
#> Hs3st2 1.7543239 2.79683496 0.62673856
#> Tbr1 0.4543554 -0.12795061 0.52247349
#> Myl4 -1.2208226 -1.63717633 0.49065762
#> Cygb 0.6999679 -0.18816551 -1.15834089
#> Ttc9b -1.1161517 1.68410097 1.98572787
#> Ipcef1 -2.3472564 -1.67428133 -0.51518959