Skip to contents

Encapsulates the pipeline: strategy_limma -> build_model_limma_voom_impute -> ContrastsLimma.

Combines vooma precision weights with LOD imputation for proteins whose fit produces NA coefficients (typically from entire missing groups).

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, 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 -> ContrastsLimmaVoomImputeFacade

Methods

Inherited methods


ContrastsLimmaVoomImputeFacade$new()

initialize

Usage

ContrastsLimmaVoomImputeFacade$new(
  lfqdata,
  modelstr,
  contrasts,
  lod = NULL,
  df_method = c("observed", "borrowed"),
  weights = lfqdata$nr_children_col(),
  span = 0.5,
  plot = FALSE,
  trend = FALSE,
  robust = FALSE
)

Arguments

lfqdata

LFQData object (aggregated to protein level)

modelstr

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

contrasts

named character vector of contrasts

lod

numeric limit of detection; if NULL, auto-computed from data

df_method

"observed" uses max(n_observed - p, 1); "borrowed" uses median df from successful fits

weights

column name for per-observation weights (default: lfqdata$nr_children_col()). Pass NULL for unweighted.

span

lowess smoother span for vooma trend (default 0.5)

plot

logical; if TRUE, plot the mean-variance trend

trend, robust

passed to eBayes, see strategy_limma


ContrastsLimmaVoomImputeFacade$clone()

The objects of this class are cloneable with this method.

Usage

ContrastsLimmaVoomImputeFacade$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- sim_lfq_data_protein_config(n_proteins = 30, 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 89 rows with NA response for feature and sample combinations absent from the input.
lfqdata <- LFQData$new(istar$data, istar$config)
lfqdata$rename_response("transformedIntensity")
contrasts <- c("A_vs_Ctrl" = "group_A - group_Ctrl")
fa <- ContrastsLimmaVoomImputeFacade$new(lfqdata, "~ group_", contrasts)
#> fit (limmaImputed): 4 refit at the limit of detection (e.g. DuwH7n~2082, HvIpHG~1448, JcKVfU~4958, JfvT8X~6972): fit failed, singular or missing a group; missing responses imputed at the LOD
#> fit (limmaImputed): 62 missing responses dropped (e.g. 0m5WN4~6730, 7QuTub~6175, 7cbcrd~2687, 9VUkAq~3402, BEJI92~2727, ...): NA response (missing observation) left out of the fit
#> See $provenance().
head(fa$get_contrasts())
#> # A tibble: 6 × 16
#>   modelName         estimate_type protein_Id  contrast     diff   FDR
#>   <chr>             <chr>         <chr>       <chr>       <dbl> <dbl>
#> 1 limma_voom_impute observed      0EfVhX~2956 A_vs_Ctrl  1.24   0.325
#> 2 limma_voom_impute observed      0m5WN4~6730 A_vs_Ctrl -0.0361 0.973
#> 3 limma_voom_impute observed      7QuTub~6175 A_vs_Ctrl  0.909  0.694
#> 4 limma_voom_impute observed      7cbcrd~2687 A_vs_Ctrl  0.612  0.855
#> 5 limma_voom_impute observed      9VUkAq~3402 A_vs_Ctrl  0.768  0.855
#> 6 limma_voom_impute observed      At886V~7759 A_vs_Ctrl -1.86   0.240
#> # ℹ 10 more variables: std.error.unmoderated <dbl>, df.unmoderated <dbl>,
#> #   std.error <dbl>, statistic <dbl>, p.value <dbl>, sigma <dbl>, df <dbl>,
#> #   conf.low <dbl>, conf.high <dbl>, avgAbd <dbl>
fa$to_wide()
#> # A tibble: 30 × 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~29…         1.24             0.0650         0.325               2.00  
#>  2 0m5WN4~67…        -0.0361           0.973          0.973              -0.0352
#>  3 7QuTub~61…         0.909            0.301          0.694               1.12  
#>  4 7cbcrd~26…         0.612            0.541          0.855               0.633 
#>  5 9VUkAq~34…         0.768            0.514          0.855               0.671 
#>  6 At886V~77…        -1.86             0.0400         0.240              -2.26  
#>  7 BEJI92~27…        -1.30             0.154          0.462              -1.51  
#>  8 CGzoYe~08…         0.196            0.849          0.951               0.194 
#>  9 CtOJ9t~91…        -0.0717           0.931          0.973              -0.0882
#> 10 DoWup2~28…        -1.82             0.00796        0.0865             -3.09  
#> # ℹ 20 more rows