rietho / IPO

A Tool for automated Optimization of XCMS Parameters
http://bioconductor.org/packages/IPO/
Other
34 stars 20 forks source link

Error in lm.fit() when optimising group/retcor #6

Closed sneumann closed 7 years ago

sneumann commented 9 years ago

Hi,

I get Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases when doing:

> retcorGroupParameters <- getDefaultRetGroupStartingParams()
> retcorGroupParameters$profStep <- 1
> resultRetcorGroup <- optimizeRetGroup(xset=mtblsSets[["negative"]], 
+                                       params=retcorGroupParameters, 
+                                       nSlaves=12, subdir="rsmDirectory")

starting new DoE with:
$distFunc
[1] "cor_opt"

$gapInit
[1] 0.0 0.4

$gapExtend
[1] 2.1 2.7

$profStep
[1] 1

$plottype
[1] "none"

$response
[1] 1

$factorDiag
[1] 2

$factorGap
[1] 1

$localAlignment
[1] 0

$bw
[1] 22 38

$minfrac
[1] 0.3 0.7

$mzwid
[1] 0.015 0.035

$minsamp
[1] 1

$max
[1] 50

$center
[1] 86

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  0 (non-NA) cases
In addition: Warning messages:
1: closing unused connection 6 (<-localhost:11147) 
2: closing unused connection 5 (<-localhost:11147) 
3: closing unused connection 4 (<-localhost:11147) 
4: closing unused connection 3 (<-localhost:11147) 

Traceback shows:

> traceback()
9: stop("0 (non-NA) cases")
8: lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...)
7: lm(formula = resp ~ FO(x1, x2, x3, x4, x5) + TWI(x1, x2, x3, 
       x4, x5) + PQ(x1, x2, x3, x4, x5), data = design)
6: eval(expr, envir, enclos)
5: eval(CALL, parent.frame())
4: rsm(formula, data = design)
3: createModel(retcor_result$design, params$to_optimize, resp)
2: retGroupExperimentStatistic(retcor_result, subdir, iterator, 
       xset)
1: optimizeRetGroup(xset = mtblsSets[["negative"]], params = retcorGroupParameters, 
       nSlaves = 12, subdir = "rsmDirectory")
glibiseller commented 9 years ago

Hi!

My guess is, that the following lines in the function getNormalizedResponse produce Nas if min and max have the same value: norm_group_ratio <- (group_ratio - min(group_ratio)) / (max(group_ratio) - min(group_ratio)) norm_ARTS <- (ARTS - min(ARTS)) / (max(ARTS) - min(ARTS))

I updated the code to prevent Nas from these two lines: norm_group_ratio[is.na(norm_group_ratio)] <- 0 norm_ARTS[is.na(norm_ARTS)] <- 0

I'll update the repository later today.

best regards,

glibiseller commented 9 years ago

Hi,

does the latest version work for your dataset?

Cheers, Gunnar