Function to convert a single-cell RNAseq matrix into a format that can be used with runDWLSDeconv.

makeSignMatrixDWLSfromMatrix(matrix, sign_gene, cell_type_vector)

Arguments

matrix

scRNA-seq matrix

sign_gene

genes to use (e.g. marker genes)

cell_type_vector

vector with cell types (length = ncol(matrix))

Value

matrix

See also

Examples

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.40236780 -1.14763141 -0.43601935
#> Lmo1    -0.28190038 -0.09890926  1.05152160
#> F3      -1.91920996  1.07320265 -0.56635126
#> Cnih3   -0.37425026  1.97914906 -0.08574765
#> Ppp1r3c -0.73451440 -0.01792488  1.56047701
#> Rims2   -0.13853259  0.75999353  0.08823325
#> Gfap     2.18603731 -1.75180742  1.01833281
#> Gjc3     0.38646232 -0.66634178 -0.76663924
#> Chrna4   0.43655495  0.39475675 -1.24244926
#> Prkcd   -0.57035475  0.37270322  1.80315264
#> Prr18   -1.97902584  0.48687370  0.01066176
#> Grb14    0.43920644  1.20217674  0.64581753
#> Tprn     0.21566772 -1.46038692 -0.05382336
#> Clic1   -1.19619136 -1.53239558 -0.48940157
#> Olig2    1.32774402 -0.18315175 -0.74365693
#> Hrh3     1.41514297  0.41949731 -0.19542704
#> Tmbim1   0.74951127  0.47503046 -0.62226895
#> Carhsp1 -1.12524476 -1.46388165 -1.79877738
#> Tmem88b  0.69374584 -0.60716462 -2.22018550
#> Ugt8a   -0.37482551  0.79407516 -1.41163658
#> Arpp19   1.76183498  0.26956404 -0.20562544
#> Lamp5    0.12558816 -0.96763874 -1.21478205
#> Galnt6  -0.59203850  0.58966838  0.88592759
#> Hlf      1.00985412 -0.52835512  0.11037987
#> Hs3st2   0.06884724 -0.22502133  0.19964012
#> Tbr1     0.54450022  0.54491887  1.20091035
#> Myl4    -0.74034508  1.30973253 -0.62971719
#> Cygb    -0.74281669 -1.08679789  0.34248308
#> Ttc9b   -1.38760229  0.48374155  0.71014552
#> Ipcef1  -1.37454306 -1.14758252 -0.33480466