What is regressed out of the phenotype and genotype before
fitting. Shared by fineMappingPipeline and
twasWeightsPipeline, which hold the same four settings.
fineMappingPipeline's usePCA / nPCs are
not here. They do not residualize anything: they PCA-reduce a
multi-trait context's phenotype matrix and fine-map each top principal
component as a trait. That is an analysis mode, a sibling of the
univariate and multivariate dispatch paths, not a covariate setting.
Usage
ResidualizationParam(
phenotypeCovariates = NULL,
genotypeCovariates = NULL,
residualizePhenotype = NULL,
residualizeGenotype = NULL,
scaleResiduals = NULL,
covariateNaAction = NULL
)Arguments
- phenotypeCovariates
Covariates to residualize the phenotype on, or
NULL(default) for the dataset's own.- genotypeCovariates
Covariates to residualize the genotype on, or
NULL(default) for the dataset's own.- residualizePhenotype
Logical. Residualize on the phenotype covariates.
NULL(default) means unset, which the accessors read asTRUE.- residualizeGenotype
Logical. Residualize on the genotype covariates.
NULL(default) means unset, read asTRUE.- scaleResiduals
Logical. Scale each residual column to unit variance, which is what puts a fitted effect on the standardized genotype scale.
NULL(default) means unset, and the accessors fall back to the dataset's ownscaleResidualsslot (itselfTRUEby default) — so this is the per-call override of a per-object default, and the only knob the pipelines need: it reachesresidualizedGenotypesalready, which is the one point every individual-level fit draws its genotypes through.- covariateNaAction
How missing covariate values are handled when the design is assembled:
"impute"or"drop".NULL(default) leaves the accessor's own default in place.
Value
A ResidualizationParam object, a MethodParam.
Summary-statistics inputs
A QtlSumStats / GwasSumStats input carries no genotypes
or covariates, so nothing here applies and the whole bundle is
ignored — not refused.
That is the opposite of CrossValidationParam, which
is refused on those inputs
(fineMappingPipeline(QtlSumStats, crossValidation = ...) errors).
The difference is the default: CV is off unless asked for
(folds = 0), so a non-default value on a summary-statistics run
is an explicit request for something impossible. Residualization is on
by default (residualizePhenotype and residualizeGenotype
are both TRUE), so refusing a non-default would reject the
default bundle and force every sumstats caller to unset it.
One bundle therefore travels to either input kind unchanged, the same
way CrossValidationParam's weightMethods /
maxVariants are carried but ignored by
fineMappingPipeline.