plotFitted: Plot observed segregation ratios and fitted and theoretical...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotFitted.R

Description

Plots histogram of observed segregation ratios on logit scale along with scaled density of fitted components corresponding to dosage classes. Plots of expected theoretical distributions can be plotted with or without segregation ratio data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S3 method for class 'runJagsWrapper'
plot(x, theoretical=FALSE, ...)

plotFitted(seg.ratios, summary.mixture, add.random.effect=TRUE,
  theoretical=FALSE, model=NULL, theory.col="red",
  xaxis=c("logit","raw"), ylim=NULL, NCLASS=NULL, n.seq=100,
  xlab="logit(Segregation Ratio)", ylab="Density", density.plot=FALSE,
  fitted.lwd=2, fitted.col="blue", bar.col="lightgreen", cex=1,
  warnings = FALSE, main=NULL, ...)

plotTheoretical(ploidy.level=8, seg.ratios=NULL, n.components=NULL,
  expected.segratio=NULL, proportions=c(0.65,0.2,0.1,0.03,0.01,0.01, 0, 0),
  n.individuals=200, xaxis=c("raw","logit"),
  type.parents=c("heterogeneous","homozygous"), xlim=c(0,1),
  NCLASS=NULL, xlab="Segregation Ratio", ylab="Density",
  density.plot=FALSE, fitted.lwd=2, fitted.col="blue", cex=1,
  warnings = TRUE, main=NULL, ...)

Arguments

x

object of class runJagsWrapper produced by using runSegratioMM to set up and fit mixture model

seg.ratios

segregation ratios as class segRatio

summary.mixture

mcmc summary data produce by summary.segratioMCMC

add.random.effect

add random variance component to fitted distribution plot if model includes a random effect (default: TRUE)

theoretical

whether to plot the expected theoretical distribution under the fitted model (default: FALSE)

model

object of class modelSegratioMM specifying model if plotting expected theoretical distribution

theory.col

colour for expected theoretical distribution (default: "red")

ploidy.level

the number of homologous chromosomes

n.components

number of components for mixture model

expected.segratio

may be specified or automatically calculated from ploidy level etc

xaxis

whether to plot on "logit" or "raw" scale. Defaults to "logit" if plotting segregation ratios or "raw" for theoretical distributions

proportions

for no. of markers in each component of theoretical distribution plot

n.individuals

for theoretical distribution plot - taken from segregation ratios if supplied

type.parents

"heterogeneous" if parental markers are 0,1 or "homogeneous" if parental markers are both 1

ylim

c(lower,upper) yaxis limits for histogram of segregation ratios

xlim

c(lower,upper) xaxis limits for segregation ratios

NCLASS

number of classes for histogram (Default: 100)

n.seq

number of points to use for plotting fitted mixture

xlab

x-axis label

ylab

y-axis label

density.plot

whether to plot a smoothed density as well as segregation data and fitted and/or theoretical distributions (default: FALSE)

main

title for plot

fitted.lwd

width for fitted line

fitted.col

colour for fitted line

bar.col

colour for histogram

cex

character expansion for text (see par)

warnings

print warnings like number of components etc (Default: FALSE)

...

extra options for plot

Details

plotFitted plot histogram of observed segregation ratios on logit scale along with scaled density of fitted components corresponding to dosage classes using trellis

plotTheoretical plot expected distribution of autopolyploid dominant markers on probability (0,1) scale. Segregation ratios may also be plotted

plot.runJagsWrapper plots the fitted values of object of class runJagsWrapper which has been produced by using runSegratioMM to set up and fit mixture model

Note that since trellis graphics are employed, plots may need to be printed in order to see them

Value

None.

Author(s)

Peter Baker p.baker1@uq.edu.au

See Also

summary.mcmc mcmc segratioMCMC readJags diagnosticsJagsMix runSegratioMM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## simulate small autooctaploid data set
plotTheoretical(8, proportion=c(0.7,0.2,0.1),n.individuals=50)
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 and summarise
## Not run: 
x.run <- runSegratioMM(sr, x, burn.in=200, sample=500)
print(x.run)

## plot fitted model using 'plotFitted'
plotFitted(sr, x.run$summary)
a.plot <- plotFitted(sr, x.run$summary, density.plot=TRUE)
print(a.plot)
## or the easier way
plot(x.run, theoretical=TRUE)

## End(Not run)

polySegratioMM documentation built on May 2, 2019, 9:49 a.m.