Learn R Programming

polySegratioMM (version 0.6-2)

runSegratioMM: Run a Bayesian mixture model for marker dosage with minimal effort

Description

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. Returns an object of S3 class runJagsWrapper

Usage

runSegratioMM(seg.ratios, model, priors = setPriors(model),
 inits = setInits(model, priors), jags.control =
 setControl(model, stem, burn.in = burn.in, sample = sample, thin = thin),
 burn.in = 2000, sample = 5000, thin = 1, stem = "test", fix.one = TRUE,
 print = TRUE, plots = TRUE, print.diagnostics = TRUE,
 plot.diagnostics = TRUE, run.diagnostics.later=FALSE )

Arguments

seg.ratios
Object of class segRatio contains the segregation ratios for dominant markers and other information such as the number of dominant markers per individual
model
object of class modelSegratioMM specifying model parameters, ploidy etc
priors
object of class priorsSegratioMM indicating priors that are vague, strong or specified
inits
A list of initial values usually produced by setInits
jags.control
Object of class jagsControl containing MCMC burn in, sample and thinning as well as relavant files for BUGS commands, inits and data
burn.in
size of MCMC burn in (Default: 2000)
sample
size of MCMC sample (default: 5000)
thin
thinning interval between consecutive observations (default: 1 or no thinning)
stem
text to be used as part of JAGS .cmd file name
fix.one
Logical to fix the dosage of the observation closest to the centre of each component on the logit scale. This can greatly assist with convergence (Default: TRUE)
print
logical for printing monitoring and summary information (default: TRUE)
plots
logical to plotting MCMC posterior distributions (default: TRUE)
print.diagnostics
logical for printing disagnostic statistics (default: TRUE)
plot.diagnostics
logical for diagnostic plots (default: TRUE)
run.diagnostics.later
should diagnostics be run later which may help if there are convergence problems (Default: FALSE)

Value

  • Returns object of class runJagsWrapper with components
  • seg.ratiosObject of class segRatio contains the segregation ratios for dominant markers
  • modelobject of class modelSegratioMM specifying model parameters, ploidy etc
  • priorsObject of class priorsSegratioMM specifying prior distributions
  • initsA list of initial values usually produced by setInits
  • jags.controlObject of class jagsControl containing MCMC burn in, sample and thinning as well as relavant files for BUGS commands, inits and data
  • stemtext to be used as part of JAGS .cmd file name and other files
  • fix.oneLogical to fix the dosage of the observation closest to the centre of each component on the logit scale. This can greatly assist with convergence (Default: TRUE)
  • run.jagsobject of class runJAGS produced by running JAGS
  • mcmc.mixtureObject of type segratioMCMC produced by coda usually by using readJags
  • diagnosticslist containing various diagnostic summaries and statistics produced by coda
  • summarysummaries of posterior distributions of model parameters
  • dosesobject of class dosagesMCMC containing posterior probabilities of dosages for each marker dosage and allocated dosages
  • DICDeviance Information Critereon

concept

  • segregation ratio
  • dominant marker
  • autopolyploid

See Also

setPriors setInits expected.segRatio segRatio setControl dumpData dumpInits and diagnosticsJagsMix

Examples

Run this code
## simulate small autooctaploid data set
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=100,n.individuals=50)
##print(a1)
sr <-  segregationRatios(a1$markers)
x <- setModel(3,8)

## fit simple model in one hit

x.run <- runSegratioMM(sr, x, burn.in=200, sample=500)
print(x.run)

Run the code above in your browser using DataLab