burden_test: Carry out a Fisher's exact test

Description Usage Arguments Details Value Author(s) Examples

View source: R/burden_test.r

Description

Burden test with formatting step to make a contingency table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
burden_test(
  n1 = NULL,
  n2 = NULL,
  ss1 = NULL,
  ss2 = NULL,
  pval = T,
  case_coverage = NULL,
  control_coverage = NULL,
  cov_threshold = 0.5,
  alternative = "greater"
)

Arguments

n1

number of carriers cases

n2

number of carriers controls

ss1

sample size cases

ss2

sample size controls

pval

return p-value or full output?

case_coverage

optional coverage data for cases in format: data.table(symbol, protein_position, over_10)

control_coverage

optional coverage data for controls in format: data.table(symbol, protein_position, over_10)

cov_threshold

threshold at which to exclude a residue position from the analysis (choose 0 to keep all residues)

alternative

indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less".

Details

Fisher.test from base R with extra formatting steps.

For a one-sided test i.e. excess in cases, use the default alternative="greater"

if pval=F Use $p for p-value Use $est for odds-ratio Use $conf.int[1:2] for 95

Value

Returns an object of class htest - use $p for p-value

Author(s)

Adam Waring - adam.waring@msdtc.ox.ac.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# For the simple case where you have the vector status (binary case or control) and a vector of whether they
have a variant 'car' (presumably after filtering) then;

N = 100
car = sample(c(0, 1), N, rep=T)
status = sample(c(0, 1), N, rep=T)

burden_test(car, status)

burden_test(n1=10, n2=20, ss1=100, ss2=100)

adamwaring/ClusterBurden documentation built on July 29, 2020, 9:50 p.m.