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  -1.99843344  0.27818108  0.538925791
#> Lmo1     0.79968424 -1.48070267 -2.423133101
#> F3       0.06866016 -0.46287736  0.208927567
#> Cnih3   -0.30803903  1.92692688  0.742882562
#> Ppp1r3c  0.71386479  0.29898916  0.261874114
#> Rims2   -0.29014298  0.69446539 -1.014462331
#> Gfap     0.27870986 -0.82859781  3.165906417
#> Gjc3    -0.66611380 -1.96983728 -2.220897864
#> Chrna4  -1.16856256 -1.46363099  0.706321426
#> Prkcd    1.49004958  0.51833303 -0.713366039
#> Prr18   -0.88544651 -0.63951653  0.114430178
#> Grb14    0.57355458 -0.56371054  1.546379354
#> Tprn    -0.12988125  0.50064625 -1.180491672
#> Clic1    0.13818011  0.77303082 -0.189692431
#> Olig2    0.03912236 -0.05685780  0.221436012
#> Hrh3     0.45732717  0.39256061 -0.387465949
#> Tmbim1  -1.68196131  0.93609436  0.886789712
#> Carhsp1  1.42660126 -1.88565333 -2.007619970
#> Tmem88b -0.52968397 -0.85992672 -0.007769513
#> Ugt8a    1.26078314  0.02163123 -0.234023133
#> Arpp19  -0.67044898  1.17568753  0.558736658
#> Lamp5    1.29447923  0.30336215 -0.566646775
#> Galnt6   0.38567420  0.35247676 -0.597994702
#> Hlf     -0.19662941  1.65162094  0.229090291
#> Hs3st2   1.39803932 -0.87284027  0.116414760
#> Tbr1    -1.09396555 -2.10039004  0.485777214
#> Myl4     0.17695276 -2.08460533 -0.251071075
#> Cygb     0.34402059 -0.43970714 -0.111357388
#> Ttc9b    1.97273596 -1.54719659  0.109337283
#> Ipcef1   0.05707011  0.40825666  1.072446804