Same error that DMRcate Error in if (nsig == 0) { : missing value where TRUE/FALSE needed
1
0
Entering edit mode
jfertaj ▴ 30
@jfertaj-8566
Last seen 19 months ago
United Kingdom

Hi,

I have the same problem that the one observed in this question DMRcate Error in if (nsig == 0) { : missing value where TRUE/FALSE needed, however my data has not NA values both in M-values matrix and after fitting model with limma

This is what I have done:


Error in if (nsig == 0) { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In logit2(assay(object, "Beta")) : NaNs produced
2: In logit2(assay(object, "Beta")) : NaNs produced
3: Partial NA coefficients for 72970 probe(s)
This is what I have done:

design2 <- model.matrix(~0+location + sex + age)
cm2 <- makeContrasts( 
          ProximalvsDistal = proximal - distal,
          ProximalvsRectum = proximal - rectum,
          DistalvsRectum = distal - rectum,
          levels=design2)

fit2 <- lmFit(MVals, design2)
fit2 <- contrasts.fit(fit2, cm2)
efit2 <- eBayes(fit2, robust = TRUE)

naind <- is.na(rowSums(efit2$p.value))
naind[which(naind=='TRUE')]
#named logical(0)

Also I have checked that my M-values matrix has no NAs

apply(is.na(MVals), 2, which)
#integer(0)

Any suggestions would be much appreciated

DMRcate • 877 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 16 hours ago
United States

Thanks for reposting. I already answered on the old post, but here it is again.

You don't show how you got your MVals object, but this part:

1: In logit2(assay(object, "Beta")) : NaNs produced
2: In logit2(assay(object, "Beta")) : NaNs produced

comes from getM, and indicates that the GenomicRatioSet that you used for cpg.annotate is problematic because it has beta values outside of (0,1)

> cbind(seq(-0.1, 1.1, 0.1), logit2(seq(-0.1, 1.1, 0.1)))
      [,1]          [,2]
 [1,] -0.1           NaN
 [2,]  0.0          -Inf
 [3,]  0.1 -3.169925e+00
 [4,]  0.2 -2.000000e+00
 [5,]  0.3 -1.222392e+00
 [6,]  0.4 -5.849625e-01
 [7,]  0.5  5.551115e-16
 [8,]  0.6  5.849625e-01
 [9,]  0.7  1.222392e+00
[10,]  0.8  2.000000e+00
[11,]  0.9  3.169925e+00
[12,]  1.0           Inf
[13,]  1.1           NaN
Warning messages:
1: In logit2(seq(-0.1, 1.1, 0.1)) : NaNs produced
2: In logit2(seq(-0.1, 1.1, 0.1)) : NaNs produced

And if you have a group that is all NA or NaN, you get that error from lmFit

> z <- matrix(rnorm(1000), 100)
> z[3,1:5] <- NaN
> zz <- lmFit(z, model.matrix(~gl(2,5)))
Warning message:
Partial NA coefficients for 1 probe(s)
ADD COMMENT

Login before adding your answer.

Traffic: 839 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6