View source: R/qc_missed_cleavages.R
qc_missed_cleavages | R Documentation |
Calculates the percentage of missed cleavages for each sample (by count or intensity). The default settings remove grouping variables without quantitative information (intensity is NA). These will not be used for the calculation of missed cleavage percentages.
qc_missed_cleavages(
data,
sample,
grouping,
missed_cleavages,
intensity,
remove_na_intensities = TRUE,
method = "count",
plot = FALSE,
interactive = FALSE
)
data |
a data frame containing at least sample names, peptide or precursor identifiers and missed cleavage counts for each peptide or precursor. |
sample |
a character or factor column in the |
grouping |
a character column in the |
missed_cleavages |
a numeric column in the |
intensity |
a numeric column in the |
remove_na_intensities |
a logical value that specifies if sample/grouping combinations with intensities that are NA (not quantified IDs) should be dropped from the data frame for analysis of missed cleavages. Default is TRUE since we are usually interested in quantifiable peptides. This is only relevant for method = "count". |
method |
a character value that indicates the method used for evaluation. "count" calculates the percentage of missed cleavages based on counts of the corresponding peptide or precursor, "intensity" calculates the percentage of missed cleavages by intensity of the corresponding peptide or precursor. |
plot |
a logical value that indicates whether the result should be plotted. |
interactive |
a logical value that specifies whether the plot should be interactive (default is FALSE). |
A data frame that contains the calculated percentage made up by the sum of all peptides or precursors containing the corresponding amount of missed cleavages.
library(dplyr)
set.seed(123) # Makes example reproducible
# Create example data
data <- create_synthetic_data(
n_proteins = 100,
frac_change = 0.05,
n_replicates = 3,
n_conditions = 2,
method = "effect_random"
) %>%
mutate(intensity_non_log2 = 2^peptide_intensity_missing)
# Calculate missed cleavage percentages
qc_missed_cleavages(
data = data,
sample = sample,
grouping = peptide,
missed_cleavages = n_missed_cleavage,
intensity = intensity_non_log2,
method = "intensity",
plot = FALSE
)
# Plot missed cleavages
qc_missed_cleavages(
data = data,
sample = sample,
grouping = peptide,
missed_cleavages = n_missed_cleavage,
intensity = intensity_non_log2,
method = "intensity",
plot = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.