Skip to content

Commit

Permalink
bug fixed in tests (to continue)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marie-Laure DELIGNETTE-MULLER committed Sep 11, 2024
1 parent d604940 commit ec9b4c5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
24 changes: 11 additions & 13 deletions tests/examplewithanchoringdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@ if (visualize)

}

# various plot of fitted curves (without data)
if (visualize)
{
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
Expand All @@ -62,6 +49,17 @@ if (visualize)
bmdplotwithgradient(r$res, xmax = max(f$omicdata$dose))
}

# various plot of fitted curves (without data)
if (visualize)
{
curvesplot(r$res, xmax = max(f$omicdata$dose),
facetby = "model", colorby = "model")
curvesplot(r$res, xmax = max(f$omicdata$dose),
facetby = "typology")

}


# Calculation of confidence intervals on BMDs by Bootstrap
if (doboot)
{
Expand Down
35 changes: 19 additions & 16 deletions tests/examplewithmetabolomic.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library(DRomics)
visualize <- FALSE # put to TRUE for a manual check of plots
doboot <- FALSE
visualize <- TRUE # put to TRUE for a manual check of plots
doboot <- TRUE

# importation and check of metabolomic data
datafilename <- system.file("extdata", "metabolo_sample.txt", package="DRomics")
Expand Down Expand Up @@ -65,27 +65,14 @@ if (visualize)



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))
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)
Expand All @@ -101,6 +88,22 @@ if (visualize)

}

if (visualize)
{
# various plot of fitted curves (without data)
curvesplot(r$res, xmax = max(r$omicdata$dose),
facetby = "model", colorby = "model")

curvesplot(r$res, xmax = max(r$omicdata$dose),
facetby = "typology")

# plot of selection of curves
curvesplot(r$res[r$res$trend == "U", ], xmax = max(f$omicdata$dose),
facetby = "id")

}


if (doboot)
{
niter <- 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/examplewithmicroarray.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (visualize)
# with a chosen number of first items
plot(f, items = 12)
# with chosen items in a specified order
plot(f, items = c("301.2", "363.1", "383.1"))
plot(f, items = c("15", "27.1", "7.1"))
# residual plots
plot(f, items = 12, plot.type = "fitted_residuals")
plot(f, items = 12, plot.type = "dose_residuals")
Expand Down

0 comments on commit ec9b4c5

Please sign in to comment.