calculate_protein_abundance {protti} | R Documentation |
Label-free protein quantification
Description
Determines relative protein abundances from ion quantification. Only proteins with at least three peptides are considered for quantification. The three peptide rule applies for each sample independently.
Usage
calculate_protein_abundance(
data,
sample,
protein_id,
precursor,
peptide,
intensity_log2,
min_n_peptides = 3,
method = "sum",
for_plot = FALSE,
retain_columns = NULL
)
Arguments
data |
a data frame that contains at least the input variables. |
sample |
a character column in the |
protein_id |
a character column in the |
precursor |
a character column in the |
peptide |
a character column in the |
intensity_log2 |
a numeric column in the |
min_n_peptides |
An integer specifying the minimum number of peptides required for a protein to be included in the analysis. The default value is 3, which means proteins with fewer than three unique peptides will be excluded from the analysis. |
method |
a character value specifying with which method protein quantities should be
calculated. Possible options include |
for_plot |
a logical value indicating whether the result should be only protein intensities
or protein intensities together with precursor intensities that can be used for plotting using
|
retain_columns |
a vector indicating if certain columns should be retained from the input
data frame. Default is not retaining additional columns |
Value
If for_plot = FALSE
, protein abundances are returned, if for_plot = TRUE
also precursor intensities are returned in a data frame. The later output is ideal for plotting
with peptide_profile_plot()
and can be filtered to only include protein abundances.
Examples
# Create example data
data <- data.frame(
sample = c(
rep("S1", 6),
rep("S2", 6),
rep("S1", 2),
rep("S2", 2)
),
protein_id = c(
rep("P1", 12),
rep("P2", 4)
),
precursor = c(
rep(c("A1", "A2", "B1", "B2", "C1", "D1"), 2),
rep(c("E1", "F1"), 2)
),
peptide = c(
rep(c("A", "A", "B", "B", "C", "D"), 2),
rep(c("E", "F"), 2)
),
intensity = c(
rnorm(n = 6, mean = 15, sd = 2),
rnorm(n = 6, mean = 21, sd = 1),
rnorm(n = 2, mean = 15, sd = 1),
rnorm(n = 2, mean = 15, sd = 2)
)
)
data
# Calculate protein abundances
protein_abundance <- calculate_protein_abundance(
data,
sample = sample,
protein_id = protein_id,
precursor = precursor,
peptide = peptide,
intensity_log2 = intensity,
method = "sum",
for_plot = FALSE
)
protein_abundance
# Calculate protein abundances and retain precursor
# abundances that can be used in a peptide profile plot
complete_abundances <- calculate_protein_abundance(
data,
sample = sample,
protein_id = protein_id,
precursor = precursor,
peptide = peptide,
intensity_log2 = intensity,
method = "sum",
for_plot = TRUE
)
complete_abundances