plot_contrib: Plot fragments contributions

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Plot fragments contributions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_contrib(
  df,
  frag_name_col = "full_name",
  contrib_col = "Contribution",
  plot_type = "boxplot",
  FUN = median,
  show_sign_text = NULL,
  show_sep_lines = TRUE,
  flip = TRUE,
  x_labels_angle = 60
)

Arguments

df

input data.frame.

frag_name_col

name of a column with fragments names to plot

contrib_col

name of a column with fragments contribution values

plot_type

maybe "boxplot" or "barplot"

FUN

aggragate function used in barplot (should return named list of outputs with numeric p.value item)

show_sign_text

column name of text represented significance (usually number of asterisks). If NULL no text will be plot.

show_sep_lines

boolean to control of showing grey lines to separate different fragments on a plot

flip

boolean to control the orientation of a plot

x_labels_angle

rorate axis x text labels. It works only if flip was set to TRUE.

Value

ggplot object which can be further modified before printing

Examples

1
2
3
4
5
6
7
file_name <- system.file("extdata", "free-wilson_frag_contributions.txt", package = "rspci")
df <- load_data(file_name)
df <- add_full_names(df)
df <- reorder_data(df, "consensus", "overall")
df <- add_signif(df)
plot_contrib(df)
plot_contrib(df, plot_type = "barplot", flip = FALSE, show_sign_text = "ptext")

DrrDom/rspci documentation built on April 27, 2021, 4:26 a.m.