Skip to content

Commit 8c5d4e0

Browse files
committed
Correction of the BUG in the definition of the starting values for parameter e in the fit of the Gaussprobit model.
1 parent 9ab129d commit 8c5d4e0

4 files changed

Lines changed: 49 additions & 4 deletions

File tree

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
NEW FEATURES
44

5+
BUG FIXES
6+
7+
- Fix a bug in the definition of starting values of the parameter e of the Gaussprobit model. This could help the fit in few cases.
8+
9+
# DRomics 2.6-2
10+
11+
NEW FEATURES
12+
513
- Add of a component in the output of RNAseqdata, continuousomicdata(), continuousanchoringdata(), microarraydata() and (data.sd, which gives, for each item, the sd of the response per condition - NA if no replicate for a condition).
614
- Add a new argument in drcfit(), named deltaAICminfromnullmodel, in order to relax requirements on the information criterion to keep the best fitted model (see ? drcfit()).
715
- Modification of curvesplot() to be able to put its argument dose_log_transfo by default at TRUE as in other functions. Curvesplot now use minimum and maximum values of the chosen BMD to fix the rage on which the theoretical curve is calculated (and plotted) ad so the chosen BMD is required in the input of the function.

R/util-basicandfitfunc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ startvalGauss5pnls <- function(xm, ym, Ushape) {
163163
b <- max(xm) / 4
164164
# initial value of e (dose corresponding to the maximal (or minimal) signal)
165165
xextremum <- stats::median(xm[which(ym == yextremum)]) # just in case there is more than one dose at which ym == yextremum
166-
e <- min(xextremum - (c - d) * b / (f * sqrt(2 * pi)), 1e-6)
166+
e <- max(xextremum - (c - d) * b / (f * sqrt(2 * pi)), 1e-6)
167167
startval <- list(b = b, c = c, d = d, e = e, f = f)
168168
}
169169

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Results before the correction of the BUG in starting values of e for the GP model.extract(_______________________________________________________________________________________)
2+
> datafilename <- system.file("extdata", "transcripto_sample.txt", package = "DRomics")
3+
>
4+
> (o <- microarraydata(datafilename, check = TRUE, norm.method = "cyclicloess"))
5+
Just wait, the normalization using cyclicloess may take a few minutes.
6+
Elements of the experimental design in order to check the coding of the data:
7+
Tested doses and number of replicates for each dose:
8+
9+
0 0.69 1.223 2.148 3.774 6.631
10+
5 5 5 5 5 5
11+
Number of items: 1000
12+
Identifiers of the first 20 items:
13+
[1] "1" "2" "3" "4" "5.1" "5.2" "6.1" "6.2" "7.1" "7.2" "8.1" "8.2" "9.1"
14+
[14] "9.2" "10.1" "10.2" "11.1" "11.2" "12.1" "12.2"
15+
Data were normalized between arrays using the following method: cyclicloess
16+
> (s_quad <- itemselect(o, select.method = "quadratic", FDR = 0.05))
17+
Removing intercept from test coefficients
18+
Number of selected items using a quadratic trend test with an FDR of 0.05: 318
19+
Identifiers of the first 20 most responsive items:
20+
[1] "384.2" "383.1" "383.2" "384.1" "301.1" "363.1" "300.2" "364.2" "364.1" "363.2" "301.2" "300.1"
21+
[13] "351.1" "350.2" "239.1" "240.1" "240.2" "370" "15" "350.1"
22+
> (f <- drcfit(s_quad, progressbar = TRUE))
23+
The fitting may be long if the number of selected items is high.
24+
|===========================================================================================| 100%
25+
Results of the fitting using the AICc to select the best fit model
26+
60 dose-response curves out of 318 previously selected were removed because no model
27+
could be fitted reliably.
28+
Distribution of the chosen models among the 258 fitted dose-response curves:
29+
30+
Hill linear exponential Gauss-probit log-Gauss-probit
31+
2 85 64 89 18
32+
Distribution of the trends (curve shapes) among the 258 fitted dose-response curves:
33+
34+
bell dec inc U
35+
52 59 92 55
36+
37+
Results after the correction of the BUG in starting values of e for the GP model.extract(_______________________________________________________________________________________)

tests/testthat/test_windows_drcfit.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test_that("drcfit works as expected on the model results",
1717
expect_equal(round(mean(f$fitres$c, na.rm = TRUE), 4), 5.3354)
1818
expect_equal(round(mean(f$fitres$d, na.rm = TRUE), 4), 9.2984)
1919
expect_equal(round(mean(f$fitres$e, na.rm = TRUE), 4), 1.608)
20-
expect_equal(round(mean(f$fitres$f, na.rm = TRUE), 4), 2.5344)
20+
expect_equal(round(mean(f$fitres$f, na.rm = TRUE), 4), 2.5343)
2121
#Select model with BIC
2222
f.BIC <- drcfit(s_quad, progressbar = TRUE, information.criterion = "BIC")
2323
tmodel.BIC <- table(f.BIC$fitres$model)
@@ -35,9 +35,9 @@ test_that("drcfit works as expected on the model results",
3535
expect_equal(as.numeric(tmodel.AICc["Gauss-probit"]), 23)
3636
expect_equal(as.numeric(tmodel.AICc["log-Gauss-probit"]), 3)
3737
expect_equal(round(mean(f.AICc$fitres$b, na.rm = TRUE), 4), 1.2561)
38-
expect_equal(round(mean(f.AICc$fitres$c, na.rm = TRUE), 4), 4.5015)
38+
expect_equal(round(mean(f.AICc$fitres$c, na.rm = TRUE), 4), 4.5016)
3939
expect_equal(round(mean(f.AICc$fitres$d, na.rm = TRUE), 4), 9.2571)
4040
expect_equal(round(mean(f.AICc$fitres$e, na.rm = TRUE), 4), 1.5162)
41-
expect_equal(round(mean(f.AICc$fitres$f, na.rm = TRUE), 4), 2.8576)
41+
expect_equal(round(mean(f.AICc$fitres$f, na.rm = TRUE), 4), 2.8575)
4242

4343
})

0 commit comments

Comments
 (0)