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.64257407  0.90291727  0.02982167
#> Lmo1     2.02928247 -0.81955398 -0.77565402
#> F3       0.24360567 -0.95983883 -0.22814752
#> Cnih3   -2.35833666 -0.47480058 -0.76710650
#> Ppp1r3c -1.00645782  0.53929337 -1.11617280
#> Rims2    0.67346027 -0.45319591 -1.24755320
#> Gfap     1.29235280  0.44509654  0.83254377
#> Gjc3     0.35618189 -0.84227927  0.30207156
#> Chrna4   0.65555144  0.42305442 -0.16425900
#> Prkcd    1.01485045 -0.61068476 -0.47329667
#> Prr18   -0.58862234 -1.59440717 -0.53683976
#> Grb14   -1.62067143 -0.47307136 -0.91952542
#> Tprn     0.04751469 -1.30061850 -0.04908513
#> Clic1    0.41265615 -0.11167877 -1.20330111
#> Olig2    1.13074690 -0.85096053  1.19473790
#> Hrh3     0.30106074 -0.93295206 -0.14523127
#> Tmbim1   0.93029226 -0.53460649 -0.47618742
#> Carhsp1  0.25679344  0.55789258  0.70669714
#> Tmem88b  0.90211498  1.41349017 -0.61837738
#> Ugt8a    0.74393878  0.83334830 -0.33495243
#> Arpp19  -0.19743101 -1.63099107 -0.45806234
#> Lamp5   -1.49194895  0.71657799 -1.15262324
#> Galnt6  -0.67613389  0.81195379 -0.32099219
#> Hlf     -0.81197767  1.33243058  0.09848058
#> Hs3st2  -2.00073772 -1.90780613  0.07321805
#> Tbr1     0.68826832  0.98222701 -0.66243628
#> Myl4    -0.02155129 -0.09247253 -0.77793802
#> Cygb    -0.48591156  1.08716987 -1.83601415
#> Ttc9b    0.02259776  0.49534079 -0.37544750
#> Ipcef1   1.11456689 -0.30432444 -0.75422518