Skip to contents

Adds an entry to the prolfqua facade registry so that lookup_facade (and downstream consumers such as prolfquapp::R6_DEAnalyse$build_facade()) can resolve it by short name. Intended for downstream packages that ship additional modelling backends (e.g. prolfquasaint) and want to plug into the same dispatch path as the built-in facades.

Usage

register_facade(
  name,
  class,
  needs,
  package = "prolfqua",
  needs_saint_annotation = FALSE,
  ...
)

Arguments

name

short method name, e.g. "saint"; the names of the built-in methods ("lm", "limma", ...) are refused.

class

character; R6 facade class name to instantiate.

needs

the input the facade takes: "aggregated" (input at the level of the contrasts, subject_id equal to the hierarchy keys, e.g. protein -> protein FC, peptide -> peptide FC) or "nested" (child-level input, parent-level contrasts, e.g. peptide -> protein FC). Any other value is an error. It must match the class: a facade class for nested input sets its private field .needs = "nested", because the class checks its input shape itself.

package

package the facade class lives in. Defaults to "prolfqua".

needs_saint_annotation

TRUE if the backend requires annotation reading in SAINT mode (bait / control columns). Default FALSE.

...

additional fields stored on the registry entry, available to consumers via lookup_facade.

Value

The registered entry (invisibly).

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_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, sigma.rfit_prolfqua(), strategy_limma(), strategy_limpa(), strategy_logistf(), vcov.rfit_prolfqua()

Examples

lookup_facade("lm")$class
#> [1] "ContrastsLMFacade"
# downstream packages call this from .onLoad():
# prolfqua::register_facade("saint", class = "ContrastsSAINTFacade",
#                           needs = "aggregated", package = "prolfquasaint",
#                           needs_saint_annotation = TRUE)