Model: R6 class representing modelling result

ModelR Documentation

R6 class representing modelling result

Description

R6 class representing modelling result

R6 class representing modelling result

Super class

prolfqua::ModelInterface -> Model

Public fields

modelDF

data.frame with modelling data and model.

modelName

name of model

subject_Id

e.g. protein_Id

model_strategy

function to create the models

anova_df

function to compute anova

p.adjust

function to adjust p-values

Methods

Public methods


Method new()

initialize

Usage
Model$new(
  modelDF,
  model_strategy,
  modelName,
  subject_Id = "protein_Id",
  p.adjust = prolfqua::adjust_p_values
)
Arguments
modelDF

dataframe with modelling results

model_strategy

model_strategy see strategy_lmer

modelName

name of model

subject_Id

subject column name

p.adjust

method to adjust p-values


Method get_coefficients()

return model coefficient table

Usage
Model$get_coefficients()

Method get_anova()

return anova table

Usage
Model$get_anova()

Method write_coefficients()

writes model coefficients to file

Usage
Model$write_coefficients(path, format = "xlsx")
Arguments
path

folder to write to

format

default xlsx lfq_write_table


Method coef_histogram()

histogram of model coefficient

Usage
Model$coef_histogram()

Method coef_volcano()

volcano plot of non intercept coefficients

Usage
Model$coef_volcano()

Method coef_pairs()

pairs-plot of coefficients

Usage
Model$coef_pairs()

Method anova_histogram()

histogram of ANOVA results

Usage
Model$anova_histogram(what = c("p.value", "FDR"))
Arguments
what

show either "Pr..F." or "FDR.Pr..F."


Method write_anova_figures()

write figures related to ANOVA into pdf file

Usage
Model$write_anova_figures(path, width = 10, height = 10)
Arguments
path

folder name

width

figure width

height

figure height


Method write_coef_figures()

write figures related to Coefficients into pdf file

Usage
Model$write_coef_figures(path, width = 10, height = 10)
Arguments
path

folder name

width

figure width

height

figure height


Method clone()

The objects of this class are cloneable with this method.

Usage
Model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other modelling: Contrasts, ContrastsMissing, ContrastsModerated, ContrastsPlotter, ContrastsProDA, ContrastsROPECA, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), 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_data('data_ionstar')$normalized()
istar$config <- old2new(istar$config)
istar_data <- dplyr::filter(istar$data ,protein_Id %in% sample(protein_Id, 100))
modelName <- "f_condtion_r_peptide"
formula_randomPeptide <-
  strategy_lmer("transformedIntensity  ~ dilution. + (1 | peptide_Id)",
   model_name = modelName)
pepIntensity <- istar_data
config <- istar$config
config$table$hierarchy_keys_depth()
mod <- prolfqua::build_model(
 pepIntensity,
 formula_randomPeptide,
 modelName = modelName,
 subject_Id = config$table$hierarchy_keys_depth())

mod$modelDF
aovtable  <- mod$get_anova()
mod$get_coefficients()
mod$coef_histogram()
mod$coef_volcano()
mod$coef_pairs()
mod$anova_histogram()


wolski/prolfqua documentation built on Oct. 31, 2024, 9:22 a.m.