Skip to contents

pct of cells in every cluster that express a series of genelists

Usage

gene_pct_markerm(matrix, marker_m, metadata, cluster_col = NULL, norm = NULL)

Arguments

matrix

expression matrix

marker_m

matrixized markers

metadata

data.frame or vector containing cluster assignments per cell. Order must match column order in supplied matrix. If a data.frame provide the cluster_col parameters.

cluster_col

column in metadata with cluster number

norm

whether and how the results are normalized

Value

matrix of numeric values, clusters from mat as row names, cell types from marker_m as column names

Examples

gene_pct_markerm(
    matrix = pbmc_matrix_small,
    marker_m = cbmc_m,
    metadata = pbmc_meta,
    cluster_col = "classified"
)
#>                   CD4 T       CD8 T Memory CD4 T CD14+ Mono Naive CD4 T
#> Memory CD4 T 0.27122153 0.016563147            0  0.2795031           0
#> B            0.02906977 0.005813953            0  0.2102713           0
#> CD14+ Mono   0.01666667 0.006250000            0  0.9902778           0
#> NK           0.07096774 0.193548387            0  0.2150538           0
#> CD8 T        0.15498155 0.018450185            0  0.2127921           0
#> Naive CD4 T  0.18220947 0.045911047            0  0.2333812           0
#> FCGR3A+ Mono 0.01234568 0.080246914            0  0.7860082           0
#> DC           0.09375000 0.000000000            0  0.6458333           0
#> Platelet     0.07142857 0.000000000            0  0.3571429           0
#>                      NK          B  CD16+ Mono CD34+ Eryth          Mk
#> Memory CD4 T 0.14906832 0.05900621 0.006211180     0     0 0.007591442
#> B            0.06782946 0.89534884 0.002906977     0     0 0.005813953
#> CD14+ Mono   0.11597222 0.04895833 0.004166667     0     0 0.015972222
#> NK           0.96989247 0.03870968 0.012903226     0     0 0.006451613
#> CD8 T        0.70233702 0.02952030 0.000000000     0     0 0.009840098
#> Naive CD4 T  0.09277857 0.03945481 0.004304161     0     0 0.010999522
#> FCGR3A+ Mono 0.17489712 0.06481481 0.370370370     0     0 0.034979424
#> DC           0.23958333 0.09375000 0.031250000     0     0 0.052083333
#> Platelet     0.09523810 0.07142857 0.000000000     0     0 0.904761905
#>                       DC         pDCs
#> Memory CD4 T 0.002070393 0.0013802622
#> B            0.000000000 0.0019379845
#> CD14+ Mono   0.005208333 0.0013888889
#> NK           0.000000000 0.0043010753
#> CD8 T        0.000000000 0.0024600246
#> Naive CD4 T  0.001434720 0.0004782401
#> FCGR3A+ Mono 0.012345679 0.0000000000
#> DC           0.250000000 0.1041666667
#> Platelet     0.000000000 0.0000000000