data: a data frame that contains at least the input variables.
sample: a character or factor column in the data data frame that contains the sample name.
grouping: a character column in the data data frame that contains either precursor or peptide identifiers.
intensity: a numeric column in the data data frame that contains intensity values. The intensity should be ideally log2 transformed, but also non-transformed values can be used.
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).
Returns
A plot that displays median intensity over all samples. If plot = FALSE a data frame containing median intensities is returned.
Examples
set.seed(123)# Makes example reproducible# Create example datadata <- create_synthetic_data( n_proteins =100, frac_change =0.05, n_replicates =3, n_conditions =2, method ="effect_random")# Calculate median intensitiesqc_median_intensities( data = data, sample = sample, grouping = peptide, intensity = peptide_intensity_missing, plot =FALSE)# Plot median intensitiesqc_median_intensities( data = data, sample = sample, grouping = peptide, intensity = peptide_intensity_missing, plot =TRUE)