Skip to contents

Encapsulates the pipeline: strategy_limpa -> build_model_limpa -> ContrastsLimma.

Operates as an "aggregated"-level facade: it consumes whatever aggregated LFQData prolfqua's normal aggregation pipeline produced and fits limpa at that hierarchy level. If config$opt_se is set (e.g. when the input came from AggregateLimpa), the per-observation standard error is used as a vooma precision-weight predictor; otherwise plain vooma is fit. The config$nr_children column is required and is used to flag imputed observations (nr_children == 0) for vooma's imputation-aware DF correction.

For nested (peptide/precursor) input that should be rolled up to proteins via limpa's DPC quantification, use ContrastsLimpaNestedFacade instead - that facade owns the AggregateLimpa pre-step.

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

Methods

Inherited methods


ContrastsLimpaFacade$new()

initialize

Usage

ContrastsLimpaFacade$new(
  lfqdata,
  modelstr,
  contrasts,
  plot = FALSE,
  span = NULL,
  trend = FALSE,
  robust = FALSE
)

Arguments

lfqdata

aggregated LFQData. If config$opt_se is set (e.g. from AggregateLimpa), the SE column is used as a vooma precision-weight predictor; otherwise vooma is fit without an external predictor.

modelstr

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

contrasts

named character vector of contrasts

plot

logical; if TRUE, plot the vooma mean-variance trend

span

lowess smoother span (NULL = auto)

trend, robust

passed to eBayes, see strategy_limpa


ContrastsLimpaFacade$clone()

The objects of this class are cloneable with this method.

Usage

ContrastsLimpaFacade$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- prolfqua::sim_lfq_data_peptide_config()
#> `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 36 rows with NA response for feature and sample combinations absent from the input.
lfqdata <- LFQData$new(istar$data, istar$config)
lfqdata <- lfqdata$get_Transformer()$log2()$lfq
#> Transformed response column added: log2_abundance
agg <- AggregateLimpa$new(lfqdata, "protein")
lfq_agg <- agg$aggregate()
contrasts <- c("A_vs_Ctrl" = "group_A - group_Ctrl")
fa <- ContrastsLimpaFacade$new(lfq_agg, "~ group_", contrasts)
head(fa$get_contrasts())
#> # A tibble: 6 × 16
#>   modelName estimate_type protein_Id  contrast     diff      FDR
#>   <chr>     <chr>         <chr>       <chr>       <dbl>    <dbl>
#> 1 limpa     observed      0EfVhX~0087 A_vs_Ctrl -0.0280 0.230   
#> 2 limpa     observed      7cbcrd~5725 A_vs_Ctrl  0.719  0.0164  
#> 3 limpa     observed      9VUkAq~4703 A_vs_Ctrl -0.569  0.00145 
#> 4 limpa     observed      BEJI92~5282 A_vs_Ctrl  0.224  0.0198  
#> 5 limpa     observed      CGzoYe~2147 A_vs_Ctrl -0.295  0.230   
#> 6 limpa     observed      DoWup2~5896 A_vs_Ctrl  0.281  0.000267
#> # ℹ 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>