extract.mediation.qr: Pre-compute QR decompositions from genome cache for efficient...

View source: R/fixef.mediation.scan.R

extract.mediation.qrR Documentation

Pre-compute QR decompositions from genome cache for efficient fixed effect model mediation scans.

Description

This function calculates the QR decomposition for all null model and alternative models (per chromatin mediators) for a genome chromatin mediation scan. This is only possible with a model that does not include any random effects. Currently designed for chromatin mediation (measured by ATAC-seq), though could be generalized.

Usage

## S3 method for class 'mediation.qr'
extract(
  genomecache,
  id = "SUBJECT.NAME",
  pos.is.bp = TRUE,
  locus,
  data,
  formula,
  model = c("additive", "full"),
  condition.loci = NULL,
  chr = "all",
  use.progress.bar = TRUE
)

Arguments

genomecache

The path to the genome cache directory. The genome cache is a particularly structured directory that stores the haplotype probabilities/dosages at each locus. It has an additive model subdirectory and a full model subdirectory. Each contains subdirectories for each chromosome, which then store .RData files for the probabilities/dosages of each locus.

id

DEFAULT: "SUBJECT.NAME". The is the individual-level ID that is associated with data points in the phenotype data. This should be unique for each data point.

pos.is.bp

DEFAULT: TRUE. If the pos variable in data is bp, use the default. If it is Mb, then set to FALSE.

locus

The marker or interval at which the QTL is detected. For the mediation scan, the detected QTL is fit in the alternative model for each mediator.

data

A data frame with mediators and potential covariates. Should also have IDs that link to IDs in the genome cache, often with the individual-level ID named "SUBJECT.NAME", though others can be specified with pheno.id. Currently designed to filter data to the specified covariates and the chromatin variables.

formula

The right side of an lm-style formula with functions of covariates contained in data frame. First symbol should be "~". Functions of the outcome will be specified in mediation.scan.qr().

model

DEFAULT: "additive". Specifies how to model the founder haplotype probabilities. The additive options specifies use of haplotype dosages, and is most commonly used. The full option regresses the phenotype on the actual diplotype probabilities.

condition.loci

DEFAULT: NULL. If loci are specified, they will be included in the null and alternative models. The loci must be present in the genome cache. Alternatively, conditional scans can be accomplished by regressing out the loci effects with condition.out.locus.for.scan(), which does not require a new qr.object.

chr

DEFAULT: "all". Specifies which chromosomes to scan.

use.progress.bar

DEFAULT: TRUE. Results in a progress bar being displayed.

Examples

extract.mediation.qr()

gkeele/miqtl documentation built on June 13, 2022, 4:20 p.m.