# Load libraries
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 charge percentages
qc_charge_states(
data = data,
sample = sample,
grouping = peptide,
charge_states = charge,
intensity = intensity_non_log2,
method = "intensity",
plot = FALSE
)
# Plot charge states
qc_charge_states(
data = data,
sample = sample,
grouping = peptide,
charge_states = charge,
intensity = intensity_non_log2,
method = "intensity",
plot = TRUE
)
Run the code above in your browser using DataLab