plot.model: Plot the results of a hierarchical Bayesian model

Description Usage Arguments Details Examples

Description

Plot the results of a hierarchical Bayesian model

Usage

1
2
3
4
5
## S3 method for class 'hierarchicalBayesianModel'
plot(x, allFounderNames, chainIndex, ...)

## S3 method for class 'magicHeuristicHBC'
plot(x, allFounderNames, chainIndex, ...)

Arguments

x

An object of class hierarchicalBayesianModel (generated by fitClusterModel) or magicHeuristicHBC (generated by runHeuristics).

allFounderNames

Optional list of the names of the founder lines replicates within the genetic data.

chainIndex

The index of the MCMC chain to show.

...

Extra arguments to these functions are ignored.

Details

This function plots the result of using the end-point of one of the Markov chains as a fitted model. Homozygote clusters are shown in red and green, and the heterozygote cluster in dark blue. Light blue represents points falling in the outlier cluster. Black points are unclassified. Ovals represent the covariance matrixces of the homozygote and heterozygote clusters. If Input allfounderNames is input, then the founding lines of the population are given a different shape, and shown in black.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data("eightWayExampleData", package="magicCalling")
data <- eightWayExampleData[[1]]
meanY <- mean(data[,2])
startingPoints <- list(
 rbind(c(0.5, meanY), c(0.5, meanY)),
     rbind(c(0.5, meanY), c(0.5, meanY)),
     rbind(c(0.25, meanY), c(0.5, meanY)),
     rbind(c(0.25, meanY), c(0.5, meanY)),
     rbind(c(0.75, meanY), c(0.5, meanY)),
     rbind(c(0.75, meanY), c(0.5, meanY)),
     rbind(c(0.8, meanY), c(0.2, meanY)),
     rbind(c(0.8, meanY), c(0.2, meanY))
)
result <- fitClusterModel(data, startingPoints, n.iter = 200, D_hom = diag(2)*4, V_hom = cbind(c(0.005, 0), c(0, 0.1))/3, n_hom = 30, D_err = diag(2), V_err = diag(2)*10/3, n_err = 300, V_het = diag(2)*0.025/3, n_het = 1500)
plot(result, chainIndex = 1)
heuristicResults <- runHeuristics(result, minHomozygoteSize = 200)
plot(heuristicResults, chainIndex = heuristicResults$chainIndex)

rohan-shah/magicCalling documentation built on Jan. 3, 2020, 6:28 p.m.