Same API as Model: get_anova(), get_coefficients(),
coef_histogram(), coef_volcano(), anova_histogram().
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,
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 class
ModelInterface -> ModelLimma
Public fields
fitlimma MArrayLM object from lmFit
Eresponse matrix used for the stored coefficients
weightsobservation-weight matrix or NULL
observedlogical matrix identifying responses observed before imputation
annotationsample table in response-matrix column order
formulafitted model formula, including the response
subject_idprotein ID column name(s)
model_namemodel name
rowdataprotein ID mapping from to_wide()$rowdata
trendpassed to eBayes
robustpassed to eBayes
dummy_modelone fitted lm for linfct extraction
p.adjustfunction to adjust p-values
imputed_proteinscharacter vector of bare protein ids (matching the first subject column in
rowdata) that were rescued via LOD imputation.ContrastsLimma$get_contrasts()reads this to tag refit rows withestimate_type = "lod_imputed"so the rescue is visible downstream. Empty for builders that do not impute.
Methods
ModelLimma$new()
initialize ModelLimma
Usage
ModelLimma$new(
fit,
subject_id,
model_name,
rowdata,
trend = FALSE,
robust = FALSE,
dummy_model = NULL,
p.adjust = prolfqua::adjust_p_values,
imputed_proteins = character(0),
E = NULL,
weights = NULL,
observed = NULL,
annotation = NULL,
formula = NULL
)Arguments
fitlimma MArrayLM from lmFit
subject_idprotein ID column name(s)
model_namemodel name
rowdataprotein ID mapping
trendpassed to eBayes
robustpassed to eBayes
dummy_modelone fitted lm for linfct extraction
p.adjustfunction to adjust p-values
imputed_proteinscharacter vector of LOD-rescued protein ids
E, weights, observed, annotation, formularetained fitted inputs; see the corresponding fields
ModelLimma$get_anova()
return anova table (F-test per protein across all non-intercept coefficients)
Examples
istar <- sim_lfq_data_protein_config(n_proteins = 50)
#> `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 82 rows with NA response for feature and sample combinations absent from the input.
lProt <- LFQData$new(istar$data, istar$config)
lProt$rename_response("transformedIntensity")
strat <- strategy_limma("transformedIntensity ~ group_")
mod <- build_model_limma(lProt, strat)
#> fit (limma): 1 singular fits (e.g. VUnZ6o~1614): coefficients not estimable (Partial NA coefficients)
#> fit (limma): 82 missing responses dropped (e.g. 0EfVhX~7161, 0m5WN4~3543, 7QuTub~5556, 7cbcrd~0495, 9VUkAq~8655, ...): NA response (missing observation) left out of the fit
#> See $provenance().
coeffs <- mod$get_coefficients()
head(coeffs)
#> # A tibble: 6 × 6
#> protein_Id factor Estimate Std..Error t.value Pr...t..
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 0EfVhX~7161 (Intercept) 20.3 0.482 42.1 5.89e-143
#> 2 0m5WN4~3543 (Intercept) 20.5 0.482 42.6 1.17e-144
#> 3 76k03k~9735 (Intercept) 20.2 0.481 41.9 3.21e-142
#> 4 7QuTub~5556 (Intercept) 22.8 0.482 47.4 7.08e-159
#> 5 7cbcrd~0495 (Intercept) 17.2 0.681 25.2 3.32e- 82
#> 6 7soopj~3451 (Intercept) 26.3 0.481 54.7 3.79e-179
anova_tbl <- mod$get_anova()
head(anova_tbl)
#> # A tibble: 6 × 5
#> protein_Id F.value p.value factor FDR
#> <chr> <dbl> <dbl> <chr> <dbl>
#> 1 0EfVhX~7161 9.95 4.81e- 5 group_B+group_Ctrl 2.14e- 4
#> 2 0m5WN4~3543 26.8 2.57e-12 group_B+group_Ctrl 1.80e-11
#> 3 76k03k~9735 1.57 2.09e- 1 group_B+group_Ctrl 5.38e- 1
#> 4 7QuTub~5556 1.40 2.46e- 1 group_B+group_Ctrl 5.48e- 1
#> 5 7cbcrd~0495 6.12 2.22e- 3 group_B+group_Ctrl 8.35e- 3
#> 6 7soopj~3451 1.51 2.21e- 1 group_B+group_Ctrl 5.41e- 1
mod$coef_histogram()
#> $plot
#> Warning: Removed 1 row containing non-finite outside the scale range (`stat_bin()`).
#>
#> $name
#> [1] "Coef_Histogram_limma.pdf"
#>
mod$coef_volcano()
#> $plot
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_point()`).
#>
#> $name
#> [1] "Coef_VolcanoPlot_limma.pdf"
#>
mod$anova_histogram()
#> $plot
#> Warning: Removed 1 row containing non-finite outside the scale range (`stat_bin()`).
#>
#> $name
#> [1] "Anova_p.values_limma.pdf"
#>