Skip to contents

Firth logistic missingness contrast analysis facade

Firth logistic missingness contrast analysis facade

Details

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

The input may be aggregated protein-level data or nested peptide-level data. The correct builder is chosen from the LFQData hierarchy automatically.

Public fields

model

ModelFirth object

contrast

ContrastsFirth object

Methods


Method new()

initialize

Usage

ContrastsFirthFacade$new(lfqdata, modelstr, contrasts)

Arguments

lfqdata

LFQData object

modelstr

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

contrasts

named character vector of contrasts


Method get_contrasts()

get contrast results

Usage

ContrastsFirthFacade$get_contrasts(...)

Arguments

...

passed to ContrastsFirth$get_contrasts


Method get_Plotter()

get ContrastsPlotter

Usage

ContrastsFirthFacade$get_Plotter(...)

Arguments

...

passed to ContrastsFirth$get_Plotter


Method to_wide()

convert results to wide format

Usage

ContrastsFirthFacade$to_wide(...)

Arguments

...

passed to ContrastsFirth$to_wide


Method 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(Nprot = 20, weight_missing = 0.5)
#> creating sampleName from fileName column
#> completing cases
#> completing cases done
#> setup done
lfqdata <- LFQData$new(istar$data, istar$config)
contrasts <- c("A_vs_Ctrl" = "group_A - group_Ctrl")
fa <- ContrastsFirthFacade$new(lfqdata, "~ group_", contrasts)
#> completing cases
#> Joining with `by = join_by(protein_Id)`
#> Joining with `by = join_by(protein_Id)`
head(fa$get_contrasts())
#> determine linear functions:
#> get_contrasts -> contrasts_linfct
#> contrasts_linfct_firth
#> Joining with `by = join_by(protein_Id, contrast)`
#> # A tibble: 6 × 14
#> # Groups:   contrast [1]
#>   facade modelName     protein_Id contrast sigma    df      diff   FDR std.error
#>   <chr>  <chr>         <chr>      <chr>    <dbl> <int>     <dbl> <dbl>     <dbl>
#> 1 firth  WaldTestFirth 0EfVhX~59… A_vs_Ct…     1     9  1.07e-15 1          2.11
#> 2 firth  WaldTestFirth 0m5WN4~14… A_vs_Ct…     1     9  8.47e- 1 0.978      1.32
#> 3 firth  WaldTestFirth 7cbcrd~83… A_vs_Ct…     1     9  1.07e-15 1          2.11
#> 4 firth  WaldTestFirth 9VUkAq~45… A_vs_Ct…     1     9 -1.35e+ 0 0.978      1.78
#> 5 firth  WaldTestFirth At886V~32… A_vs_Ct…     1     9 -8.47e- 1 0.978      1.32
#> 6 firth  WaldTestFirth BEJI92~91… A_vs_Ct…     1     9 -1.35e+ 0 0.978      1.78
#> # ℹ 5 more variables: statistic <dbl>, p.value <dbl>, conf.low <dbl>,
#> #   conf.high <dbl>, avgAbd <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…       1.07e-15             1             1                5.08e-16
#>  2 0m5WN4~14…       8.47e- 1             0.538         0.978            6.40e- 1
#>  3 7cbcrd~83…       1.07e-15             1             1                5.08e-16
#>  4 9VUkAq~45…      -1.35e+ 0             0.468         0.978           -7.58e- 1
#>  5 At886V~32…      -8.47e- 1             0.538         0.978           -6.40e- 1
#>  6 BEJI92~91…      -1.35e+ 0             0.468         0.978           -7.58e- 1
#>  7 CGzoYe~28…      -4.13e-16             1             1               -1.96e-16
#>  8 CtOJ9t~28…       1.35e+ 0             0.468         0.978            7.58e- 1
#>  9 DoWup2~29…       2.20e+ 0             0.238         0.978            1.26e+ 0
#> 10 DuwH7n~34…       8.47e- 1             0.538         0.978            6.40e- 1
#> 11 Fl4JiV~75…      -2.85e-17             1             1               -2.26e-17
#> 12 HC8K98~49…       8.47e- 1             0.538         0.978            6.40e- 1
#> 13 HvIpHG~40…       1.07e-15             1             1                5.08e-16
#> 14 I1Jk2Z~08…      -8.47e- 1             0.538         0.978           -6.40e- 1
#> 15 JV3Z7t~29…       1.07e-15             1             1                5.08e-16
#> 16 JcKVfU~08…      -1.35e+ 0             0.468         0.978           -7.58e- 1
#> 17 JfvT8X~27…      -2.20e+ 0             0.238         0.978           -1.26e+ 0
#> 18 R2i6w7~02…       6.65e-17             1             1                5.26e-17
#> 19 SGIVBl~95…       1.07e-15             1             1                5.08e-16
#> 20 r2J0Eh~26…      -4.13e-16             1             1               -1.96e-16