Skip to contents

Build a single-study QtlDataset from a manifest describing one row per QTL context (or per trait x context). The manifest is a data.frame or a path to a delimited file (.csv -> CSV, else TSV). Column names may be snake_case or camelCase.

Usage

loadQtlDatasetFromManifest(
  manifest,
  study = NULL,
  genotypes = NULL,
  genotypeCovariates = NULL,
  scaleResiduals = TRUE,
  mafCutoff = 0,
  macCutoff = 0,
  xvarCutoff = 0,
  imissCutoff = 0,
  keepSamples = character(0),
  keepVariants = character(0),
  keepIndel = TRUE,
  transposeCovariates = FALSE
)

Arguments

manifest

A data.frame or a path to a manifest file. Recognised columns (canonical camelCase; snake_case aliases accepted): context (required), phenotypePath (required, bgzipped BED), covariatePath (optional, per-context covariates), and the single-valued study / genotypePath / genotypeCovariatePath.

study

Study identifier; reconciled with a study column.

genotypes

A genotype panel (see readGenotypes) or a genotype path/prefix; reconciled with a genotypePath column.

genotypeCovariates

A numeric matrix (samples x covariates) or a path to a covariate TSV; reconciled with a genotypeCovariatePath column.

scaleResiduals, mafCutoff, macCutoff, xvarCutoff

Pass-through QtlDataset arguments (stored as lazy QC slots).

imissCutoff, keepSamples, keepVariants, keepIndel

Pass-through QtlDataset arguments (stored as lazy QC slots).

transposeCovariates

Transpose covariate TSVs (QTLtools layout) before treating them as samples-as-rows.

Value

A QtlDataset object.

Examples

d <- system.file("extdata", "qtl_mini", package = "pecotmr")
manifest <- data.frame(context = "brain",
  phenotypePath = file.path(d, "example_geneexpr.bed.gz"),
  study = "s1", genotypePath = file.path(d, "example.chr22"))
loadQtlDatasetFromManifest(manifest = manifest, study = "s1")
#> QtlDataset for study 's1'
#>   1 context(s): brain
#>   16 unique traits across contexts
#>   Genotypes: plink1 @ /tmp/RtmppU8QTb/temp_libpath984aa04109/pecotmr/extdata/qtl_mini/example.chr22
#>   Genotype covariates: 0 cols
#>   Samples: 49
#>   Scale residuals: TRUE