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.56992045  0.29307746  0.555992205
#> Lmo1    -0.80585001  0.11645660 -0.766449970
#> F3       0.53756104  1.39241621  0.708119251
#> Cnih3   -0.84503166 -1.86992624 -2.537101353
#> Ppp1r3c  0.09330267  0.09945291 -0.075427710
#> Rims2   -1.20021308 -0.55546580  0.835951942
#> Gfap    -0.13126393 -0.75943555 -0.469179030
#> Gjc3    -0.74803148  2.15965508  0.131507054
#> Chrna4  -1.52032598 -0.34392918 -0.982705358
#> Prkcd   -0.77093129 -0.63050463 -1.468190789
#> Prr18    0.62591898  0.06084753  0.464660900
#> Grb14   -0.46917174 -0.04359839 -1.028170272
#> Tprn     0.80520109  0.92470932 -1.315546199
#> Clic1   -0.92384306  0.17463695 -0.644857340
#> Olig2   -0.39879151  0.03420008  0.061241894
#> Hrh3    -1.87177428 -0.48971746 -1.305434880
#> Tmbim1   0.96800231 -1.40109460 -0.457142768
#> Carhsp1  1.32853550  1.57147714 -0.451734796
#> Tmem88b -0.57812773  0.49844981 -0.007104819
#> Ugt8a    0.40555717 -1.18852241 -1.756994153
#> Arpp19  -0.84953070 -0.28332963 -0.456437301
#> Lamp5   -0.57736633  0.34486094 -0.537010307
#> Galnt6   0.83555008 -1.23931987 -2.065714288
#> Hlf      0.02173591 -0.64477783  0.812170853
#> Hs3st2   1.08786959  0.64529216 -0.600358611
#> Tbr1     0.95090991  0.66740564 -1.583274792
#> Myl4     0.02707875  0.33613678  0.386137860
#> Cygb    -1.75036248 -0.97595082 -1.420719099
#> Ttc9b    0.46611472  0.94651563 -1.176271059
#> Ipcef1  -0.07874866  1.20483494 -0.901575885