nudge.plot.fit: Plot NUDGE Goodness of Fit

nudge.plot.fitR Documentation

Plot NUDGE Goodness of Fit

Description

Plot the estimated NUDGE mixture model fitted using nudge.fit along with it's estimated individual components, superimposed on the histogram of the observation data. This plot shows how good the fit of the estimated model to the data.

Usage

nudge.plot.fit(data, obj, resolution = 100, breaks = 100, 
xlim = NULL, legpos = NULL, ...)

Arguments

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 nudge.fit function.

resolution

optional bandwidth used to estimate the density function. Higher number smoother curve.

breaks

optional see hist, breaks parameters for histogram plot.

xlim

optional limit for the x-axis.

legpos

optional vector of (x,y) location for the legend position

...

additional graphical arguments to be passed to methods (see par).

Details

The components representing differential data are denoted by asterisk (*) symbol on the plot legend.

See Also

nudge.plot.comp, nudge.plot.mix, hist

Examples

library(DIME);
# generate simulated datasets with underlying uniform and 1-normal components
set.seed(1234);
N1 <- 1500; N2 <- 500; rmu <- c(1.5); rsigma <- c(1); 
rpi <- c(.10,.90); a <- (-6); b <- 6; 
chr1 <- c(-runif(ceiling(rpi[1]*N1),min = a,max =b),
  rnorm(ceiling(rpi[2]*N1),rmu[1],rsigma[1]));
chr4 <- c(-runif(ceiling(rpi[1]*N2),min = a,max =b),
  rnorm(ceiling(rpi[2]*N2),rmu[1],rsigma[1]));  
# analyzing chromosome 1 and 4
data <- list(chr1,chr4);

# fit NUDGE model with maximum iterations = 20
set.seed(1234);
bestNudge <- nudge.fit(data, max.iter=20);

# goodness of fit plot
nudge.plot.fit(data,bestNudge,breaks=40);


DIME documentation built on May 9, 2022, 5:05 p.m.