rc_test: The Row-Column-Exclusivity or Co-mutation test

Description Usage Arguments Details Examples

View source: R/rc_test.R

Description

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).

Usage

1
2
3
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

1
2
3
library(wext)
set.seed(0)
rc_test(simple_dataset, sample_name, mutated_gene, k = 2, N_perms = 2)

jhrcook/wext documentation built on May 17, 2021, 1:19 a.m.