Arguments For A TWAS Weight-Fitting Engine
Source:R/regularizedRegressionWrappers.R
twasEngineOptions.RdOptions forwarded to the engine behind a TWAS weight method,
checked against that engine's live formals where it enumerates them. Pass
the result as an element of TwasWeightsMethodsParam, or
directly to the matching weights function.
A method's individual-level and summary-statistic paths often run
DIFFERENT engines, and then each takes its own constructor:
lassoWeights fits with glmnet (GlmnetOptions) while
lassosumRssWeights runs pecotmr's lassosum solver
(LassosumOptions); scadWeights / mcpWeights /
l0learnWeights use ncvreg and L0Learn while their *Rss
counterparts use PenalizedRssOptions; dprGibbsWeights uses
RcppDPR and sdprWeights uses SdprOptions. Splitting them is
what lets each be checked exactly, rather than against a union in which
an option meant for the other path would pass and then be dropped.
GlmnetOptions, NcvregOptions and DprOptions cannot
check for an UNKNOWN name: cv.glmnet, cv.ncvreg and
fit_model each take ..., so they accept any name and there
is nothing to check against. Every other constructor here rejects an
unknown option. Separately, and in all of them, a name pecotmr supplies
itself is refused — GlmnetOptions(alpha=) and
NcvregOptions(penalty=) select the penalty family, which is the
calling wrapper's to set. See MethodOptions.
GlmnetOptions rejects two names by hand, which the ...
check above would otherwise let through in silence. nfold is not
a cv.glmnet argument at all — the fold count is nfolds,
and the shorter spelling only ever worked through R's partial matching.
parallel is a real one, but pecotmr does not expose it: glmnet
parallelises over its CV folds through a foreach backend that
this package neither declares nor registers, and weight fitting already
runs inside BiocParallel workers over the same folds, so
enabling it would nest two frameworks and oversubscribe the machine.
The glasso and univariate-glmnet mr.mash initialisations are
single-threaded for the same reason.
Usage
GlmnetOptions(...)
QggOptions(...)
BglrOptions(...)
DprOptions(...)
NcvregOptions(...)
L0learnOptions(...)
MrashOptions(...)
MrashRssOptions(...)
PrsCsOptions(...)
LassosumOptions(...)
PenalizedRssOptions(...)
SdprOptions(...)
MrmashOptions(...)
MrmashRssOptions(...)Value
A MethodOptions object.
Examples
GlmnetOptions(nfolds = 10)
#> <MethodOptions: glmnet>
#> forwarded to glmnet::cv.glmnet()
#> argument names NOT checked: glmnet::cv.glmnet() takes `...`, so any name is accepted
#> for input class QtlDataset
#> nfolds 10
QggOptions(updateB = TRUE)
#> <MethodOptions: qgg>
#> forwarded to qgg::gbayes()
#> argument names checked against qgg::gbayes()
#> for input class QtlDataset
#> updateB TRUE
LassosumOptions(thr = 1e-4)
#> <MethodOptions: lassosum>
#> forwarded to pecotmr::lassosumRss()
#> argument names checked against pecotmr::lassosumRss()
#> for input class QtlSumStats
#> thr 1e-04