dmrcate(): Error in `$<-.data.frame`(`*tmp*`, "sig", value = logical(0)) : replacement has 0 rows, data has 1963
6
0
Entering edit mode
ew17 • 0
@ew17-11743
Last seen 8.1 years ago

Hi all,

I am using DMRcate to find differentially methylated regions in illumina 450k data. I'm fairly new to R and DMRcate, so I've been following the User Guide example pretty closely. When I get to the dmrcate(myannotation, lambda=1000, C=2) call, I get an error:

"Fitting chr1...

...

Fitting chr8...
Fitting chr9...

Error in `$<-.data.frame`(`*tmp*`, "sig", value = logical(0)) : 

  replacement has 0 rows, data has 1963"

I looked into the source code of the dmrcate method, but I'm still not sure where this error is coming from. The variable "myannotation" is the result from my cpg.annotate() call. I looked up what this error means, and it seems like it's because "sig" is not a variable in the dataset, but I'm not sure where the dataset is being constructed in the dmrcate method. Anyway, how should I go about addressing this issue? Please let me know if I should also provide any other information to make this easier to understand. 

Thanks in advance,

Eugene 

 

 

dmrcate • 20k views
ADD COMMENT
0
Entering edit mode
Tim Peters ▴ 200
@tim-peters-7579
Last seen 1 day ago
Australia

Hi Eugene,

Can you post a traceback() on this error and then a sessionInfo() please?

Cheers,

Tim 

ADD COMMENT
0
Entering edit mode

Sorry about the delay; I didn't see your response until now. The output of traceback() is:

4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", 
       "replacement has %d rows, data has %d"), N, nrows), domain = NA)
3: `$<-.data.frame`(`*tmp*`, "sig", value = logical(0))
2: `$<-`(`*tmp*`, "sig", value = logical(0))
1: dmrcate(myannotation, lambda = 1000, C = 2)

ADD REPLY
0
Entering edit mode
ew17 • 0
@ew17-11743
Last seen 8.1 years ago

sessionInfo():

R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.2 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
 [1] splines   stats4    parallel  stats     graphics  grDevices utils     datasets 
 [9] methods   base     

loaded via a namespace (and not attached):
 [1] nlme_3.1-128             bitops_1.0-6             matrixStats_0.51.0      
 [4] RColorBrewer_1.1-2       tools_3.2.2              doRNG_1.6               
 [7] nor1mix_1.2-2            R6_2.2.0                 rpart_4.1-10            
[10] Hmisc_3.17-4             Gviz_1.14.7              DBI_0.5-1               
[13] colorspace_1.2-7         nnet_7.3-12              gridExtra_2.2.1         
[16] base64_2.0               chron_2.3-47             preprocessCore_1.32.0   
[19] pkgmaker_0.22            rtracklayer_1.30.4       scales_0.4.0            
[22] genefilter_1.52.1        quadprog_1.5-5           stringr_1.1.0           
[25] digest_0.6.10            Rsamtools_1.22.0         foreign_0.8-67          
[28] R.utils_2.4.0            illuminaio_0.12.0        siggenes_1.44.0         
[31] GEOquery_2.36.0          dichromat_2.0-0          htmltools_0.3.5         
[34] BSgenome_1.38.0          limma_3.26.9             htmlwidgets_0.7         
[37] RSQLite_1.0.0            shiny_0.14.1             jsonlite_1.1            
[40] mclust_5.2               BiocParallel_1.4.3       gtools_3.5.0            
[43] acepack_1.4.0            R.oo_1.20.0              dplyr_0.5.0             
[46] VariantAnnotation_1.16.4 RCurl_1.95-4.8           magrittr_1.5            
[49] Formula_1.2-1            futile.logger_1.4.3      Matrix_1.2-7.1          
[52] Rcpp_0.12.7              munsell_0.4.3            R.methodsS3_1.7.1       
[55] stringi_1.1.2            MASS_7.3-45              zlibbioc_1.16.0         
[58] plyr_1.8.4               grid_3.2.2               multtest_2.26.0         
 

ADD COMMENT
0
Entering edit mode

Sorry about the separation; the 5000 character limit kept having issues.

[61] GenomicFeatures_1.22.13  annotate_1.48.0          knitr_1.14              
[64] beanplot_1.2             igraph_1.0.1             rngtools_1.2.4          
[67] corpcor_1.6.8            reshape2_1.4.2           codetools_0.2-15        
[70] biomaRt_2.26.1           mixOmics_6.1.1           futile.options_1.0.0    
[73] XML_3.98-1.4             biovizBase_1.18.0        latticeExtra_0.6-28     
[76] lambda.r_1.1.9           data.table_1.9.6         httpuv_1.3.3            
[79] gtable_0.2.0             openssl_0.9.4            tidyr_0.6.0             
[82] reshape_0.8.6            assertthat_0.1           ggplot2_2.1.0           
[85] mime_0.5                 xtable_1.8-2             survival_2.39-5         
[88] tibble_1.2               GenomicAlignments_1.6.3  AnnotationDbi_1.32.3    
[91] registry_0.3             ellipse_0.3-8            cluster_2.0.5           
[94] rgl_0.96.0   

ADD REPLY
0
Entering edit mode
Tim Peters ▴ 200
@tim-peters-7579
Last seen 1 day ago
Australia

Hi Eugene,

DMRcate_1.6.53 is a fairly old version, more than a year old in fact. I think there were a couple of bugs in it that have been ironed out since. Please upgrade to the newest version https://www.bioconductor.org/packages/release/bioc/html/DMRcate.html and hopefully you'll find it works properly.

Cheers,

TIm

 

ADD COMMENT
0
Entering edit mode

Hey, did you ever get an fix for the error? I am using the most recent version (the one mentioned above) and stuck with the same error. 

ADD REPLY
0
Entering edit mode
Tim Peters ▴ 200
@tim-peters-7579
Last seen 1 day ago
Australia

This error could be down to one of a number of things:

 

1) First look if you still have your SNP probes in your data matrix. The rownames will begin with "rs" instead of "cg". Remove them.

 

2) If there are any NAs in your data matrix then nsig will be NA instead of a number. Get rid of any rows that have NAs.

 

3) If the variance is exactly zero for any of your rows (i.e. all values are identical) then limma will throw this error too. Check for rows that whose values are all the same.

 

If you're still having trouble after trying these please send me your R workflow and I will have a look at it.

 

Good luck,

Tim

ADD COMMENT
0
Entering edit mode
Yuan Tian ▴ 90
@yuan-tian-9598
Last seen 4.9 years ago

Hello  Eugene,Tim:

I encountered the same error report as well. And I checked it in DMRcate code (I am using version 1.10.0):

I think there is a small bug in dmrcate() function. In the function, pcutoff parameter is used to select significant differential CpGs. It can be assigned as value or "fdr". The default value is "fdr", which means insides dmrcate() function, a numeric value of cutoff will be generated. Or we can assign a value to pcutoff.

The bug lies on line 50 : object$sig <- object$fdr <= pcutoff. This line of code will find all CpG with fdr-adjusted p value smaller then pcutoff. But if there is no CpG fulfill this condition, the error would happen.

So the easiest way to solve this error is to assign pcutoff to a higher value. (Actually I think fdr adjust is very strict, maybe a 0.1 cutoff is also acceptable). I tried to assign pcutoff parameter value as 0.1 and my function works well then. But how to adjust pcutoff parameter is totally depends on researchers' research, I am not sure 0.1 is a suitable value.

Tim, maybe you can slightly modify the code in this line. And return a message to users so that we can adjust pcutoff parameter ourselves.

Best

Yuan Tian

ADD COMMENT
0
Entering edit mode
Tim Peters ▴ 200
@tim-peters-7579
Last seen 1 day ago
Australia

Hi Yuan and Eugene,

Thanks for the feedback, that is indeed a bug. It should be fixed in the git now and propagated to Bioconductor in 48 hours. 

To clarify, it is highly recommended that the thresholding be tuned using the fdr argument in cpg.annotate(). If there are no CpGs below this threshold, there should be a message stating this. 

ADD COMMENT

Login before adding your answer.

Traffic: 968 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