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.0718209 -0.4065751 -0.86399930
#> Lmo1     0.9238782  1.1723238 -1.56123143
#> F3       0.7311501  1.9259123 -2.60502767
#> Cnih3    1.7851232 -0.1823952 -0.89602760
#> Ppp1r3c  0.2261871  2.4347812  0.37904974
#> Rims2    0.5968079 -0.6353048 -0.05654510
#> Gfap    -0.1652537 -0.2454793 -0.85722358
#> Gjc3     1.2956083  0.6950644  0.77741308
#> Chrna4  -1.0582362  0.8070896 -0.72886697
#> Prkcd    0.3253130  1.8357330 -0.72834256
#> Prr18   -0.8796780  0.4747621  1.42350263
#> Grb14    0.7790034 -1.1351837  0.39383048
#> Tprn     0.4977836  1.2868012  2.57381915
#> Clic1    0.1913683 -0.5414757 -0.07325674
#> Olig2    0.3591223  0.3102250  0.19861549
#> Hrh3     0.2126628  1.9217255  0.07315018
#> Tmbim1   0.1260228 -0.8088575  1.78995977
#> Carhsp1 -0.2178639  1.6546419 -0.62846818
#> Tmem88b -0.2527933  1.0831838  0.33255008
#> Ugt8a    0.9264100  1.4197332 -0.48949742
#> Arpp19  -1.4748461  0.6012553  1.44609771
#> Lamp5    1.6912880  0.5714559  0.13025587
#> Galnt6  -0.2860043  0.7154091 -0.19339160
#> Hlf      1.6092566  0.8245800 -0.16157106
#> Hs3st2   0.4521826  1.4760825  1.13307362
#> Tbr1     0.3974316 -0.2078706  0.93740154
#> Myl4     0.1869443 -1.7721229 -0.86782899
#> Cygb     0.2199893 -1.2015833  0.84200865
#> Ttc9b    1.2135576  1.5249238  0.99936801
#> Ipcef1  -1.5639109 -1.0943758  0.08910988