genomePlot {RJaCGH} | R Documentation |
Plot of the genome showing, with a color key, the marginal probability of every gene of alteration.
genomePlot(obj, array=NULL, weights=NULL, col = NULL, breakpoints = NULL, legend.pos=NULL,...)
obj |
An object of class RJaCGH.Chrom, RJaCGH.Genome or RJaCGH.array. |
array |
Name of the array to be plotted. If NULL, the weigthed average of all is computed. |
weights |
vector of weights for each array. Must have the length of the number of arrays. If NULL, the weights are uniform. |
col |
A vector of length k for the color of every range of probabilities of alteration, starting from loss to gain. |
breakpoints |
A vector of length k-1 for the breakpoints of the color key. The corresponding to losses must be negative. See example for details. |
legend.pos |
Position of the legend. Must be a vector with two
elements; the position of the x and y coordinates. If NULL ,
the legend is placed at the right. |
... |
Aditional parameters passed to plot. |
If col
and breakpoints
are NULL
, a default
color key is drawn.
A plot is drawn.
The positions of the genes should be relative to the chromosome for the plot to make sense.
Oscar M. Rueda and Ramon Diaz Uriarte
Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122
data(snijders) y <- gm13330$LogRatio[!is.na(gm13330$LogRatio)] Pos <- gm13330$PosBase[!is.na(gm13330$LogRatio)] Chrom <- gm13330$Chromosome[!is.na(gm13330$LogRatio)] ## Sort positions for (i in unique(Chrom)) { if(any(diff(Pos[Chrom==i]) < 0)) { id <- order(Pos[Chrom==i]) y[Chrom==i] <- y[Chrom==i][id] Pos[Chrom==i] <- Pos[Chrom==i][id] } } jp <- list(sigma.tau.mu=rep(0.05, 4), sigma.tau.sigma.2=rep(0.03, 4), sigma.tau.beta=rep(0.07, 4), tau.split.mu=0.1, tau.split.beta=0.1) fit.genome <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Genome", burnin=1000, TOT=1000, jump.parameters=jp, k.max = 4) genomePlot(fit.genome) genomePlot(fit.genome, col=c(3, 1, 2), breakpoints=c(-0.5, 0.5))