Description Usage Arguments Value Examples
Creates a peptide faceted ggplot2 plot of the value in
measure_col
vs order_col
(if 'NULL', x-axis is simply a sample name order).
Additionally, the resulting plot can also be colored either by batch factor,
by quality factor (e.g. imputated/non-imputed) and, if needed, faceted by
another batch factor, e.g. an instrument.
If the non-linear curve was fit, this can also be added to the plot, see
functions specific to each case below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | plot_single_feature(
feature_name,
df_long,
sample_annotation = NULL,
sample_id_col = "FullRunName",
measure_col = "Intensity",
feature_id_col = "peptide_group_label",
geom = c("point", "line"),
qual_col = NULL,
qual_value = NULL,
batch_col = "MS_batch",
color_by_batch = FALSE,
color_scheme = "brewer",
order_col = "order",
vline_color = "red",
facet_col = NULL,
filename = NULL,
width = NA,
height = NA,
units = c("cm", "in", "mm"),
plot_title = NULL,
theme = "classic",
ylimits = NULL
)
plot_peptides_of_one_protein(
protein_name,
peptide_annotation = NULL,
protein_col = "ProteinName",
df_long,
sample_annotation = NULL,
sample_id_col = "FullRunName",
measure_col = "Intensity",
feature_id_col = "peptide_group_label",
geom = c("point", "line"),
qual_col = NULL,
qual_value = NULL,
batch_col = "MS_batch",
color_by_batch = FALSE,
color_scheme = "brewer",
order_col = "order",
vline_color = "red",
facet_col = NULL,
filename = NULL,
width = NA,
height = NA,
units = c("cm", "in", "mm"),
plot_title = sprintf("Peptides of %s protein", protein_name),
theme = "classic"
)
plot_spike_in(
spike_ins = "BOVIN",
peptide_annotation = NULL,
protein_col = "ProteinName",
df_long,
sample_annotation = NULL,
sample_id_col = "FullRunName",
measure_col = "Intensity",
feature_id_col = "peptide_group_label",
geom = c("point", "line"),
qual_col = NULL,
qual_value = NULL,
batch_col = "MS_batch",
color_by_batch = FALSE,
color_scheme = "brewer",
order_col = "order",
vline_color = "red",
facet_col = NULL,
filename = NULL,
width = NA,
height = NA,
units = c("cm", "in", "mm"),
plot_title = sprintf("Spike-in %s plots", spike_ins),
theme = "classic"
)
plot_iRT(
irt_pattern = "iRT",
peptide_annotation = NULL,
protein_col = "ProteinName",
df_long,
sample_annotation = NULL,
sample_id_col = "FullRunName",
measure_col = "Intensity",
feature_id_col = "peptide_group_label",
geom = c("point", "line"),
qual_col = NULL,
qual_value = NULL,
batch_col = "MS_batch",
color_by_batch = FALSE,
color_scheme = "brewer",
order_col = "order",
vline_color = "red",
facet_col = NULL,
filename = NULL,
width = NA,
height = NA,
units = c("cm", "in", "mm"),
plot_title = "iRT peptide profile",
theme = "classic"
)
plot_with_fitting_curve(
feature_name,
fit_df,
fit_value_col = "fit",
df_long,
sample_annotation = NULL,
sample_id_col = "FullRunName",
measure_col = "Intensity",
feature_id_col = "peptide_group_label",
geom = c("point", "line"),
qual_col = NULL,
qual_value = NULL,
batch_col = "MS_batch",
color_by_batch = FALSE,
color_scheme = "brewer",
order_col = "order",
vline_color = "grey",
facet_col = NULL,
filename = NULL,
width = NA,
height = NA,
units = c("cm", "in", "mm"),
plot_title = sprintf("Fitting curve of %s \n peptide",
paste(feature_name, collapse = " ")),
theme = "classic"
)
|
feature_name |
name of the selected feature (e.g. peptide) for diagnostic profiling |
df_long |
data frame where each row is a single feature in a single
sample. It minimally has a |
sample_annotation |
data frame with:
.
See |
sample_id_col |
name of the column in |
measure_col |
if |
feature_id_col |
name of the column with feature/gene/peptide/protein
ID used in the long format representation |
geom |
whether to show the feature as points and/or connect by lines
(accepted values are: 1. |
qual_col |
column to color point by certain value denoted
by |
qual_value |
value in |
batch_col |
column in |
color_by_batch |
(logical) whether to color points and connecting lines
by batch factor as defined by |
color_scheme |
a named vector of colors to map to |
order_col |
column in |
vline_color |
color of vertical lines, typically separating different MS batches in ordered runs; should be 'NULL' for experiments without intrinsic order |
facet_col |
column in |
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 |
width |
option determining the output image width |
height |
option determining the output image width |
units |
units: 'cm', 'in' or 'mm' |
plot_title |
title of the plot (e.g., processing step + representation level (fragments, transitions, proteins) + purpose (meanplot/corrplot etc)) |
theme |
ggplot theme, by default |
ylimits |
range of y-axis to plot feature-level trends |
protein_name |
name of the protein as defined in |
peptide_annotation |
long format data frame with peptide ID and their
corresponding protein and/or gene annotations.
See |
protein_col |
column where protein names are specified |
spike_ins |
name of feature(s), typically proteins that were spiked in for control |
irt_pattern |
substring used to identify iRT proteins in the column 'ProteinName' |
fit_df |
data frame output of |
fit_value_col |
column in |
ggplot2 type plot of measure_col
vs order_col
,
faceted by feature_name
and (optionally) by batch_col
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | single_feature_plot <- plot_single_feature(feature_name = "46213_NVGVSFYADKPEVTQEQK_2",
df_long = example_proteome, example_sample_annotation,
qual_col = NULL)
#color measurements by factor, related to order (MS_batch)
plot_single_feature(feature_name = "46213_NVGVSFYADKPEVTQEQK_2",
df_long = example_proteome, example_sample_annotation,
qual_col = NULL, color_by_batch = TRUE, batch_col = 'MS_batch')
#color measurements by factor, with order-unrelated factor
single_feature_plot <- plot_single_feature(feature_name = "46213_NVGVSFYADKPEVTQEQK_2",
df_long = example_proteome, example_sample_annotation,
qual_col = NULL, color_by_batch = TRUE, batch_col = 'Diet', geom = 'point',
vline_color = NULL)
#saving the plot
## Not run:
single_feature_plot <- plot_single_feature(feature_name = "46213_NVGVSFYADKPEVTQEQK_2",
df_long = example_proteome, example_sample_annotation,
qual_col = NULL, filename = 'test_peptide.png',
width = 28, height = 18, units = 'cm')
## End(Not run)
#to examine peptides of a single protein:
peptides_of_one_protein_plot <- plot_peptides_of_one_protein (
protein_name = "Haao", peptide_annotation = example_peptide_annotation,
protein_col = "Gene", df_long = example_proteome,
sample_annotation = example_sample_annotation,
order_col = 'order', sample_id_col = 'FullRunName',
batch_col = 'MS_batch')
#saving the peptides of one protein
## Not run:
peptides_of_one_protein_plot <- plot_peptides_of_one_protein (
protein_name = "Haao", peptide_annotation = example_peptide_annotation,
protein_col = "Gene", df_long = example_proteome,
sample_annotation = example_sample_annotation,
order_col = 'order', sample_id_col = 'FullRunName',
batch_col = 'MS_batch',
filename = 'test_protein.png', width = 14, height = 9, units = 'in')
## End(Not run)
#to illustrate spike-ins:
spike_in_plot <- plot_spike_in(spike_ins = "BOVINE_A1ag",
peptide_annotation = example_peptide_annotation, protein_col = 'Gene',
df_long = example_proteome, sample_annotation = example_sample_annotation,
sample_id_col = 'FullRunName',
plot_title = "Spike-in BOVINE protein peptides")
#to illustrate iRT peptides:
irt_plot <- plot_iRT(irt_pattern = "iRT",
peptide_annotation = example_peptide_annotation,
df_long = example_proteome, sample_annotation = example_sample_annotation,
protein_col = 'Gene')
#illustrate the fitting curve:
special_peptide = example_proteome$peptide_group_label == "10231_QDVDVWLWQQEGSSK_2"
loess_fit_70 <- adjust_batch_trend_df(example_proteome[special_peptide,],
example_sample_annotation, span = 0.7)
fitting_curve_plot <- plot_with_fitting_curve(feature_name = "10231_QDVDVWLWQQEGSSK_2",
df_long = example_proteome, sample_annotation = example_sample_annotation,
fit_df = loess_fit_70, plot_title = "Curve fitting with 70% span")
#with curves colored by the corresponding batch:
fitting_curve_plot <- plot_with_fitting_curve(feature_name = "10231_QDVDVWLWQQEGSSK_2",
df_long = example_proteome, sample_annotation = example_sample_annotation,
fit_df = loess_fit_70, plot_title = "Curve fitting with 70% span",
color_by_batch = TRUE, batch_col = 'MS_batch')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.