View source: R/gng.plot.comp.R
gng.plot.comp | R Documentation |
Plot each estimated individual components of GNG model
(mixture of exponential and k-normal) fitted using gng.fit
.
gng.plot.comp(data, obj, new.plot = TRUE, legpos = NULL, xlim=NULL, ylim=NULL, xlab=NULL, ylab=NULL, main=NULL,lwd=NULL,...)
data |
an R list of vector of normalized intensities (counts). Each element can correspond to a particular chromosome. User can construct their own list containing only the chromosome(s) they want to analyze. |
obj |
a list object returned by |
new.plot |
optional logical variable on whether to create new plot. |
legpos |
optional vector of (x,y) location for the legend position |
xlim |
optional x-axis limit (see |
ylim |
optional y-axis limit (see |
xlab |
optional x-axis label (see |
ylab |
optional y-axis label (see |
main |
optional plot title (see |
lwd |
optional line width for lines in the plot (see |
... |
additional graphical arguments to be passed to methods (see |
The components representing differential data are denoted by asterisk (*) symbol on the plot legend.
Cenny Taslim taslim.2@osu.edu, with contributions from Abbas Khalili khalili@stat.ubc.ca, Dustin Potter potterdp@gmail.com, and Shili Lin shili@stat.osu.edu
gng.plot.mix
, gng.plot.comp
, gng.plot.fit
,
gng.plot.qq
, DIME.plot.fit
, inudge.plot.fit
.
library(DIME); # generate simulated datasets with underlying exponential-normal components N1 <- 1500; N2 <- 500; K <- 4; rmu <- c(-2.25,1.50); rsigma <- c(1,1); rpi <- c(.05,.45,.45,.05); rbeta <- c(12,10); set.seed(1234); chr1 <- c(-rgamma(ceiling(rpi[1]*N1),shape = 1,scale = rbeta[1]), rnorm(ceiling(rpi[2]*N1),rmu[1],rsigma[1]), rnorm(ceiling(rpi[3]*N1),rmu[2],rsigma[2]), rgamma(ceiling(rpi[4]*N1),shape = 1,scale = rbeta[2])); chr2 <- c(-rgamma(ceiling(rpi[1]*N2),shape = 1,scale = rbeta[1]), rnorm(ceiling(rpi[2]*N2),rmu[1],rsigma[1]), rnorm(ceiling(rpi[3]*N2),rmu[2],rsigma[2]), rgamma(ceiling(rpi[4]*N2),shape = 1,scale = rbeta[2])); chr3 <- c(-rgamma(ceiling(rpi[1]*N2),shape = 1,scale = rbeta[1]), rnorm(ceiling(rpi[2]*N2),rmu[1],rsigma[1]), rnorm(ceiling(rpi[3]*N2),rmu[2],rsigma[2]), rgamma(ceiling(rpi[4]*N2),shape = 1,scale = rbeta[2])); # analyzing only chromosome 1 and chromosome 3 data <- list(chr1,chr3); # Fitting a GNG model with 2-normal component bestGng <- gng.fit(data,K=2); # plot individual components of GNG gng.plot.comp(data,bestGng); # plot mixture component on top of the individual components plot gng.plot.mix(bestGng,resolution=1000,new.plot=FALSE);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.