Running 'examplewithNAvalues.R' [9s]
  Running 'examplewithRNAseq.R' [12s]
  Running 'examplewithanchoringdata.R' [9s]
  Running 'examplewithinsitudata.R' [9s]
  Running 'examplewithmetabolomic.R' [170s]
  Running 'examplewithmicroarray.R' [11s]
  Running 'examplewithnoreplicate.R' [167s]
  Running 'testAIC.R' [10s]
  Running 'test_selectgroups.R' [9s]
  Running 'testbmdcalc.R' [9s]
  Running 'testbmdplotwithgradient.R' [170s]
  Running 'testplotfit.R' [177s]
  Running 'testresidualtests.R' [9s]
  Running 'testscaling.R' [180s]
  Running 'testsensitivityplot.R' [180s]
  Running 'testthat.R' [185s]
Running the tests in 'tests/examplewithmetabolomic.R' failed.
Complete output:
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > doboot <- FALSE
  > 
  > # importation and check of metabolomic data
  > datafilename <- system.file("extdata", "metabolo_sample.txt", package="DRomics")
  > (o <- continuousomicdata(datafilename, check = TRUE))
  Elements of the experimental design in order to check the coding of the data:
  Tested doses and number of replicates for each dose:
  
     0 0.69  1.1 1.79 2.92 4.78 7.76 
    10    6    2    2    2    6    2 
  Number of items: 109 
  Identifiers of the first 20 items:
  
   [1] "P_2"  "P_4"  "P_5"  "P_6"  "P_7"  "P_10" "P_11" "P_12" "P_14" "P_16"
  [11] "P_19" "P_21" "P_22" "P_26" "P_32" "P_34" "P_35" "P_36" "P_37" "P_38"
  Warning message:
  In continuousomicdata(datafilename, check = TRUE) : 
  We recommend you to check that your omic data were correctly pretreated
  before importation. In particular data (e.g. metabolomic signal) should
  have been log-transformed, without replacing 0 values by NA values
  (consider using the half minimum method instead for example).
  > if (visualize)
  + plot(o)
  > 
  > # item selection using the quadratic method
  > # options to put in shiny : select.method (3 methods), FDR (numerical positive value < 1)
  > (s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.001))
  Removing intercept from test coefficients
  Number of selected items using a quadratic trend test with an FDR of 0.001: 15
  Identifiers of the responsive items:
   [1] "P_120"  "AP_M52" "P_135"  "P_78"   "AP_M78" "AP_M44" "AP_M54" "AP_M35"
   [9] "P_157"  "P_177"  "AP_M1"  "P_39"   "AP_M39" "P_62"   "AP_M12"
  > if (visualize)
  + {
  +   (s_lin <- itemselect(o, select.method = "linear", FDR = 0.001))
  +   (s_ANOVA <- itemselect(o, select.method = "ANOVA", FDR = 0.001))
  +   
  + }
  > 
  > # no options in shiny
  > (f <- drcfit(s_quad, progressbar = TRUE))
  The fitting may be long if the number of selected items is high.
  
    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |=====                                                                 |   7%
    |                                                                            
    |=========                                                             |  13%
    |                                                                            
    |==============                                                        |  20%
    |                                                                            
    |===================                                                   |  27%
    |                                                                            
    |=======================                                               |  33%
    |                                                                            
    |============================                                          |  40%
    |                                                                            
    |=================================                                     |  47%
    |                                                                            
    |=====================================                                 |  53%
    |                                                                            
    |==========================================                            |  60%
    |                                                                            
    |===============================================                       |  67%
    |                                                                            
    |===================================================                   |  73%
    |                                                                            
    |========================================================              |  80%
    |                                                                            
    |=============================================================         |  87%
    |                                                                            
    |=================================================================     |  93%
    |                                                                            
    |======================================================================| 100%
  Results of the fitting using the AICc to select the best fit model
  Distribution of the chosen models among the 15 fitted dose-response curves:
  
              Hill           linear      exponential     Gauss-probit 
                 0                6                8                1 
  log-Gauss-probit 
                 0 
  Distribution of the trends (curve shapes) among the 15 fitted dose-response curves:
  
    U dec inc 
    1   9   5 
  > f$fitres
         id irow    adjpvalue        model nbpar           b        c        d
  1   P_120   59 1.022669e-05       linear     2  0.14162429       NA 4.836753
  2  AP_M52  100 1.022669e-05  exponential     3  0.44676314       NA 6.849541
  3   P_135   69 1.182072e-05  exponential     3  0.04311356       NA 5.807941
  4    P_78   44 1.746189e-05  exponential     3  0.04861713       NA 5.758516
  5  AP_M78  109 2.452999e-05       linear     2 -0.04907406       NA 6.830002
  6  AP_M44   96 3.850161e-05       linear     2 -0.05828339       NA 7.316757
  7  AP_M54  101 2.019833e-04  exponential     3  0.40825132       NA 7.512451
  8  AP_M35   93 2.168516e-04  exponential     3  0.57880272       NA 6.781761
  9   P_157   74 2.756153e-04       linear     2  0.08013911       NA 4.332679
  10  P_177   79 2.756153e-04  exponential     3  0.03223247       NA 5.283958
  11  AP_M1   81 2.756153e-04  exponential     3  0.56848216       NA 5.880813
  12   P_39   21 7.332645e-04 Gauss-probit     4  1.76061106 6.065256 6.065256
  13 AP_M39   94 7.506425e-04       linear     2 -0.06388180       NA 6.691864
  14   P_62   35 8.377951e-04  exponential     3 -0.01448606       NA 5.270084
  15 AP_M12   85 9.166752e-04       linear     2 -0.04107552       NA 7.591279
              e          f      SDres      typology trend       y0 yatdosemax
  1          NA         NA 0.26453114         L.inc   inc 4.836753   5.935757
  2  -0.8989528         NA 0.12907637  E.dec.convex   dec 6.849541   6.402858
  3   2.6724129         NA 0.10662804  E.inc.convex   inc 5.807941   6.551317
  4   3.3406581         NA 0.08320269  E.inc.convex   inc 5.758516   6.206046
  5          NA         NA 0.07511639         L.dec   dec 6.830002   6.449187
  6          NA         NA 0.10624269         L.dec   dec 7.316757   6.864478
  7  -0.4369577         NA 0.15227062  E.dec.convex   dec 7.512451   7.104199
  8  -0.4796435         NA 0.22895443  E.dec.convex   dec 6.781761   6.202958
  9          NA         NA 0.21005208         L.inc   inc 4.332679   4.954559
  10  2.2690295         NA 0.17416352  E.inc.convex   inc 5.283958   6.237017
  11 -2.2721901         NA 0.20358047  E.dec.convex   dec 5.880813   5.331017
  12  0.5665977 -0.6516214 0.25511702          GP.U     U 5.446520   6.065102
  13         NA         NA 0.15734348         L.dec   dec 6.691864   6.196142
  14  1.9335368         NA 0.18516350 E.dec.concave   dec 5.270084   4.483012
  15         NA         NA 0.10465889         L.dec   dec 7.591279   7.272533
        yrange maxychange   xextrem  yextrem
  1  1.0990045  1.0990045        NA       NA
  2  0.4466835  0.4466835        NA       NA
  3  0.7433767  0.7433767        NA       NA
  4  0.4475295  0.4475295        NA       NA
  5  0.3808147  0.3808147        NA       NA
  6  0.4522791  0.4522791        NA       NA
  7  0.4082513  0.4082513        NA       NA
  8  0.5788027  0.5788027        NA       NA
  9  0.6218795  0.6218795        NA       NA
  10 0.9530600  0.9530600        NA       NA
  11 0.5497964  0.5497964        NA       NA
  12 0.6514669  0.6185823 0.5665977 5.413635
  13 0.4957227  0.4957227        NA       NA
  14 0.7870722  0.7870722        NA       NA
  15 0.3187460  0.3187460        NA       NA
  > if (visualize)
  + plot(f)
  > 
  > if (visualize)
  + {
  +   # evaluate the impact of preventsfitsoutofrange, enablesfequal0inGP, enablesfequal0inlGP
  +   data(Scenedesmus_metab)
  +   (o1 <- continuousomicdata(Scenedesmus_metab, check = TRUE))
  +   
  +   # datafilename <- system.file("extdata", "metabolo_sample.txt", package="DRomics")
  +   # (o1 <- continuousomicdata(datafilename, check = TRUE))
  +   s_quad1 <- itemselect(o1, select.method = "quadratic", FDR = 0.1)
  +   (f1 <- drcfit(s_quad1, 
  +                 preventsfitsoutofrange = FALSE,
  +                 enablesfequal0inGP  = FALSE,
  +                 enablesfequal0inLGP  = FALSE,
  +                 progressbar = TRUE))
  +   (f1bis <- drcfit(s_quad1, 
  +                    preventsfitsoutofrange = TRUE,
  +                    enablesfequal0inGP  = FALSE,
  +                    enablesfequal0inLGP  = FALSE,
  +                    progressbar = TRUE))
  +   (f1ter <- drcfit(s_quad1, 
  +                    preventsfitsoutofrange = TRUE,
  +                    enablesfequal0inGP  = TRUE,
  +                    enablesfequal0inLGP  = TRUE,
  +                    progressbar = TRUE))
  +   
  +   (idremovedinf1bis <- f1$fitres$id[!is.element(f1$fitres$id, f1bis$fitres$id)])
  + #  targetplot(items = idremovedinf1bis, f1) 
  +   
  +   (idchanged <- f1bis$fitres$id[which(f1bis$fitres$model != f1ter$fitres$model | 
  +                                         f1bis$fitres$f != f1ter$fitres$f)])
  +   # targetplot(items = idchanged, f1bis, dose_log_transfo = TRUE)
  +   # targetplot(items = idchanged, f1ter, dose_log_transfo = TRUE)
  +   
  +   f1bis$fitres[f1bis$fitres$id %in% idchanged, ]
  +   f1ter$fitres[f1ter$fitres$id %in% idchanged, ]
  +   # no impact on those data
  +   
  + }
  > 
  > 
  > 
  > if (visualize) 
  + {
  +   # various plot of fitted curves (without data)
  +   curvesplot(f$fitres, xmax = max(f$omicdata$dose), 
  +              facetby = "model", colorby = "model")
  +   
  +   curvesplot(f$fitres, xmax = max(f$omicdata$dose), 
  +              facetby = "typology")
  +   
  +   # plot of selection of curves
  +   curvesplot(f$fitres[f$fitres$trend == "U", ], xmax = max(f$omicdata$dose), 
  +              facetby = "id")
  +   
  + }
  > 
  > # calculation of benchmark doses
  > # options in shiny : z (numerical positive value), x (numerical positive value : percentage)
  > (r <- bmdcalc(f, z = 1, x = 10))
  4 BMD-xfold values and 0 BMD-zSD values are not defined (coded NaN as 
  the BMR stands outside the range of response values defined by the model).
  5 BMD-xfold values and 0 BMD-zSD values could not be calculated (coded 
  NA as the BMR stands within the range of response values defined by the 
  model but outside the range of tested doses).
  > if (visualize)
  + (r.2 <- bmdcalc(f, z = 2, x = 50))
  > 
  > # plot of BMD
  > # options in shiny : BMDtype (2 possibilities), plottype (3 possibilities), by (3 possibilities)
  > # hist.bins (integer for hist only)
  > if (visualize)
  + {
  +   plot(r, BMDtype = "zSD", plottype = "ecdf", by = "none")
  +   plot(r, BMDtype = "xfold", plottype = "ecdf", by = "none") 
  +   
  +   plot(r, plottype = "hist", by = "none", hist.bins = 10) 
  +   plot(r, plottype = "density", by = "none") 
  +   
  +   plot(r, plottype = "ecdf", by = "trend", hist.bins = 10) 
  +   
  + }
  > 
  > if (doboot)
  + {
  +   niter <- 1000
  +   niter <- 10
  +   
  +   # Calculation of confidence intervals on BMDs by Bootstrap
  +   b <- bmdboot(r, niter = niter) # niter should be fixed at least at 1000 to get a reasonable precision
  +   if (visualize)
  +     plot(b)
  +   
  + }
  > 
  > 
  > proc.time()
     user  system elapsed 
     9.12    0.85    9.96 
Running the tests in 'tests/examplewithnoreplicate.R' failed.
Complete output:
  > # Test DRomics on datasets without replicates and without control data
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > 
  > if (visualize)
  + {
  +   ## test of the selection step with limma
  +   data(Scenedesmus_metab)
  +   head(Scenedesmus_metab)
  +   set.seed(1234)
  + 
  +   # build of a dataset without 0 nor replicate
  +   Scenedesmus_metab2 <- Scenedesmus_metab[, c(1,14:25)]
  +   Scenedesmus_metab2[1, -1] <- Scenedesmus_metab2[1, -1] * runif(11, 0.9, 1.1)
  +   head(Scenedesmus_metab2)
  +   
  +   (oerror <- continuousomicdata(Scenedesmus_metab2)) ## should stop with an explicite error message
  +   
  +   # build of a dataset without replicate but with at least a 0
  +   Scenedesmus_metab2 <- Scenedesmus_metab[, c(1,14:25)]
  +   Scenedesmus_metab2[1, -1] <- Scenedesmus_metab2[1, -1] * runif(11, 0.9, 1.1)
  +   Scenedesmus_metab2[1, -1] <- Scenedesmus_metab2[1, -1]* (Scenedesmus_metab2[1, -1] > 1)
  +   head(Scenedesmus_metab2)
  +   
  +   (o <- continuousomicdata(Scenedesmus_metab))
  +   plot(o)
  +   (s <- itemselect(o, select.method = "quadratic"))
  +   (f <- drcfit(s))
  +   plot(f)
  +   
  +   (o2 <- continuousomicdata(Scenedesmus_metab2))
  +   plot(o2)
  +   (s2 <- itemselect(o2, select.method = "quadratic"))
  +   (f2 <- drcfit(s2))
  +   plot(f2)
  +   
  +   ## Test of the selection step with DESeq2
  +   data(Zhou_kidney_pce)
  +   head(Zhou_kidney_pce)
  +   Zhou <- Zhou_kidney_pce[1:1000, ]
  +   
  +   # build of a dataset without control nor replicate
  +   Zhou2 <- Zhou[, c(1, 4:15)]
  +   Zhou2[1, -1] <- Zhou2[1, -1] * runif(11, 0.9, 1.1)
  +   head(Zhou2)
  +   (oerror <- RNAseqdata(Zhou2))
  +   
  +   # build of a dataset without replicate
  +   Zhou2 <- Zhou[, c(1, 4:15)]
  +   Zhou2[1, -1] <- Zhou2[1, -1] * runif(11, 0.9, 1.1)
  +   Zhou2[1, -1] <- Zhou2[1, -1] * (Zhou2[1, -1] > 0.3)
  +   head(Zhou2)
  +   (o <- RNAseqdata(Zhou))
  +   plot(o)
  +   (s <- itemselect(o, select.method = "quadratic"))
  +   (f <- drcfit(s))
  +   plot(f, dose_log_transfo = TRUE)
  +   
  +   (o2 <- RNAseqdata(Zhou2))
  +   plot(o2)
  +   (s2 <- itemselect(o2, select.method = "quadratic"))
  +   (f2 <- drcfit(s2))
  +   plot(f2, dose_log_transfo = TRUE)
  +   
  + }
  > 
  > proc.time()
     user  system elapsed 
     7.85    0.76    8.70 
Running the tests in 'tests/testbmdplotwithgradient.R' failed.
Complete output:
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > 
  > if(visualize) 
  + {
  +   # (1) Plot of BMD values with color dose-response gradient
  +   # faceted by metabolic pathway (from annotation of the selected items)
  +   # and shaped by dose-response trend
  +   
  +   # An example from the paper published by Larras et al. 2020
  +   # in Journal of Hazardous Materials
  +   # https://doi.org/10.1016/j.jhazmat.2020.122727
  +   # A example of plot obtained with this function is in Figure 5 in Larras et al. 2020
  +   
  +   
  +   # the dataframe with metabolomic results (output $res of bmdcalc() or bmdboot() functions)
  +   resfilename <- system.file("extdata", "triclosanSVmetabres.txt", package="DRomics")
  +   res <- read.table(resfilename, header = TRUE, stringsAsFactors = TRUE)
  +   str(res)
  +   
  +   # the dataframe with annotation of each item identified in the previous file
  +   # each item may have more than one annotation (-> more than one line)
  +   annotfilename <- system.file("extdata", "triclosanSVmetabannot.txt", package="DRomics")
  +   annot <- read.table(annotfilename, header = TRUE, stringsAsFactors = TRUE)
  +   str(annot)
  +   
  +   # Merging of both previous dataframes
  +   # in order to obtain an extenderes dataframe
  +   extendedres <- merge(x = res, y = annot, by.x = "id", by.y = "metab.code")
  +   head(extendedres)
  +   
  +   
  +   ### (1.a) BMDplot with gradient by pathway
  +   bmdplotwithgradient(extendedres, BMDtype = "zSD",
  +                       facetby = "path_class", 
  +                       shapeby = "trend") 
  +   
  +   # (1.b) BMDplot with gradient by pathway and trend
  +   bmdplotwithgradient(extendedres, BMDtype = "zSD",
  +                       facetby = "path_class",
  +                       facetby2 = "trend") 
  +   
  +   # (1.b) BMDplot with gradient by pathway
  +   # forcing the limits of the colour gradient at other 
  +   # values than observed minimal and maximal values of the signal
  +   bmdplotwithgradient(extendedres, BMDtype = "zSD",
  +                       facetby = "path_class", 
  +                       shapeby = "trend",
  +                       limits4colgradient = c(-1, 1)) 
  +   
  +   # (1.c) The same example changing the gradient colors and the line size
  +   bmdplotwithgradient(extendedres, BMDtype = "zSD",
  +                       facetby = "path_class", 
  +                       shapeby = "trend",
  +                       line.size = 3, 
  +                       lowercol = "darkgreen", uppercol = "orange") 
  +   
  +   # (1.d) The same example with only lipid metabolism pathclass
  +   # and identification of the metabolites
  +   LMres <- extendedres[extendedres$path_class == "Lipid metabolism", ]
  +   bmdplotwithgradient(LMres, BMDtype = "zSD",
  +                       line.size = 3, 
  +                       add.label = TRUE, label.size = 3) 
  +  
  +    # (1.e) The same example with only membrane transport pathclass
  +   # and identification of the metabolites
  +   LMres <- extendedres[extendedres$path_class == "Membrane transport", ]
  +   bmdplotwithgradient(LMres, BMDtype = "zSD",
  +                       line.size = 3, 
  +                       add.label = TRUE, label.size = 3) 
  +   bmdplotwithgradient(LMres, BMDtype = "zSD", xmax = 7.76,
  +                       line.size = 3, 
  +                       add.label = FALSE, label.size = 3) 
  +   curvesplot(LMres, facetby = "id", xmax = 7.76, scaling = TRUE) 
  +   LMres[LMres$id == "NP_92", ]
  +   
  +   
  +   
  +   # (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.001))
  +   (f <- drcfit(s_quad, progressbar = TRUE))
  +   (r <- bmdcalc(f))
  +   
  +   bmdplotwithgradient(r$res, BMDtype = "zSD",
  +                       facetby = "trend", 
  +                       shapeby = "model") 
  +   bmdplotwithgradient(r$res, BMDtype = "zSD",
  +                       xmax = max(f$omicdata$dose), facetby = "trend", 
  +                       shapeby = "model") 
  + 
  + 
  + }
  > 
  > proc.time()
     user  system elapsed 
     8.89    0.67    9.62 
Running the tests in 'tests/testplotfit.R' failed.
Complete output:
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > niterboot <- 25
  > # niterboot <- 250
  > 
  > if (visualize)
  + {
  +   datafilename <- system.file("extdata", "transcripto_very_small_sample.txt", package="DRomics")
  +   # to test the multi-page of plotfit2pdf take the file below
  +   # datafilename <- system.file("extdata", "transcripto_sample.txt", package="DRomics")
  +   o <- microarraydata(datafilename, check = TRUE, norm.method = "cyclicloess")
  +   s <- itemselect(o) 
  +   f <- drcfit(s)
  +   r <- bmdcalc(f)
  +   b <- bmdboot(r, niter = niterboot)
  +   plot(f , BMDoutput = r, BMDtype = "zSD") 
  +   plot(f , BMDoutput = b, BMDtype = "zSD") 
  +   plot(f , BMDoutput = r, BMDtype = "xfold") 
  +   plot(f , BMDoutput = b, BMDtype = "xfold") 
  +   plot(f , items = 3,  BMDoutput = b, BMDtype = "zSD") 
  +   plot(f , items = 6, BMDoutput = b,  BMDtype = "zSD") 
  +   plot(f , items = c("12.1", "4", "70"),  BMDoutput = b, BMDtype = "zSD")
  +   
  +   plotfit2pdf(f , BMDoutput = r, BMDtype = "zSD") 
  +   plotfit2pdf(f , BMDoutput = b, BMDtype = "zSD") 
  +   plotfit2pdf(f , BMDoutput = r, BMDtype = "xfold") 
  +   plotfit2pdf(f , BMDoutput = b, BMDtype = "xfold") 
  +   plotfit2pdf(f , items = 3,  BMDoutput = r, BMDtype = "zSD") 
  +   plotfit2pdf(f , items = 6, BMDoutput = b,  BMDtype = "xfold") 
  +   plotfit2pdf(f , items = c("12.1", "4", "70"),  BMDoutput = r, BMDtype = "zSD") 
  +   
  +   
  +   # Metabolo ex. case where there is a pb of items ordering 
  +   datafilename <- system.file("extdata", "metabolo_sample.txt", package="DRomics")
  +   o <- continuousomicdata(datafilename, backgrounddose = 0, check = TRUE)
  +   s <- itemselect(o, select.method = 'quadratic', FDR = 0.05)
  +   f <- drcfit(s, progressbar = FALSE, parallel = 'no')
  +   plot(f, plot.type = 'dose_fitted', dose_log_transfo = TRUE)
  +   r <- bmdcalc(f, z = 1, x = 10)
  +   plot(f, plot.type = 'dose_fitted', BMDoutput = r, BMDtype = 'zSD', dose_log_transfo = TRUE) # good order
  +   plotfit2pdf(f) # good order - initial order by p-value of the selection
  +   plotfit2pdf(f , BMDoutput = r, BMDtype = "zSD")  # alphabetic order WHY ???????????????
  +   b <- bmdboot(r, niter = 10)
  +   plotfit2pdf(f , BMDoutput = b, BMDtype = "zSD") # alphabetic order
  + }
  > 
  > 
  > proc.time()
     user  system elapsed 
     8.67    0.79    9.43 
Running the tests in 'tests/testscaling.R' failed.
Complete output:
  > # test scaling on curvesplot and bmdplotwithgradient
  > 
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > 
  > if(visualize) 
  + {
  +   
  + 
  + # A toy example on a very small subsample of a microarray data set) 
  + #
  + datafilename <- system.file("extdata", "transcripto_very_small_sample.txt", 
  +                             package="DRomics")
  + 
  + o <- microarraydata(datafilename, check = TRUE, norm.method = "cyclicloess")
  + s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.01)
  + f <- drcfit(s_quad, progressbar = TRUE)
  + r <- bmdcalc(f)
  + 
  + # Plots without scaling 
  + #
  + curvesplot(r$res, xmax = max(f$omicdata$dose), facetby = "id")
  + bmdplotwithgradient(r$res, xmax = max(f$omicdata$dose),
  +            add.label = TRUE, label.size = 4, scaling = FALSE)
  + # Plots with scaling 
  + #
  + curvesplot(r$res, xmax = max(f$omicdata$dose), facetby = "id",
  +            scaling = TRUE)
  + bmdplotwithgradient(r$res, xmax = max(f$omicdata$dose),
  +                     add.label = TRUE, label.size = 4,
  +                     scaling = TRUE)
  + }
  > 
  > proc.time()
     user  system elapsed 
     8.78    0.71    9.48 
Running the tests in 'tests/testsensitivityplot.R' failed.
Complete output:
  > library(DRomics)
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > visualize <- FALSE # put to TRUE for a manual check of plots
  > 
  > if(visualize) 
  + {
  +   # (1) An example from data published by Larras et al. 2020
  + # in Journal of Hazardous Materials
  + # https://doi.org/10.1016/j.jhazmat.2020.122727
  + 
  + # a dataframe with metabolomic results (output $res of bmdcalc() or bmdboot() functions)
  + resfilename <- system.file("extdata", "triclosanSVmetabres.txt", package="DRomics")
  + res <- read.table(resfilename, header = TRUE, stringsAsFactors = TRUE)
  + str(res)
  + 
  + # a dataframe with annotation of each item identified in the previous file
  + # each item may have more than one annotation (-> more than one line)
  + annotfilename <- system.file("extdata", "triclosanSVmetabannot.txt", package="DRomics")
  + annot <- read.table(annotfilename, header = TRUE, stringsAsFactors = TRUE)
  + str(annot)
  + 
  + # Merging of both previous dataframes
  + # in order to obtain an extenderes dataframe
  + # bootstrap results and annotation
  + annotres <- merge(x = res, y = annot, by.x = "id", by.y = "metab.code")
  + head(annotres)
  + 
  + # Plots on the BMDxfold (with NA values)
  + sensitivityplot(annotres, BMDtype = "xfold",
  +                 group = "path_class")
  + 
  + sensitivityplot(annotres, BMDtype = "xfold",
  +                 group = "path_class", 
  +                 BMDsummary = "median")
  + 
  + sensitivityplot(annotres, BMDtype = "xfold",
  +                 group = "path_class", 
  +                 BMDsummary = "median.and.IQR")
  + 
  + # after use of selectgroups
  + nrow(annotres)
  + annotres.s1 <- selectgroups(annotres, BMDtype = "xfold", 
  +                             group = "path_class", nitemsmin = 1)
  + nrow(annotres.s1)
  + sensitivityplot(annotres.s1, BMDtype = "xfold",
  +                 group = "path_class")
  + 
  + # (2) 
  + # An example with two molecular levels
  + #
  + ### Rename metabolomic results
  + metabextendedres <- annotres
  + str(metabextendedres)
  + 
  + # Import the dataframe with transcriptomic results 
  + contigresfilename <- system.file("extdata", "triclosanSVcontigres.txt", package = "DRomics")
  + contigres <- read.table(contigresfilename, header = TRUE, stringsAsFactors = TRUE)
  + str(contigres)
  + 
  + # Import the dataframe with functional annotation (or any other descriptor/category 
  + # you want to use, here KEGG pathway classes) 
  + contigannotfilename <- system.file("extdata", "triclosanSVcontigannot.txt", package = "DRomics")
  + contigannot <- read.table(contigannotfilename, header = TRUE, stringsAsFactors = TRUE)
  + str(contigannot)
  + 
  + # Merging of both previous dataframes   
  + contigextendedres <- merge(x = contigres, y = contigannot, by.x = "id", by.y = "contig")
  + # to see the structure of this dataframe
  + str(contigextendedres)
  + 
  + colnames(contigextendedres)
  + colnames(metabextendedres)
  + 
  + ## sensitivityplot on BMDxfold on contigextendedres
  + sensitivityplot(contigextendedres, BMDtype = "xfold",
  +                 group = "path_class")
  + nrow(contigextendedres)
  + contigextendedres.s1 <- selectgroups(contigextendedres,
  +                                      BMDtype = "xfold", 
  +                             group = "path_class", BMDmax = 2)
  + nrow(contigextendedres.s1)
  + sensitivityplot(contigextendedres.s1, BMDtype = "xfold",
  +                 group = "path_class")
  + 
  + ### Merge metabolomic and transcriptomic results
  + extendedres <- rbind(metabextendedres, contigextendedres)
  + extendedres$molecular.level <- factor(c(rep("metabolites", nrow(metabextendedres)),
  +                                         rep("contigs", nrow(contigextendedres))))
  + str(extendedres)
  + 
  + ### Plot of 25th quantiles of BMD-zSD calculated by pathway
  + ### and colored by molecular level
  + # optional inverse alphabetic ordering of groups for the plot
  + extendedres$path_class <- factor(extendedres$path_class, 
  +                                  levels = sort(levels(extendedres$path_class), 
  +                                                decreasing = TRUE))
  + sensitivityplot(extendedres, BMDtype = "zSD",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "first.quartile")
  + 
  + ### Plot of medians and IQRs of BMD-zSD 
  + sensitivityplot(extendedres, BMDtype = "zSD",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "median.and.IQR")
  + 
  + ### Plot of medians of BMD-zSD 
  + sensitivityplot(extendedres, BMDtype = "zSD",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "median")
  + 
  + ### Plot of first quartiles of BMD-xfold 
  + sensitivityplot(extendedres, BMDtype = "xfold",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "first.quartile")
  + 
  + ### Plot of medians of BMD-xfold 
  + sensitivityplot(extendedres, BMDtype = "xfold",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "median")
  + 
  + ### Plot of medians and IQRof BMD-xfold 
  + sensitivityplot(extendedres, BMDtype = "xfold",
  +                 group = "path_class", colorby = "molecular.level", 
  +                 BMDsummary = "median.and.IQR")
  + 
  +   
  + }
  > 
  > proc.time()
     user  system elapsed 
     8.79    0.70    9.50 
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library("testthat")
  > library("DRomics")
  Loading required package: limma
  Loading required package: DESeq2
  Loading required package: S4Vectors
  Loading required package: stats4
  Loading required package: BiocGenerics
  
  Attaching package: 'BiocGenerics'
  
  The following object is masked from 'package:limma':
  
      plotMA
  
  The following objects are masked from 'package:stats':
  
      IQR, mad, sd, var, xtabs
  
  The following objects are masked from 'package:base':
  
      Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
      as.data.frame, basename, cbind, colnames, dirname, do.call,
      duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
      lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
      pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
      union, unique, unsplit, which.max, which.min
  
  
  Attaching package: 'S4Vectors'
  
  The following object is masked from 'package:utils':
  
      findMatches
  
  The following objects are masked from 'package:base':
  
      I, expand.grid, unname
  
  Loading required package: IRanges
  
  Attaching package: 'IRanges'
  
  The following object is masked from 'package:grDevices':
  
      windows
  
  Loading required package: GenomicRanges
  Loading required package: GenomeInfoDb
  Loading required package: SummarizedExperiment
  Loading required package: MatrixGenerics
  Loading required package: matrixStats
  
  Attaching package: 'MatrixGenerics'
  
  The following objects are masked from 'package:matrixStats':
  
      colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
      colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
      colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
      colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
      colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
      colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
      colWeightedMeans, colWeightedMedians, colWeightedSds,
      colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
      rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
      rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
      rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
      rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
      rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
      rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
      rowWeightedSds, rowWeightedVars
  
  Loading required package: Biobase
  Welcome to Bioconductor
  
      Vignettes contain introductory material; view with
      'browseVignettes()'. To cite Bioconductor, see
      'citation("Biobase")', and for packages 'citation("pkgname")'.
  
  
  Attaching package: 'Biobase'
  
  The following object is masked from 'package:MatrixGenerics':
  
      rowMedians
  
  The following objects are masked from 'package:matrixStats':
  
      anyMissing, rowMedians
  
  
  DRomics has been loaded.
  !!!! IMPORTANT CHANGES IN DEFAULT PLOT ARGUMENTS !!!!
  Now all the plot functions use by default a log10 scale
  for dose and BMD values, except curvesplot(),
  for which the use of a dose log scale requires the specification
  by the user of a non null minimal value (xmin).
  We also put the default value of the argument scaling at TRUE
  in curvesplot() and bmdplotwithgradient(),
  to focus on shapes of dose-responses rather than on their amplitude.
  
  > test_check("DRomics")
  [ FAIL 0 | WARN 0 | SKIP 3 | PASS 0 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • On CRAN (3): 'test_bmdcalc.R:4:5', 'test_drcfit.R:4:5',
    'test_itemselect.R:4:5'
  
  [ FAIL 0 | WARN 0 | SKIP 3 | PASS 0 ]
  > 
  > proc.time()
     user  system elapsed 
     8.98    0.78    9.79