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,
  studyName = NULL,
  genotypes = NULL,
  genotypeCovariates = NULL,
  scaleResiduals = TRUE,
  genotypeFilterParam = GenotypeFilterParam(),
  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.

studyName

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

Pass-through QtlDataset argument.

genotypeFilterParam

Pass-through QtlDataset filtering options, built with GenotypeFilterParam and 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, studyName = "s1")
#> QtlDataset for study 's1'
#>   1 context(s): brain
#>   16 unique traits across contexts
#>   Genotypes: plink1 @ /tmp/RtmpmBLZhq/temp_libpathaae388f3498/pecotmr/extdata/qtl_mini/example.chr22
#>   Genotype covariates: 0 cols
#>   Samples: 49
#>   Scale residuals: TRUE