ContrastsProDA: ContrastsProDA Wrapper to results produced by proDA

ContrastsProDAR Documentation

ContrastsProDA Wrapper to results produced by proDA

Description

ContrastsProDA Wrapper to results produced by proDA

ContrastsProDA Wrapper to results produced by proDA

Super class

prolfqua::ContrastsInterface -> ContrastsProDA

Public fields

contrast_result

contrast result

modelName

model name

subject_Id

columns with protein ID's

contrasts

named vector of length 1.

Methods

Public methods

Inherited methods

Method new()

initialize

Usage
ContrastsProDA$new(
  contrastsdf,
  contrasts,
  subject_Id = "name",
  modelName = "ContrastProDA"
)
Arguments
contrastsdf

data.frame returned by proDA

contrasts

contrasts

subject_Id

column name with protein ID's

modelName

name of model default value ContrastProDA


Method get_contrast_sides()

show names of contrasts

Usage
ContrastsProDA$get_contrast_sides()
Returns

data.frame


Method get_linfct()

get linear function used to determine contrasts

Usage
ContrastsProDA$get_linfct()
Returns

data.frame


Method get_contrasts()

get contrasts

Usage
ContrastsProDA$get_contrasts(all = FALSE)
Arguments
all

(default FALSE)


Method get_Plotter()

get Contrast_Plotter

Usage
ContrastsProDA$get_Plotter(
  fcthreshold = 1,
  fdrthreshold = 0.1,
  tstatthreshold = 5
)
Arguments
fcthreshold

fold change threshold to show

fdrthreshold

FDR threshold

tstatthreshold

t statistics threshold


Method to_wide()

convert to wide format

Usage
ContrastsProDA$to_wide(columns = c("t_statistic", "adj_pval"))
Arguments
columns

value column default t_statistic, adj_pval


Method write()

write results

Usage
ContrastsProDA$write(path, filename, format = "xlsx")
Arguments
path

directory

filename

file to write to

format

default xlsx lfq_write_table


Method clone()

The objects of this class are cloneable with this method.

Usage
ContrastsProDA$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other modelling: Contrasts, ContrastsMissing, ContrastsModerated, ContrastsPlotter, ContrastsROPECA, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, build_model(), contrasts_fisher_exact(), get_anova_df(), get_complete_model_fit(), get_p_values_pbeta(), isSingular_lm(), linfct_all_possible_contrasts(), linfct_factors_contrasts(), linfct_from_model(), linfct_matrix_contrasts(), merge_contrasts_results(), model_analyse(), model_summary(), moderated_p_limma(), moderated_p_limma_long(), my_contest(), my_contrast(), my_contrast_V1(), my_contrast_V2(), my_glht(), pivot_model_contrasts_2_Wide(), plot_lmer_peptide_predictions(), sim_build_models_lm(), sim_build_models_lmer(), sim_make_model_lm(), sim_make_model_lmer(), strategy_lmer(), summary_ROPECA_median_p.scaled()

Examples


istar <- prolfqua::sim_lfq_data_peptide_config()
istar$config <- istar$config
istar_data <- istar$data
lfd <- LFQData$new(istar_data, istar$config)
se <- prolfqua::LFQDataToSummarizedExperiment(lfd)
if(require(proDA)){
fit <- proDA::proDA(se, design = ~ group_ - 1, data_is_log_transformed = TRUE)
contr <- list()
contrasts <- c("group_AvsCtrl" = "group_A - group_Ctrl",
               "group_BvsCtrl" = "group_B - group_Ctrl")
contr[["group_AvsCtrl"]] <- data.frame(
  contrast = "group_AvsCtrl",
  proDA::test_diff(fit, contrast = "group_A - group_Ctrl"))
contr[["group_BvsCtrl"]] <- data.frame(
  contrast = "group_BvsCtrl",
  proDA::test_diff(fit, contrast = "group_B - group_Ctrl"))

bb <- dplyr::bind_rows(contr)
cproDA <- ContrastsProDA$new(bb, contrasts = contrasts, subject_Id = "name")
x <- cproDA$get_contrasts()
cproDA$get_linfct()
contsides <- cproDA$get_contrast_sides()
stopifnot(ncol(cproDA$to_wide()) == c(7))
tmp <- cproDA$get_Plotter()
tmp$volcano()$pval
tmp$volcano()$adj_pval
}


wolski/prolfqua documentation built on Dec. 4, 2024, 11:18 p.m.