plot_CV_distr: Plot CV distribution to compare various steps of the analysis

Description Usage Arguments Value Examples

View source: R/CV_calculation.R

Description

Plot CV distribution to compare various steps of the analysis

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_CV_distr(
  df_long,
  sample_annotation = NULL,
  feature_id_col = "peptide_group_label",
  sample_id_col = "FullRunName",
  measure_col = "Intensity",
  biospecimen_id_col = "EarTag",
  batch_col = NULL,
  unlog = TRUE,
  log_base = 2,
  offset = 1,
  plot_title = NULL,
  filename = NULL,
  theme = "classic"
)

Arguments

df_long

as in df_long for the rest of the package, but, when it has entries for intensity, represented in measure_col for several steps, e.g. raw, normalized, batch corrected data, as seen in column Step, then multi-step CV comparison can be carried out.

sample_annotation

data frame with:

  1. sample_id_col (this can be repeated as row names)

  2. biological covariates

  3. technical covariates (batches etc)

. See help("example_sample_annotation")

feature_id_col

name of the column with feature/gene/peptide/protein ID used in the long format representation df_long. In the wide formatted representation data_matrix this corresponds to the row names.

sample_id_col

name of the column in sample_annotation table, where the filenames (colnames of the data_matrix are found).

measure_col

if df_long is among the parameters, it is the column with expression/abundance/intensity; otherwise, it is used internally for consistency.

biospecimen_id_col

column in sample_annotation that defines a unique bio ID, which is usually a combination of conditions or groups. Tip: if such ID is absent, but can be defined from several columns, create new biospecimen_id column

batch_col

column in sample_annotation that should be used for batch comparison (or other, non-batch factor to be mapped to color in plots).

unlog

(logical) whether to reverse log transformation of the original data

log_base

base of the logarithm for transformation

offset

small positive number to prevent 0 conversion to -Inf

plot_title

title of the plot (e.g., processing step + representation level (fragments, transitions, proteins) + purpose (meanplot/corrplot etc))

filename

path where the results are saved. If null the object is returned to the active window; otherwise, the object is save into the file. Currently only pdf and png format is supported

theme

ggplot theme, by default classic. Can be easily overriden

Value

ggplot object with the boxplot of CVs on one or several steps

Examples

1
2
3
4
CV_plot = plot_CV_distr(example_proteome, 
sample_annotation = example_sample_annotation, 
measure_col = 'Intensity', batch_col = 'MS_batch', 
plot_title = NULL, filename = NULL, theme = 'classic')

proBatch documentation built on Nov. 8, 2020, 4:55 p.m.