plot_distribs: Plot the distributions of case and control variant residues

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot_distribs.r

Description

Plot the distributions of case and control variant residues

Usage

1
2
3
4
5
6
7
plot_distribs(
  case_residues,
  control_residues,
  case_coverage = NULL,
  control_coverage = NULL,
  cov_threshold = 0.5
)

Arguments

case_residues

vector of case variant residue positions

control_residues

vector of control variant residue positions

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 a residue position is excluded from the analysis

Details

Produces a stripchart using geom_jitter for both cases and controls as well as a gaussian density line for each cohort. If coverage files are provided then these are included as a rug underneath and above the case and control variants and are colored by their coverage level (< cov_threshold, < 80

Value

Returns a ggplot object

Author(s)

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

Examples

1
2
3
4
5
6
7
8
9
nresidues = 1000 # length of the protein
probs = rexp(nresidues)^2
case_probs = probs * rep(c(1, 3, 1), c(200, 200, 600))
control_probs = probs * rep(c(2, 1, 2), c(200, 200, 600))

case_residues = sample(1:nresidues, 100, rep=T, case_probs)
control_residues = sample(1:nresidues, 100, rep=T, control_probs)

plot_distribs(case_residues, control_residues)

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