CENTIPEDE.tutorial icon indicating copy to clipboard operation
CENTIPEDE.tutorial copied to clipboard

Error in quantile.default(x, c(TrimP, 1 - TrimP))

Open hugch2020 opened this issue 5 years ago • 3 comments

Hi,

I use my own data to test the procedure, in the final steps, when I run:

idx <- site_cons > 0.999
fit3 <- fitCentipede(
  Xlist = list(
    DNase = cen$mat[idx, ]
  ),
  Y = as.matrix(data.frame(
    Intercept = rep(1, nrow(cen$mat[idx, ])),
    Conservation = site_cons[idx]
  ))
)

It gives an error:

Initialization of the parameters:
Error in quantile.default(x, c(TrimP, 1 - TrimP)) : 
  missing values and NaN's not allowed if 'na.rm' is FALSE

but when I run:

fit2 <- fitCentipede(
  Xlist = list(
    DNase = cen$mat
  ),
  Y = as.matrix(data.frame(
    Intercept = rep(1, nrow(cen$mat)),
    Conservation = site_cons
  ))
)

It goes right, I don't know what's the problem, please give me some help!

Thanks. Hu

hugch2020 avatar Apr 18 '19 09:04 hugch2020

Hi Hu, you might consider reading the other related issues:

  • #9
  • #2

slowkow avatar Apr 18 '19 15:04 slowkow

Thanks, I get it.

hugch2020 avatar Apr 19 '19 03:04 hugch2020

@hugch2010

I got the same error because 0 in cen$mat; what's your results for:

all(colSums(cen$mat) > 0) # expect TRUE

I tried to assign the minimum values to 0 positions to skip the error.

bakerwm avatar Oct 17 '19 14:10 bakerwm