# \donttest{
# 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)
)
)
# 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
)
# Plot protein abundance profile
# protein_abundance_plot can be set to
# FALSE to to also colour precursors
peptide_profile_plot(
data = complete_abundances,
sample = sample,
peptide = precursor,
intensity_log2 = intensity,
grouping = protein_id,
targets = c("P1"),
protein_abundance_plot = TRUE
)
# }
Run the code above in your browser using DataLab