Build limma-voom model with LOD imputation for failed proteins
Source:R/ContrastsLimma.R
build_model_limma_voom_impute.RdCombines vooma precision weights with LOD imputation for proteins that have
entire missing groups (NA coefficients). Mirrors
build_model_limma_impute but uses vooma weights.
Arguments
- lfqdata
an
LFQDataobject (aggregated to protein level)- strategy
output of
strategy_limma- model_name
name of model (default: strategy name + "Imputed")
- lod
numeric limit of detection; if NULL, auto-computed from data
- df_method
how to set degrees of freedom for imputed proteins:
"observed"(default) usesmax(n_observed - p, 1);"borrowed"uses the median df from successful fits- span
lowess smoother span for vooma trend (default 0.5)
- plot
logical; if TRUE, plot the mean-variance trend
Value
a ModelLimma object with a hybrid fit
See also
Other modelling:
AnovaExtractor,
Contrasts,
ContrastsComparison,
ContrastsDEqMSFacade,
ContrastsDEqMSVoomFacade,
ContrastsFacadeBase,
ContrastsFirth,
ContrastsFirthFacade,
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_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()
Examples
istar <- sim_lfq_data_protein_config(n_proteins = 50, 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 137 rows with NA response for feature and sample combinations absent from the input.
lfqdata <- LFQData$new(istar$data, istar$config)
lfqdata$rename_response("transformedIntensity")
strat <- strategy_limma("transformedIntensity ~ group_")
mod <- build_model_limma_voom_impute(lfqdata, strat)
#> fit (limmaImputed): 2 refit at the limit of detection (e.g. 7cbcrd~0495, nKkahQ~2435): fit failed, singular or missing a group; missing responses imputed at the LOD
#> fit (limmaImputed): 118 missing responses dropped (e.g. 0EfVhX~7161, 0m5WN4~3543, 7QuTub~5556, 9VUkAq~8655, At886V~0359, ...): NA response (missing observation) left out of the fit
#> See $provenance().
mod$get_coefficients()
#> # A tibble: 147 × 6
#> protein_Id factor Estimate Std..Error t.value Pr...t..
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 0EfVhX~7161 (Intercept) 20.6 0.528 39.0 7.04e-121
#> 2 0m5WN4~3543 (Intercept) 20.8 0.529 39.4 4.55e-122
#> 3 76k03k~9735 (Intercept) 20.2 0.466 43.2 1.40e-132
#> 4 7QuTub~5556 (Intercept) 22.8 0.528 43.2 2.09e-132
#> 5 7cbcrd~0495 (Intercept) 16.7 0.184 90.6 1.32e-223
#> 6 7soopj~3451 (Intercept) 26.3 0.475 55.5 3.74e-162
#> 7 9VUkAq~8655 (Intercept) 22.2 0.508 43.8 4.98e-134
#> 8 At886V~0359 (Intercept) 17.1 0.826 20.7 2.96e- 60
#> 9 BEJI92~5483 (Intercept) 15.9 0.827 19.2 1.95e- 54
#> 10 CGzoYe~1248 (Intercept) 18.2 0.585 31.2 2.78e- 97
#> # ℹ 137 more rows