Skip to contents

Holds one Firth logistic regression fit (logistf) per subject, modelling whether a protein is detected in a sample, with the model table in models$model_df. Contrasts are computed from it with ContrastsFirth.

Value

An R6 class generator.

See also

Other modelling: AnovaExtractor, Contrasts, ContrastsComparison, ContrastsDEqMSFacade, ContrastsDEqMSVoomFacade, ContrastsFacadeBase, ContrastsFirth, ContrastsFirthFacade, ContrastsHurdleFacade, ContrastsHurdleNestedFacade, ContrastsLMFacade, ContrastsLMImputeFacade, ContrastsLimma, ContrastsLimmaFacade, ContrastsLimmaImputeFacade, ContrastsLimmaVoomFacade, ContrastsLimmaVoomImputeFacade, ContrastsLimpaFacade, ContrastsLimpaNestedFacade, ContrastsLmerNestedFacade, ContrastsModerated, ContrastsModeratedDEqMS, ContrastsPlotter, ContrastsRLMFacade, ContrastsROPECA, ContrastsROPECANestedFacade, ContrastsROPECAV2, ContrastsROPECAV2NestedFacade, ContrastsRfitFacade, ContrastsRfitImputeFacade, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, Model, ModelLimma, StrategyLM, StrategyLimma, StrategyLimpa, StrategyLmer, StrategyLogistf, StrategyRLM, StrategyRfit, build_contrast_analysis(), build_model(), build_model_glm_protein(), build_model_impute(), build_model_limma(), build_model_limma_impute(), build_model_limma_voom(), build_model_limma_voom_impute(), build_model_limpa(), compute_borrowed_variance(), compute_borrowed_variance_limma(), df.residual.rfit_prolfqua(), group_label(), impute_from_model(), impute_refit_singular(), list_facades(), lookup_facade(), lr_test(), merge_contrasts_results(), new_imputed_model(), nobs.rfit_prolfqua(), pivot_model_contrasts_to_wide(), prolfqua_analysis_methods, register_facade(), sigma.rfit_prolfqua(), strategy_limma(), strategy_limpa(), strategy_logistf(), vcov.rfit_prolfqua()

Super class

ModelInterface -> ModelFirth

Public fields

models

list with model_df, one fitted model per subject, and the strategy

model_name

name of model

subject_id

e.g. protein_Id

p.adjust

function to adjust p-values

Methods

Inherited methods


ModelFirth$new()

initialize

Usage

ModelFirth$new(
  models,
  model_name = "modelFirth",
  subject_id = "protein_Id",
  p.adjust = prolfqua::adjust_p_values
)

Arguments

models

list with a model_df data.frame (one fitted model per subject) and the strategy

model_name

name of model

subject_id

subject column name

p.adjust

method to adjust p-values


ModelFirth$get_coefficients()

return model coefficient table

Usage

ModelFirth$get_coefficients()


ModelFirth$get_anova()

return anova table

Usage

ModelFirth$get_anova()


ModelFirth$anova_histogram()

histogram of ANOVA results

Usage

ModelFirth$anova_histogram(what = "p.value")

Arguments

what

one case-sensitive choice: "p.value" (default) or "FDR".


ModelFirth$clone()

The objects of this class are cloneable with this method.

Usage

ModelFirth$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- prolfqua::sim_lfq_data_protein_config(n_proteins = 10, with_missing = TRUE,
  weight_missing = 0.5, seed = 3)
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 5 unconfigured columns: average_prot_abundance, sd, mean, N, Replicate.
#> setup_analysis: added 23 rows with NA response for feature and sample combinations absent from the input.
mod <- build_model_glm_protein(LFQData$new(istar$data, istar$config), "~ group_")
tmp <- mod$get_coefficients()
stopifnot(nrow(tmp) == 30)
mod$coef_histogram()
#> $plot

#> 
#> $name
#> [1] "Coef_Histogram_modelFirth.pdf"
#> 
mod$coef_pairs()
#> $plot
#> # A tibble: 10 × 4
#>    subject_id  `(Intercept)`   group_B group_Ctrl
#>    <chr>               <dbl>     <dbl>      <dbl>
#>  1 7IZdVV~0841         2.20   9.70e-16  -2.20e+ 0
#>  2 AZPG26~2091         2.20   1.26e-15  -4.27e-16
#>  3 AoNKbb~6908         2.20  -1.69e-16  -1.35e+ 0
#>  4 EnbuYk~0350         0.847 -8.47e- 1   4.14e-16
#>  5 JnEDsz~4938        -0.847 -1.35e+ 0  -4.18e-17
#>  6 NNASGK~1417         2.20   1.26e-15  -4.27e-16
#>  7 XYrp6h~5793         2.20   1.26e-15  -4.27e-16
#>  8 quTD7H~4566         2.20  -1.35e+ 0  -2.20e+ 0
#>  9 tCZCHm~6695         2.20  -1.35e+ 0  -2.16e-15
#> 10 tHE075~8231         0.847  1.35e+ 0   1.59e-16
#> 
#> $name
#> [1] "Coef_Pairsplot_modelFirth.pdf"
#> 
mod$get_anova()
#> Warning: `get_anova()` is not implemented for Firth models; returning `NULL`.
#> NULL
mod$coef_volcano()
#> $plot

#> 
#> $name
#> [1] "Coef_volcano_plot_modelFirth.pdf"
#> 
mod$anova_histogram()
#> Warning: `anova_histogram()` is not implemented for Firth models; returning `NULL`.
#> NULL