mediation_triad: Triad scatter plot for mediator and target

Description Usage Arguments Examples

Description

Triad plot. Currently relies on sdp to provide lines, but want to use coefficients from model fit with mediation_test to get lines for each column of driver. Note that the plot uses column info to provide additional information, which here is the chr of mediator. The plot uses the mediator position on its home chromosome, which is not really what is wanted. See package qtl2shiny for a more elegant use.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mediation_triad(target, mediator, driver, covar_tar = NULL,
  covar_med = NULL, kinship = NULL, fitFunction = fitQtl2, ...)

ggplot_mediation_triad(x, tname = "target", mname = "mediator",
  dname = "driver", centerline = NULL, fitline = FALSE,
  main = paste(tname, "by", mname, "and", dname),
  colors = qtl2::CCcolors, ...)

## S3 method for class 'mediation_triad'
autoplot(object, ...)

## S3 method for class 'mediation_triad'
plot(x, ...)

Arguments

target

vector or 1-column matrix with target values

mediator

vector or 1-column matrix with mediator values

driver

vector or matrix with driver values

covar_tar

optional covariates for target

covar_med

optional covariates for mediator

kinship

optional kinship matrix among individuals

fitFunction

function to fit models with driver, target and mediator

...

additional arguments to internal routine

x

object of class mediation_triad

tname

target name (default "target")

mname

mediator name (default "mediator")

dname

driver name (default "driver")

centerline

horizontal line at value (default = NULL); set to NA for no line or NULL for mean

fitline

include fit line from coefficients in x if TRUE

main

main title (defautl tname)

colors

named colors to use if fitline is TRUE

sdp

SNP distribution pattern for plot colors

allele

Driver has alleles if TRUE, otherwise allele pairs.

...

additional parameters for plotting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(Tmem68)
target <- cbind(Tmem68 = Tmem68$target)
# Pick strongest mediator that is not target.
m <- match("Nnt", Tmem68$annotation$symbol)
mediator <- Tmem68$mediator[, m, drop = FALSE]
colnames(mediator) <- "Nnt"
# Reconstruct 8-allele genotype probabilities.
driver <- cbind(A = 1 - apply(Tmem68$qtl.geno, 1, sum), Tmem68$qtl.geno)
rownames(driver) <- rownames(Tmem68$qtl.geno)

med_triad <- mediation_triad(target = target,
                      mediator = mediator,
                      driver = driver,
                      covar_tar = Tmem68$covar,
                      sdp = 2)
ggplot2::autoplot(med_triad, tname = "Tmem68", mname = "Nnt")

fboehm/qtl2mediate documentation built on June 18, 2019, 8:27 p.m.