Learn R Programming

RJaCGH (version 1.5.7)

plot.RJaCGH: 'plot' method for RJaCGH objects

Description

A plot is drawed with information from the fit of a RJaCGH object.

Usage

## S3 method for class 'RJaCGH':
plot(x, k = NULL, model.averaging = TRUE, cex=1,
smoother=FALSE, \ldots)
## S3 method for class 'RJaCGH.Chrom':
plot(x, Chrom="Genome", model.averaging=TRUE,
cex=1, k=NULL, smoother=FALSE, \ldots)
## S3 method for class 'RJaCGH.Genome':
plot(x, k=NULL, model.averaging=TRUE, cex=1,
smoother=FALSE, \ldots)
## S3 method for class 'RJaCGH.array':
plot(x, show="frequency", weights=NULL, cex=1,
smoother=FALSE, \ldots)

Arguments

x
any of RJaCGH, RJaCGH.Chrom, RJaCGH.Genome, RJaCGH.array objects
k
Model to plot (i.e., number of hidden states). If NULL, the most visited is taken.
cex
A numerical value giving the amount by which plotting text and symbols should be scaled relative to the default.
model.averaging
if TRUE, model.averaging is performed. If FALSE, a call to link{states} is made to get hidden state sequence.
Chrom
For RJaCGH.chrom objects. If "Genome", a whole plot of the genome is shown. If a chromosome number, olnly the model corresponding to that chromosome. See details.
show
one of "average" or "frequency"
weights
vector of weights for each array. Must have the length of the number of arrays. If NULL, the weights are uniform.
smoother
Logical. Smoothed means by model averaging.
...
additional arguments passed to plot.

Value

  • A plot.

Details

Depending on the object, a different plot is drawed: If the object is RJaCGH or RJaCGH.Genome, a panel with 5 subplots is returned. The first one is a barplot with the posterior distribution of the number of hidden states. The second and third are a density plot of the posterior distribution of means and variances. The four one is the probability of staying in the same hidden state, as returned by plot.Q.NH, and the last one shows the original observations colored by thir hidden state and the probability of being in that hidden state.

On every plot, the 'Normal' state is coloured black. The 'Gain' states are red and the 'Loss' ones green.

If the object is 'RJaCGH.Chrom', only the last one of the plots are shown. For the complete panel, call the method on every chromosome.

If the object is 'RJaCGH.array' and show is 'average', the last one of the plots is drawn, but the hidden state sequence and its probability is computed averaging on all the arrays with weights according to weights vector. If show is 'frequency', again the last plot is drawn, but the percentage of arrays in which every gene is Gain/Lost is shown, weighted by the weights vector.

If smoother is TRUE, the smoothed mean is drawn. See smoothMeans (except in plot.RJaCGH.array when method is not 'averaging').

References

Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122

See Also

RJaCGH, smoothMeans, summary.RJaCGH, model.averaging, states, trace.plot, gelman.rubin.plot, collapseChain

Examples

Run this code
y <- c(rnorm(100, 0, 1), rnorm(10, -3, 1), rnorm(20, 3, 1), rnorm(100,
                                                                  0, 1))Pos <- sample(1:10, 230, replace=TRUE)
Pos <- cumsum(Pos)
Chrom <- rep(1:23, rep(10, 23))
jp <- list(sigma.tau.mu=rep(0.5, 4), sigma.tau.sigma.2=rep(0.3, 4),
           sigma.tau.beta=rep(0.7, 4), tau.split.mu=0.5)
fit.Chrom <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Chrom",
                    burnin=100, TOT=1000, jump.parameters=jp, k.max=4)
fit.Genom <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Genome", burnin=100, TOT=1000, jump.parameters=jp, k.max=4)
fit.none <- RJaCGH(y=y, Pos=Pos, Chrom=NULL, model="None",
                   burnin=100, TOT=1000, jump.parameters=jp, k.max=4)

plot(fit.Chrom)
plot(fit.Chrom[[1]])
plot(fit.Genom)
plot(fit.none)


y2 <- c(rnorm(100, 0, 1), rnorm(10, -3, 1), rnorm(20, 3, 1),
        rnorm(100, 0, 1))

ya <- cbind(y, y2)

fit.Chrom.array <- RJaCGH(y=ya, Pos=Pos, Chrom=Chrom, model="Chrom",
                          burnin=100, TOT=1000, jump.parameters=jp, k.max=4)
fit.Genom.array <- RJaCGH(y=ya, Pos=Pos, Chrom=Chrom, model="Genome", burnin=100, TOT=1000, jump.parameters=jp, k.max=4)
fit.none.array <- RJaCGH(y=ya, Pos=Pos, Chrom=NULL, model="None",
                         burnin=100, TOT=1000, jump.parameters=jp, k.max=4)

plot(fit.Chrom.array)
plot(fit.Genom.array)
plot(fit.none.array)

Run the code above in your browser using DataLab