Description Usage Arguments Details Value Author(s) Examples
View source: R/plot_distribs.r
Plot the distributions of case and control variant residues
1 2 3 4 5 6 7 | plot_distribs(
case_residues,
control_residues,
case_coverage = NULL,
control_coverage = NULL,
cov_threshold = 0.5
)
|
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 |
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
Returns a ggplot object
Adam Waring - adam.waring@msdtc.ox.ac.uk
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.