run.qr.permutation.threshold.mediation.scans: Runs mediation permutation scans for significance thresholds...

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

run.qr.permutation.threshold.mediation.scansR Documentation

Runs mediation permutation scans for significance thresholds based on an index permutation matrix object, the phenotype data, and pre-computed QR decompositions for all the models.

Description

This function runs permutation scans in order to calculate significance thresholds for mediation analysis. Its results are most valid when done in a fixed effect model setting and observations are exchangeable.

Usage

run.qr.permutation.threshold.mediation.scans(
  perm.ind.matrix,
  mediation.qr.object,
  genomecache,
  phenotype,
  data,
  keep.full.scans = FALSE,
  scan.index = NULL,
  id = "SUBJECT.NAME",
  chr = "all",
  use.progress.bar = TRUE,
  pos.is.bp = TRUE,
  ...
)

Arguments

perm.ind.matrix

Output object from generate.qr.permutation.index.matrix().

mediation.qr.object

Output object from extract.mediation.qr().

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.

phenotype

The column name (or function of column name) of a variable in data. This will become the outcome of the genome scan.

data

A data frame with outcome 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 id.

keep.full.scans

DEFAULT: FALSE. If TRUE, all p-values are kept from all loci. If FALSE, only the minimum p-value is kept from each scan, greatly reducing size of output.

scan.index

DEFAULT: NULL. If NULL, all permutations are run. Integer vector can be specified to run just a subset of the permutations.

id

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

chr

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

use.progress.bar

DEFAULT: FALSE. Results in a progress bar while code runs.

pos.is.bp

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

Examples

run.qr.permutation.threshold.mediation.scans()

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