Performs the correction of LiP-peptides for changes in protein abundance and calculates their significance using a t-test. This function was implemented based on the MSstatsLiP
lip_data: a data frame containing at least the input variables. Ideally, the result from the calculate_diff_abundance function is used.
trp_data: a data frame containing at least the input variables minus the grouping column. Ideally, the result from the calculate_diff_abundance function is used.
protein_id: a character column in the lip_data and trp_data data frames that contains protein identifiers.
grouping: a character column in the lip_data data frame that contains precursor or peptide identifiers.
comparison: a character column in the lip_data and trp_data data frames that contains the comparisons between conditions.
diff: a numeric column in the lip_data and trp_data data frames that contains log2-fold changes for peptide or protein quantities.
n_obs: a numeric column in the lip_data and trp_data data frames containing the number of observations used to calculate fold changes.
std_error: a numeric column in the lip_data and trp_data data frames containing the standard error of fold changes.
p_adj_method: a character value, specifies the p-value correction method. Possible methods are c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). Default method is "BH".
retain_columns: a vector indicating if certain columns should be retained from the input data frame. Default is not retaining additional columns retain_columns = NULL. Specific columns can be retained by providing their names (not in quotations marks, just like other column names, but in a vector). Please note that if you retain columns that have multiple rows per grouped variable there will be duplicated rows in the output.
method: a character value, specifies the method used to estimate the degrees of freedom. Possible methods are c("satterthwaite", "no_df_approximation"). satterthwaite uses the Welch-Satterthwaite equation to estimate the pooled degrees of freedom, as described in https://doi.org/10.1016/j.mcpro.2022.100477 and implemented in the MSstatsLiP package. This approach respects the number of protein measurements for the degrees of freedom. no_df_approximation just takes the number of peptides into account when calculating the degrees of freedom.
Returns
a data frame containing corrected differential abundances (adj_diff, adjusted standard errors (adj_std_error), degrees of freedom (df), pvalues (pval) and adjusted p-values (adj_pval)