plotcomp: Plot extracted components

Description Usage Arguments Examples

Description

Plot extracted components

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_comp_size(hdpsample, legend = TRUE, col_a = "hotpink",
  col_b = "skyblue3", xlab = "Component", ylab = "Number of data items",
  ...)

plot_comp_distn(hdpsample, comp = NULL, cat_names = NULL, grouping = NULL,
  col = "grey70", col_nonsig = NULL, show_group_labels = FALSE,
  cred_int = TRUE, weights = NULL, plot_title = NULL,
  group_label_height = 1.05, cex.cat = 0.7, ...)

plot_dp_comp_exposure(hdpsample, dpindices, col_comp, dpnames = NULL,
  main_text = NULL, incl_numdata_plot = TRUE, incl_nonsig = TRUE,
  incl_comp0 = TRUE, ylab_numdata = "Number of data items",
  ylab_exp = "Component exposure", leg.title = "Component",
  cex.names = 0.6, cex.axis = 0.7, mar = c(1, 4, 2, 0.5), oma = c(1.5,
  1.5, 1, 1), ...)

Arguments

hdpsample

A hdpSampleChain or hdpSampleMulti object including output from hdp_extract_components

legend

Logical - should a legend be included? (default TRUE)

col_a

Color ramp side for early posterior samples (if hdpSampleChain) or first chain (if hdpSampleMulti)

col_b

Color ramp side for late posterior samples (if hdpSampleChain) or last chain (if hdpSampleMulti)

xlab

Horizontal axis label

ylab

Vertical axis label

...

Other arguments to plot

comp

(Optional) Number(s) of the component(s) to plot (from 0 to the max component number). The default is to plot all components.

cat_names

(Optional) Data category names to label the horizontal axis

grouping

(Optional) A factor indicating data category groups.

col

Either a single colour for all data categories, or a vector of colours for each group (in the same order as the levels of the grouping factor)

col_nonsig

(Optional) Colour for any data category whose 95% credibility interval overlaps with zero (if set, overrides col argument)

show_group_labels

Logical - should group labels be added to the top horizontal axis? (default FALSE) (only works if categories alreayd come in orders)

cred_int

Logical - should 95% credibility intervals be plotted? (default TRUE)

weights

(Optional) Weights over the data categories to adjust their relative contribution (multiplicative)

plot_title

(Optional) Character vector of custom plot titles (one for each component plotted)

group_label_height

Multiplicative factor from top of plot for group label placement

cex.cat

Expansion factor for the (optional) cat_names

dpindices

Indices of DP nodes to plot

col_comp

Colours of each component, from 0 to the max number

dpnames

(Optional) Names of the DP nodes

main_text

(Optional) Text at top of plot

incl_numdata_plot

Logical - should an upper barplot indicating the number of data items per DP be included? (Default TRUE)

incl_nonsig

Logical - should components whose credibility intervals include 0 be included (per DP)? (Default TRUE)

incl_comp0

Logical - should component zero be plotted? (Default TRUE)

ylab_numdata

Vertical axis label for numdata plot

ylab_exp

Vertical exis label for exposure plot

leg.title

Legend title

cex.names

Expansion factor for bar labels (dpnames) in exposure plot

cex.axis

Expansion factor for vertical-axis annotation

mar

See ?par

oma

See ?par

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
mut_example_multi <- hdp_extract_components(mut_example_multi)
plot_comp_size(mut_example_multi, bty="L")
bases <- c("A", "C", "G", "T")
trinuc_context <- paste0(rep(rep(bases, times=6), each=4),
                         rep(c("C", "T"), each=48),
                         rep(bases, times=24))
group_factor <- as.factor(rep(c("C>A", "C>G", "C>T", "T>A", "T>C", "T>G"),
                           each=16))
plot_comp_distn(mut_example_multi, cat_names=trinuc_context,
                grouping=group_factor, col=RColorBrewer::brewer.pal(6, "Set2"),
                col_nonsig="grey80", show_group_labels=TRUE)
plot_dp_comp_exposure(mut_example_multi, 5:30,
                      RColorBrewer::brewer.pal(12, "Set3"))
plot_dp_comp_exposure(mut_example_multi, 5:30,
                      RColorBrewer::brewer.pal(12, "Set3"),
                      incl_numdata_plot=FALSE, incl_nonsig=FALSE)

nicolaroberts/hdp documentation built on May 23, 2019, 5:09 p.m.