plot_distributions: Plot 1D distributions of variants in cases and controls Plots...

Description Usage Arguments Details Author(s) Examples

View source: R/plot_distributions.r

Description

Plot 1D distributions of variants in cases and controls Plots histogram, density and/or stripchart

Usage

1
2
3
4
5
plot_distributions(
  case_residues,
  control_residues,
  type = c("histogram", "density", "stripchart")
)

Arguments

case_residues

vector of case-variant amino acid residue positions

control_residues

vector of control-variant amino acid residue positions

type

type of plots to plot

Details

The function takes a vector of case and control missense-variant residue positions and plots their linear positions for comparison. If multiple plot types are selected (as is default) then they are stacked on top of each other in one plot.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# The essential inputs are case_residues and control_residues

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_distributions(case_residues, control_residues)

adamwaring/POSBURDEN documentation built on Feb. 21, 2020, 11:21 a.m.