Skip to contents

Residualize the genotype matrix against the per-context phenotype covariates and the genotype covariates, optionally subsetting variants to those falling within a trait's cis-window or an explicit region.

Usage

getResidualizedGenotypes(x, ...)

# S4 method for class 'QtlDataset'
getResidualizedGenotypes(
  x,
  contexts,
  traitId = NULL,
  region = NULL,
  cisWindow = NULL,
  samples = NULL,
  phenotypeCovariatesToResidualize = NULL,
  genotypeCovariatesToResidualize = NULL,
  residualizePhenotypeCovariates = TRUE,
  residualizeGenotypeCovariates = TRUE,
  residualizePhenotypeCovariatesFromGenotypes = NULL,
  residualizeGenotypeCovariatesFromGenotypes = NULL,
  covariateNaAction = c("impute", "drop"),
  ...
)

Arguments

x

A QtlDataset object.

...

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

Value

A numeric matrix (samples x variants).