build_model: Build protein models from data

View source: R/tidyMS_R6Model.R

build_modelR Documentation

Build protein models from data

Description

Build protein models from data

Usage

build_model(
  data,
  model_strategy,
  subject_Id = if ("LFQData" %in% class(data)) {
     data$subject_Id()
 } else {
    
    "protein_Id"
 },
  modelName = model_strategy$model_name
)

Arguments

data

data - a data frame

subject_Id

grouping variable

modelName

model name

modelFunction

model function

Value

a object of class Model

See Also

model_analyse, strategy_lmer strategy_lm

Other modelling: Contrasts, ContrastsMissing, ContrastsModerated, ContrastsPlotter, ContrastsProDA, ContrastsROPECA, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), 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

D <- prolfqua::sim_lfq_data_peptide_config(Nprot = 20, weight_missing = 0.1)
D$data$abundance |> is.na() |> sum()
D <- prolfqua::sim_lfq_data_peptide_config(Nprot = 20, weight_missing = 0.1, seed =3)
D$data$abundance |> is.na() |> sum()
modelName <- "f_condtion_r_peptide"
formula_randomPeptide <-
  strategy_lmer("abundance  ~ group_ + (1 | peptide_Id) + (1 | sampleName)",
   model_name = modelName)


mod <- prolfqua::build_model(
 D$data,
 formula_randomPeptide,
 modelName = modelName,
 subject_Id = D$config$table$hierarchy_keys_depth())
aovtable <- mod$get_anova()

mod <- prolfqua::build_model(
 LFQData$new(D$data, D$config),
 formula_randomPeptide,
 modelName = modelName)
model_summary(mod)



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