Skip to contents

Encapsulates the pipeline: encode missingness -> build_model_glm_protein -> ContrastsFirth.

Requires aggregated (protein-level) LFQData. For nested peptide-level input use ContrastsBinomialFirthNestedFacade.

Contrasts are Wald tests on the log odds of detection with the normal reference distribution (z, df = Inf), as in the coefficient table, confint() and logistf itself. With few samples the test is conservative: in a null simulation with 10 samples per group and detection probability 0.5, 4.1% of the p-values fell below 0.05.

Value

An R6 class generator.

See also

Other modelling: AnovaExtractor, Contrasts, ContrastsComparison, ContrastsDEqMSFacade, ContrastsDEqMSVoomFacade, ContrastsFacadeBase, ContrastsFirth, 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, ModelFirth, 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 classes

ContrastsInterface -> ContrastsFacadeBase -> ContrastsFirthFacade

Methods

Inherited methods


ContrastsFirthFacade$new()

initialize

Usage

ContrastsFirthFacade$new(lfqdata, modelstr, contrasts, control = list())

Arguments

lfqdata

LFQData object with the data and its configuration

modelstr

model formula string (e.g. "~ group_")

contrasts

named character vector of contrasts

control

convergence controls of logistf, see strategy_logistf


ContrastsFirthFacade$clone()

The objects of this class are cloneable with this method.

Usage

ContrastsFirthFacade$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- sim_lfq_data_protein_config(n_proteins = 20, weight_missing = 0.5)
#> `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 51 rows with NA response for feature and sample combinations absent from the input.
lfqdata <- LFQData$new(istar$data, istar$config)
contrasts <- c("A_vs_Ctrl" = "group_A - group_Ctrl")
fa <- ContrastsFirthFacade$new(lfqdata, "~ group_", contrasts)
head(fa$get_contrasts())
#> # A tibble: 6 × 16
#>   modelName estimate_type protein_Id  contrast  sigma    df      diff   FDR
#>   <chr>     <chr>         <chr>       <chr>     <dbl> <dbl>     <dbl> <dbl>
#> 1 firth     observed      0EfVhX~5954 A_vs_Ctrl     1   Inf  4.27e-16 1    
#> 2 firth     observed      0m5WN4~1448 A_vs_Ctrl     1   Inf  8.47e- 1 0.949
#> 3 firth     observed      7cbcrd~8305 A_vs_Ctrl     1   Inf  4.27e-16 1    
#> 4 firth     observed      9VUkAq~4562 A_vs_Ctrl     1   Inf -1.35e+ 0 0.949
#> 5 firth     observed      At886V~3296 A_vs_Ctrl     1   Inf -8.47e- 1 0.949
#> 6 firth     observed      BEJI92~9143 A_vs_Ctrl     1   Inf -1.35e+ 0 0.949
#> # ℹ 8 more variables: std.error <dbl>, statistic <dbl>, p.value <dbl>,
#> #   conf.low <dbl>, conf.high <dbl>, avgAbd <dbl>, std.error.unmoderated <dbl>,
#> #   df.unmoderated <dbl>
fa$to_wide()
#> # A tibble: 20 × 5
#>    protein_Id diff.A_vs_Ctrl p.value.A_vs_Ctrl FDR.A_vs_Ctrl statistic.A_vs_Ctrl
#>    <chr>               <dbl>             <dbl>         <dbl>               <dbl>
#>  1 0EfVhX~59…       4.27e-16             1             1                2.03e-16
#>  2 0m5WN4~14…       8.47e- 1             0.522         0.949            6.40e- 1
#>  3 7cbcrd~83…       4.27e-16             1             1                2.03e-16
#>  4 9VUkAq~45…      -1.35e+ 0             0.449         0.949           -7.58e- 1
#>  5 At886V~32…      -8.47e- 1             0.522         0.949           -6.40e- 1
#>  6 BEJI92~91…      -1.35e+ 0             0.449         0.949           -7.58e- 1
#>  7 CGzoYe~28…       2.16e-15             1.000         1                1.02e-15
#>  8 CtOJ9t~28…       1.35e+ 0             0.449         0.949            7.58e- 1
#>  9 DoWup2~29…       2.20e+ 0             0.206         0.949            1.26e+ 0
#> 10 DuwH7n~34…       8.47e- 1             0.522         0.949            6.40e- 1
#> 11 Fl4JiV~75…       3.22e-16             1             1                2.54e-16
#> 12 HC8K98~49…       8.47e- 1             0.522         0.949            6.40e- 1
#> 13 HvIpHG~40…       4.27e-16             1             1                2.03e-16
#> 14 I1Jk2Z~08…      -8.47e- 1             0.522         0.949           -6.40e- 1
#> 15 JV3Z7t~29…       4.27e-16             1             1                2.03e-16
#> 16 JcKVfU~08…      -1.35e+ 0             0.449         0.949           -7.58e- 1
#> 17 JfvT8X~27…      -2.20e+ 0             0.206         0.949           -1.26e+ 0
#> 18 R2i6w7~02…      -1.11e-17             1             1               -8.81e-18
#> 19 SGIVBl~95…       4.27e-16             1             1                2.03e-16
#> 20 r2J0Eh~26…       2.16e-15             1.000         1                1.02e-15