polySegratioMM-package {polySegratioMM}R Documentation

Bayesian Mixture Models for Marker Dosage in Autopolyploids

Description

These functions provide tools for estimating marker dosage for dominant markers in regular autopolyploids via Bayesian mixture model. Wrappers are provided for generating MCMC samples using the JAGS software. Convergence diagnostics and posterior distribution densities are provided by the coda package.

Details

Package: polySegratioMM
Type: Package
Version: 0.6-4
Date: 2018-03-22
License: GPL-3

The simplest way to fit a model is to use runSegratioMM. Given segregation ratios and a ploidy level, a mixture model is constructed with default priors and initial values and JAGS run to produce an MCMC sample for statistical inference.

A standard model may be set up with setModel where two parameters are set, namely ploidy.level or the number of homologous chromosomes set either as a numeric or as a character string and also n.components or the number of components for mixture model (less than or equal to maximum number of possible dosages).

Vague or strong priors may be constructed automatically using setPriors. Plots of standard conjugate distributions may be obtained using DistributionPlotBinomial DistributionPlotGamma and DistributionPlotNorm.

If necessary, other operations like setting up initial values or the control files for JAGS may be set using setInits setControl dumpData dumpInits writeControlFile writeJagsFile. Once the BUGS files and JAGS control files are set up then JAGS may be run using runJags and results read using readJags.

Convergence diagnostics may be carried out using coda or the convenience wrapper diagnosticsJagsMix.

Dose allocation can be carried out using dosagesJagsMix.

Plots may be produced and objects printed and summarised using standard print and plot methods. Plots of theoretical binomial distributions with different ploidy levels and sample sizes may be obtained with plotFitted. In addition, plotFitted produces a lattice plot of the observed segregation ratios and fitted mixture model on the logit scale.

Author(s)

Peter Baker p.baker1@uq.edu.au

References

Examples

## simulate small autooctaploid data set of 100 markers for 50 individuals
## with %70 Single, %20 Double and %10 Triple Dose markers 
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=400,n.individuals=275)
##print(a1)
sr <-  segregationRatios(a1$markers)
x <- setModel(3,8)  # autooctapolid mode with 3 components

## Not run: 
## fit simple model in one hit with default priors, inits etc
## warning: this is too small an MCMC sample so should give inaccurate
## answers but it could still take quite a while
x.run <- runSegratioMM(sr, x, burn.in=2000, sample=5000)
print(x.run)

## plot observed segregation ratios, fitted model and expected distribution
plot(x.run, theoretical=TRUE)

## End(Not run)

[Package polySegratioMM version 0.6-4 Index]