Skip to contents

Extract phenotype data from an object that carries it. For a QtlDataset, the user can optionally select specific contexts, traits, or a region (see method documentation for the per-class selection arguments).

Usage

getPhenotypes(x, ...)

# S4 method for class 'QtlDataset'
getPhenotypes(
  x,
  contexts,
  traitId = NULL,
  region = NULL,
  naAction = c("keep", "drop", "impute"),
  outlierAction = c("keep", "drop"),
  outlierPvalThreshold = 0.001,
  ...
)

Arguments

x

The object to extract from.

...

Class-specific selection arguments (e.g., contexts, traitId, region).

contexts

Character vector. Context(s) whose data to extract.

traitId

Character or NULL. Molecular trait / feature identifier to select; NULL matches all traits in the dataset.

region

Character (length 1, "chr:start-end") or NULL. Restrict variants to this region; NULL uses the full cis window / all regions.

naAction

Character. How to handle missing phenotype values: one of "keep", "drop", or "impute".

outlierAction

Character. How to handle phenotype outliers: one of "keep" or "drop".

outlierPvalThreshold

Numeric. Two-sided p-value threshold for flagging phenotype outliers. Default 1e-3.

Value

A named list of phenotype matrices or SummarizedExperiment objects.

Examples

data(qtlDatasetExample)
getPhenotypes(qtlDatasetExample, contexts = "brain")
#> class: RangedSummarizedExperiment 
#> dim: 1 165 
#> metadata(0):
#> assays(1): expression
#> rownames(1): ENSG_example
#> rowData names(0):
#> colnames(165): NA06989 NA11891 ... NA10854 NA12865
#> colData names(2): sex age