Skip to contents

Estimates observation-level precision weights from a mean-variance trend (vooma) and fits a weighted least squares model via lmFit. For proteomics data that is already log2-transformed.

Usage

build_model_limma_voom(
  lfqdata,
  strategy,
  modelName = strategy$model_name,
  span = 0.5,
  plot = FALSE
)

Arguments

lfqdata

an LFQData object (aggregated to protein level)

strategy

output of strategy_limma

modelName

name of model (default from strategy)

span

lowess smoother span for mean-variance trend (default 0.5)

plot

logical; if TRUE, plot the mean-variance trend

Value

a ModelLimma object

Details

When strategy$weights is set (e.g. to nr_children), these external weights enter the preliminary fit (so the trend estimation accounts for measurement precision) and are multiplied element-wise with the vooma weights for the final fit. See the voom integration notes in TODO/TODO_limma_voom_integration.md for the mathematical basis.

See also

Other modelling: AnovaExtractor, Contrasts, ContrastsDEqMSFacade, ContrastsDEqMSVoomFacade, ContrastsFirth, ContrastsFirthFacade, ContrastsLMFacade, ContrastsLMImputeFacade, ContrastsLMMissingFacade, ContrastsLimma, ContrastsLimmaFacade, ContrastsLimmaImputeFacade, ContrastsLimmaVoomFacade, ContrastsLimmaVoomImputeFacade, ContrastsLimpaFacade, ContrastsLmerFacade, ContrastsMissing, ContrastsModerated, ContrastsModeratedDEqMS, ContrastsPlotter, ContrastsRLMFacade, ContrastsROPECA, ContrastsROPECAFacade, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, ModelFirth, ModelLimma, StrategyLM, StrategyLimma, StrategyLimpa, StrategyLmer, StrategyLogistf, StrategyRLM, build_contrast_analysis(), build_model(), build_model_glm_peptide(), build_model_glm_protein(), build_model_impute(), build_model_limma(), build_model_limma_impute(), build_model_limma_voom_impute(), build_model_limpa(), build_model_logistf(), compute_borrowed_variance(), compute_borrowed_variance_limma(), compute_contrast(), compute_lmer_contrast(), contrasts_fisher_exact(), get_anova_df(), get_complete_model_fit(), get_p_values_pbeta(), group_label(), impute_refit_singular(), isSingular_lm(), linfct_all_possible_contrasts(), linfct_factors_contrasts(), linfct_from_model(), linfct_matrix_contrasts(), merge_contrasts_results(), model_analyse(), model_summary(), moderated_p_deqms(), moderated_p_deqms_long(), moderated_p_limma(), moderated_p_limma_long(), new_lm_imputed(), pivot_model_contrasts_2_Wide(), plot_lmer_peptide_predictions(), sim_build_models_lm(), sim_build_models_lmer(), sim_build_models_logistf(), sim_make_model_lm(), sim_make_model_lmer(), strategy_limma(), strategy_limpa(), strategy_logistf(), summary_ROPECA_median_p.scaled()

Examples


istar <- sim_lfq_data_protein_config(Nprot = 50)
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
lProt <- LFQData$new(istar$data, istar$config)
lProt$rename_response("transformedIntensity")

strat <- strategy_limma("transformedIntensity ~ group_")
mod <- build_model_limma_voom(lProt, strat)
#> Warning: Partial NA coefficients for 1 probe(s)
mod$get_coefficients()
#> # A tibble: 150 × 6
#>    protein_Id  factor      Estimate Std..Error t.value   Pr...t..
#>    <chr>       <chr>          <dbl>      <dbl>   <dbl>      <dbl>
#>  1 0EfVhX~7161 (Intercept)     20.3      0.465    43.6 2.54 e-147
#>  2 0m5WN4~3543 (Intercept)     20.5      0.451    45.5 3.83 e-153
#>  3 76k03k~9735 (Intercept)     20.2      0.472    42.7 9.11 e-145
#>  4 7QuTub~5556 (Intercept)     22.8      0.516    44.2 2.60 e-149
#>  5 7cbcrd~0495 (Intercept)     17.2      0.670    25.6 8.66 e- 84
#>  6 7soopj~3451 (Intercept)     26.3      0.490    53.8 1.70 e-176
#>  7 9VUkAq~8655 (Intercept)     22.2      0.499    44.6 2.48 e-150
#>  8 At886V~0359 (Intercept)     17.1      0.666    25.7 3.34 e- 84
#>  9 BEJI92~5483 (Intercept)     15.8      0.370    42.7 1.000e-144
#> 10 CGzoYe~1248 (Intercept)     18.2      0.537    34.0 1.84 e-115
#> # ℹ 140 more rows