The Row-Column-Exclusivity or Co-mutation test measures the likelihood of seeing the number of mutually exclusive or co-mutation events between sets of genes of size k given the number of mutations per gene and per sample. By accounting for the number of mutations per sample, this test is more sensitive than using a one-sided Fisher's exact test (for when k=2) or CoMEt (for when k>2).

rc_test(dat, sample_col, mutgene_col, k = 2,
  which_test = c("exclusivity", "comutation"), seed_genes = c(),
  N_perms = 10000, min_mut_events = 2, min_times_mut = 3)

Arguments

dat

tibble with mutation information

sample_col

column of samples names (quoted)

mutgene_col

column of genes that are mutated (quoted)

k

size of gene sets to consider (default is 2)

which_test

test for mutual exclusivity ("exclusivity") or co-mutation ("comutation"); (default is "comutation")

seed_genes

a vector of gene(s) that must be in the gene set to be tested (optional)

N_perms

number of permutation matrices to use (default is 10,000)

min_mut_events

minimum number of real mutual exclusive events required to consider the gene set (default is 2)

min_times_mut

minimum number of times a gene must be mutated in all samples to be considered for the gene sets (default is 5)

Details

This test cannot be calculated exactly for most use cases because there is no closed formula and a very large number of possible matrices to consider. Thus, the probabilities are calculated empirically from a sufficiently large number of samples of possible matrices.

Examples

library(wext) set.seed(0) rc_test(simple_dataset, sample_name, mutated_gene, k = 2, N_perms = 2)
#> # A tibble: 5 x 4 #> gene_sets t_BM_ge t_AM p_val #> <list> <dbl> <dbl> <dbl> #> 1 <chr [2]> 2 7 1 #> 2 <chr [2]> 1 7 0.5 #> 3 <chr [2]> 0 12 0 #> 4 <chr [2]> 1 9 0.5 #> 5 <chr [2]> 0 9 0