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.82809337  0.6094647  0.01155014
#> Lmo1    -0.92802232  1.3793833  0.38390247
#> F3       0.08865747 -1.2447195  0.40317424
#> Cnih3   -0.33826693 -0.1478646  0.17944391
#> Ppp1r3c  1.62873751  0.1341808 -1.61682206
#> Rims2   -0.47402744 -0.9310412 -0.38783247
#> Gfap     0.72354700  0.6287824 -1.30788243
#> Gjc3    -0.57837669 -0.5829275  0.60435232
#> Chrna4  -0.07594133  0.3909346  1.05879585
#> Prkcd   -2.13484251 -1.0925441 -0.29511353
#> Prr18   -1.01318158 -1.4581180 -0.17010907
#> Grb14   -1.79546577 -0.6331839 -0.81470804
#> Tprn    -1.87590961 -1.0308228  0.87819400
#> Clic1    1.05718029 -0.3732522  0.31885557
#> Olig2   -0.49451892 -0.6028840  0.10820253
#> Hrh3     1.55694192  1.2082019 -0.31797722
#> Tmbim1  -0.26468830  0.6007774  1.42715658
#> Carhsp1 -0.14252191 -0.6248015 -1.17375628
#> Tmem88b  1.20521482 -1.6458737 -0.62473699
#> Ugt8a   -1.72991589  0.3873096  0.43913143
#> Arpp19   1.52773083  0.7799689 -0.99236141
#> Lamp5   -0.39184058 -0.2853624 -0.01086688
#> Galnt6   0.15821292 -0.4067005 -0.11929519
#> Hlf      0.98637323 -0.4600570  0.47688994
#> Hs3st2  -2.03977194 -0.7850272  0.11406600
#> Tbr1    -0.55554346  1.8275519 -0.39212191
#> Myl4    -0.16278100  2.2894600 -1.24711540
#> Cygb    -3.14345045  0.6995967 -0.34635896
#> Ttc9b    1.57392423 -2.0101668  0.06396644
#> Ipcef1  -0.60460309  2.4741636  0.02431795