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.51515610  0.1381641782 -0.362865982
#> Lmo1    -1.37271459  0.2373796845 -1.332673595
#> F3       1.30542033  1.1100917761 -0.315494009
#> Cnih3    1.10881834  0.8005185862 -0.731120481
#> Ppp1r3c -1.45820443 -0.7580063132  1.149071652
#> Rims2   -0.71320391  1.4240523360  0.682609295
#> Gfap    -0.54396403 -0.0001271527  1.026893029
#> Gjc3     1.21720754  0.4183747338 -0.151021643
#> Chrna4   0.67819032 -0.1584044840  2.945098704
#> Prkcd    0.11660663  0.0828946056 -0.154675285
#> Prr18   -0.79359049 -0.4162924264 -1.336868154
#> Grb14   -1.67609289  0.4780099112 -0.581065842
#> Tprn    -2.02981069  0.9405363652  0.983957313
#> Clic1    1.13508378 -0.9581794378 -1.255668221
#> Olig2    0.60121642  1.3771568736  1.535580128
#> Hrh3    -0.02335030 -0.4417146773  1.085987839
#> Tmbim1  -1.80868379  0.1637852364  0.571932231
#> Carhsp1  0.15344076  0.2588862012 -1.004001155
#> Tmem88b  0.34731639  0.0623105215 -1.457518653
#> Ugt8a   -0.70172072  0.2618110014  0.890518925
#> Arpp19  -0.25676249 -0.2511373410 -0.103248088
#> Lamp5   -0.84828793  0.2579212016 -0.823708470
#> Galnt6  -1.21429581  0.3549361968 -0.114014299
#> Hlf      0.56566797 -1.0506755007  2.089053693
#> Hs3st2  -0.06277394  0.6445690156  0.002092845
#> Tbr1     0.51466908 -0.7782692772 -1.696173948
#> Myl4     1.25605537 -0.1955024096 -0.105356103
#> Cygb     1.17749260  1.2910426234  0.322027130
#> Ttc9b    0.24858431 -0.1853081126  0.095800040
#> Ipcef1  -0.61133761 -0.9279807497 -0.748998048