Skip to contents

Same pipeline as ContrastsBinomialNestedFacade: child-feature detection is collapsed into detected and undetected counts per parent and sample, so the dispersion and the residual degrees of freedom come from the samples, not from the number of child features. The fixed pseudo-count is replaced by Firth's bias reduction (StrategyBinomialFirth), which gives finite log odds ratios under complete separation. Child identity is not modelled.

Value

An R6 class generator.

Super classes

ContrastsInterface -> ContrastsFacadeBase -> ContrastsBinomialFirthNestedFacade

Methods

Inherited methods


ContrastsBinomialFirthNestedFacade$new()

Fit the Firth-penalized nested detection-count model and its contrasts.

Usage

ContrastsBinomialFirthNestedFacade$new(
  lfqdata,
  modelstr,
  contrasts,
  binomial_bound = TRUE,
  control = list()
)

Arguments

lfqdata

nested LFQData

modelstr

right-hand-side model formula

contrasts

named contrast expressions

binomial_bound

bound posterior dispersion below by one

control

named list of convergence controls, see strategy_binomial_firth


ContrastsBinomialFirthNestedFacade$clone()

The objects of this class are cloneable with this method.

Usage

ContrastsBinomialFirthNestedFacade$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- sim_lfq_data_peptide_config(n_proteins = 20, weight_missing = 0.5, seed = 3)
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 6 unconfigured columns: average_prot_abundance, sd, mean, N, avg_peptide_abd, Replicate.
#> setup_analysis: added 205 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")
facade <- ContrastsBinomialFirthNestedFacade$new(lfqdata, "~ group_", contrasts)
head(facade$get_contrasts())
#> # A tibble: 6 × 16
#>   modelName             estimate_type protein_Id  contrast       diff avgAbd
#>   <chr>                 <chr>         <chr>       <chr>         <dbl>  <dbl>
#> 1 binomial_firth_nested observed      0GRprF~7339 A_vs_Ctrl -8.47e- 1  0.424
#> 2 binomial_firth_nested observed      4JK499~3111 A_vs_Ctrl  5.04e- 1 -0.704
#> 3 binomial_firth_nested observed      7IZdVV~6818 A_vs_Ctrl -5.73e- 1  1.32 
#> 4 binomial_firth_nested observed      AZPG26~9461 A_vs_Ctrl  8.51e-16  2.20 
#> 5 binomial_firth_nested observed      AoNKbb~3497 A_vs_Ctrl -1.18e+ 0  2.63 
#> 6 binomial_firth_nested observed      CibL2O~2149 A_vs_Ctrl -1.44e+ 0 -0.718
#> # ℹ 10 more variables: std.error.unmoderated <dbl>, df.unmoderated <int>,
#> #   std.error <dbl>, statistic <dbl>, df <dbl>, p.value <dbl>, conf.low <dbl>,
#> #   conf.high <dbl>, sigma <dbl>, FDR <dbl>