Calculate adjusted p-values for hypergeometric test of gene lists or jaccard index
Source:R/compare_genelist.R
compare_lists.Rd
Calculate adjusted p-values for hypergeometric test of gene lists or jaccard index
Usage
compare_lists(
bin_mat,
marker_mat,
n = 30000,
metric = "hyper",
output_high = TRUE,
details_out = FALSE
)
Arguments
- bin_mat
binarized single-cell expression matrix, feed in by_cluster mat, if desired
- marker_mat
matrix or dataframe of candidate genes for each cluster
- n
number of genes in the genome
- metric
adjusted p-value for hypergeometric test, or jaccard index
- output_high
if true (by default to fit with rest of package), -log10 transform p-value
- details_out
whether to also output shared gene list from jaccard
Value
matrix of numeric values, clusters from expr_mat as row names, cell types from marker_mat as column names
Examples
pbmc_mm <- matrixize_markers(pbmc_markers)
pbmc_avg <- average_clusters(
pbmc_matrix_small,
pbmc_meta,
cluster_col = "classified"
)
pbmc_avgb <- binarize_expr(pbmc_avg)
compare_lists(
pbmc_avgb,
pbmc_mm,
metric = "spearman"
)
#> list of markers instead of matrix, only supports jaccard
#> 0 1 2 3 4 5 6 7 8
#> Naive CD4 T 1090 818 124 706 712 20 298 318 48
#> Memory CD4 T 1090 818 122 706 706 0 276 368 54
#> CD14+ Mono 1090 776 68 774 576 170 246 338 40
#> B 1096 772 128 864 596 18 232 404 90
#> CD8 T 1090 808 34 754 758 78 478 434 126
#> FCGR3A+ Mono 1090 792 76 776 540 150 240 284 100
#> NK 1090 798 72 706 758 22 514 380 98
#> DC 1090 792 62 806 644 182 334 506 130
#> Platelet 1094 816 72 816 606 158 296 316 194