Contrasts: Estimate contrasts using Wald Test

ContrastsR Documentation

Estimate contrasts using Wald Test

Description

Estimate contrasts using Wald Test

Estimate contrasts using Wald Test

Super class

prolfqua::ContrastsInterface -> Contrast

Public fields

models

Model

contrasts

character with contrasts

contrastfun

function to compute contrasts

modelName

model name

subject_Id

name of column containing e.g., protein Id's

p.adjust

function to adjust p-values (default prolfqua::adjust_p_values)

contrast_result

data frame containing results of contrast computation

global

use a global linear function (determined by get_linfct)

protein_annot

holds protein annotation

Methods

Public methods

Inherited methods

Method new()

initialize create Contrast

Usage
Contrasts$new(
  model,
  contrasts,
  p.adjust = prolfqua::adjust_p_values,
  global = TRUE,
  modelName = "WaldTest"
)
Arguments
model

a dataframe with a structure similar to that generated by build_model

contrasts

a character vector with contrast specificiation

p.adjust

function to adjust the p-values

global

development/internal argument (if FALSE determine linfct for each model.)

modelName

name of contrast method, default WaldTest


Method get_contrast_sides()

get both sides of contrasts

Usage
Contrasts$get_contrast_sides()

Method get_linfct()

get linear functions from contrasts

Usage
Contrasts$get_linfct(global = TRUE)
Arguments
global

logical TRUE - get the a linear functions for all models, FALSE - linear function for each model


Method get_contrasts()

get table with contrast estimates

Usage
Contrasts$get_contrasts(all = FALSE)
Arguments
all

should all columns be returned (default FALSE)

Returns

data.frame with contrasts


Method get_Plotter()

return ContrastsPlotter creates Contrast_Plotter

Usage
Contrasts$get_Plotter(FCthreshold = 1, FDRthreshold = 0.1)
Arguments
FCthreshold

fold change threshold to show in plots

FDRthreshold

FDR threshold to show in plots

Returns

ContrastsPlotter


Method to_wide()

convert to wide format

Usage
Contrasts$to_wide(columns = c("p.value", "FDR"))
Arguments
columns

value column default p.value

Returns

data.frame


Method clone()

The objects of this class are cloneable with this method.

Usage
Contrasts$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other modelling: ContrastsMissing, ContrastsModerated, ContrastsPlotter, ContrastsProDA, ContrastsROPECA, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, build_model(), contrasts_fisher_exact(), get_anova_df(), get_complete_model_fit(), get_imputed_contrasts(), 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_model_and_data(), plot_lmer_peptide_noRandom(), plot_lmer_peptide_predictions(), plot_lmer_predicted_interactions(), strategy_lmer(), summary_ROPECA_median_p.scaled()

Examples


# Fitting mixed effects model to peptide data
istar <- prolfqua::sim_lfq_data_peptide_config()

modelFunction <-
strategy_lmer("abundance  ~ group_ + (1 | peptide_Id) + (1 | sample)")

config <- istar$config
config$table$hierarchy_keys_depth()

mod <- build_model(
 istar$data,
 modelFunction,
 subject_Id = config$table$hierarchy_keys_depth()
 )

prolfqua::model_summary(mod)
 Contr <- c("groupA_vs_Ctrl" = "group_A - group_Ctrl",
    "dil.e_vs_b" = "group_A - group_Ctrl" )
#Contrasts$debug("get_contrasts")
contrastX <- prolfqua::Contrasts$new(mod, Contr)
contrastX$get_contrasts()
contrastX$get_contrast_sides()
contrastX$column_description()


wolski/prolfqua documentation built on April 27, 2024, 4:09 p.m.