Skip to contents

Residualize the per-context phenotype matrices against the per-context phenotype covariates and the genotype covariates, for one or more requested contexts.

Usage

getResidualizedPhenotypes(x, ...)

# S4 method for class 'QtlDataset'
getResidualizedPhenotypes(
  x,
  contexts,
  traitId = NULL,
  region = NULL,
  phenotypeCovariatesToResidualize = NULL,
  genotypeCovariatesToResidualize = NULL,
  residualizePhenotypeCovariates = TRUE,
  residualizeGenotypeCovariates = TRUE,
  residualizePhenotypeCovariatesFromPhenotypes = NULL,
  residualizeGenotypeCovariatesFromPhenotypes = NULL,
  naAction = c("keep", "drop", "impute"),
  covariateNaAction = c("impute", "drop"),
  outlierAction = c("keep", "drop"),
  outlierPvalThreshold = 0.001,
  ...
)

Arguments

x

A QtlDataset object.

...

Selection arguments: contexts (required), traitId, region, phenotypeCovariatesToRemove, genotypeCovariatesToRemove, and covariateNaAction ("impute", the default, mean-imputes missing covariate cells; "drop" removes samples with any missing covariate).

Value

A named list of numeric matrices keyed by context.