# NOT RUN {
# (1) a toy example (a very small subsample of a microarray data set)
#
datafilename <- system.file("extdata", "transcripto_very_small_sample.txt", package="DRomics")
# to test the package on a small (for a quick calculation) but not very small data set
# use the following commented line
# datafilename <- system.file("extdata", "transcripto_sample.txt", package="DRomics")
o <- microarraydata(datafilename, check = TRUE, norm.method = "cyclicloess")
s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.05)
f <- drcfit(s_quad, progressbar = TRUE)
# Default plot
plot(f)
# }
# NOT RUN {
# The same plot with log transformation of the doses
plot(f, dose_log_transfo = TRUE)
# The same plot in x log scale choosing x limits for plot
if (require(ggplot2))
plot(f, dose_log_transfo = TRUE) +
scale_x_log10(limits = c(0.1, 10))
# Plot of residuals as function of the dose
plot(f, plot.type = "dose_residuals")
# Same plot of residuals with log transformation of the doses
plot(f, plot.type = "dose_residuals", dose_log_transfo = TRUE)
# plot of residuals as function of the fitted value
plot(f, plot.type = "fitted_residuals")
# (2) an example on a microarray data set (a subsample of a greater data set)
#
datafilename <- system.file("extdata", "transcripto_sample.txt", package="DRomics")
(o <- microarraydata(datafilename, check = TRUE, norm.method = "cyclicloess"))
(s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.05))
(f <- drcfit(s_quad, progressbar = TRUE))
# Default plot
plot(f)
# Plot of the fit of the first 12 most responsive items
plot(f, items = 12)
# Plot of the chosen items in the chosen order
plot(f, items = c("301.2", "363.1", "383.1"))
# Look at the table of results for successful fits
head(f$fitres)
# Look at the table of results for unsuccessful fits
head(f$unfitres)
# (3) Comparison of parallel and non paralell implementations on a
# larger selection of items
#
s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.05)
system.time(f1 <- drcfit(s_quad, progressbar = TRUE))
system.time(f2 <- drcfit(s_quad, progressbar = FALSE, parallel = "snow", ncpus = 2))
# }
Run the code above in your browser using DataLab