Description Usage Arguments Examples
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.
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, ...)
|
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 |
tname |
target name (default |
mname |
mediator name (default |
dname |
driver name (default |
centerline |
horizontal line at value (default = |
fitline |
include fit line from coefficients in |
main |
main title (defautl |
colors |
named colors to use if |
sdp |
SNP distribution pattern for plot colors |
allele |
Driver has alleles if |
... |
additional parameters for plotting |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.