DMR.Plot shows error "Error in simpleLoess(y, x, w, span, degree = degree, parametric = FALSE, : NA/NaN/Inf in foreign function call (arg 1)"
1
1
Entering edit mode
@a3f49c6c
Last seen 19 months ago
Spain

Hi,

I am trying to use DMR.Plot but depending on the DMR I get the correct output or an error. I am using always the same set of beta values and the first part of the plot works but the last (the group means) does not. I want this last part to be divided into three groups, if I group into two instead some other DMR work, but not all. In some cases if I add to the beta values + 0.0000001 or - 0.0000001, it seems to work, but again, it depends on the region.

The error is the following one: "Error in simpleLoess(y, x, w, span, degree = degree, parametric = FALSE, : NA/NaN/Inf in foreign function call (arg 1)"

It is obtained when calling plotTracks() from Gviz within the DMR.PLot function, but I do not have NAs, 0s or 1s in the beta values. How can I solve this?

Thanks,

DMRcate Gviz • 1.5k views
ADD COMMENT
0
Entering edit mode

Hi, I'm hitting this too. As far as I can tell my DataTrack is fine, but perhaps I am missing something.

Notably the same code works on other input data vectors, which also ultimately consist of numeric values between 0 and 4.

> temp
DataTrack 'BE4max'
| genome: ENST00000260526
| active chromosome: ENST00000260526
| positions: 1269
| samples:1
| strand: * 
> str(temp)
Formal class 'DataTrack' [package "Gviz"] with 8 slots
  ..@ data      : num [1, 1:1269] 0 0 0 0 0 0 0 0 1 0 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr "V1"
  .. .. ..$ : NULL
  ..@ strand    : chr "*"
  ..@ range     :Formal class 'GRanges' [package "GenomicRanges"] with 7 slots
  .. .. ..@ seqnames       :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. .. .. ..@ values         : Factor w/ 1 level "ENST00000260526": 1
  .. .. .. .. ..@ lengths        : int 1269
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ ranges         :Formal class 'IRanges' [package "IRanges"] with 6 slots
  .. .. .. .. ..@ start          : int [1:1269] 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. .. ..@ width          : int [1:1269] 2 2 2 2 2 2 2 2 2 2 ...
  .. .. .. .. ..@ NAMES          : NULL
  .. .. .. .. ..@ elementType    : chr "ANY"
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ strand         :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. .. .. ..@ values         : Factor w/ 3 levels "+","-","*": 3
  .. .. .. .. ..@ lengths        : int 1269
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ seqinfo        :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
  .. .. .. .. ..@ seqnames   : chr "ENST00000260526"
  .. .. .. .. ..@ seqlengths : int NA
  .. .. .. .. ..@ is_circular: logi NA
  .. .. .. .. ..@ genome     : chr "ENST00000260526"
  .. .. ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots
  .. .. .. .. ..@ rownames       : NULL
  .. .. .. .. ..@ nrows          : int 1269
  .. .. .. .. ..@ elementType    : chr "ANY"
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. .. .. ..@ listData       : Named list()
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ metadata       : list()
  ..@ chromosome: chr "ENST00000260526"
  ..@ genome    : Named chr "ENST00000260526"
  .. ..- attr(*, "names")= chr "ENST00000260526"
  ..@ dp        :Formal class 'DisplayPars' [package "Gviz"] with 1 slot
  .. .. ..@ pars:List of 110
  .. .. .. ..$ aggregateGroups  : logi FALSE
  .. .. .. ..$ aggregation      : chr "mean"
  .. .. .. ..$ missingAsZero    : logi TRUE
  .. .. .. ..$ alpha.confint    : num 0.3
  .. .. .. ..$ amount           : NULL
  .. .. .. ..$ baseline         : NULL
  .. .. .. ..$ box.legend       : logi FALSE
  .. .. .. ..$ box.ratio        : num 1
  .. .. .. ..$ box.width        : NULL
  .. .. .. ..$ grid             : logi FALSE
  .. .. .. ..$ cex.legend       : num 0.8
  .. .. .. ..$ cex.sampleNames  : NULL
  .. .. .. ..$ cex              : num 0.7
  .. .. .. ..$ coef             : num 1.5
  .. .. .. ..$ col.baseline     : NULL
  .. .. .. ..$ col.confint      : logi NA
  .. .. .. ..$ col.boxplotFrame : chr "#808080"
  .. .. .. ..$ col.histogram    : chr "#808080"
  .. .. .. ..$ col.horizon      : logi NA
  .. .. .. ..$ col.mountain     : NULL
  .. .. .. ..$ col.sampleNames  : chr "white"
  .. .. .. ..$ col              : Named chr [1:7] "#0072B2" "#E69F00" "#009E73" "#D55E00" ...
  .. .. .. .. ..- attr(*, "names")= chr [1:7] "blue" "orange" "bluishgreen" "vermillion" ...
  .. .. .. ..$ collapse         : logi FALSE
  .. .. .. ..$ degree           : num 1
  .. .. .. ..$ do.out           : logi TRUE
  .. .. .. ..$ evaluation       : num 50
  .. .. .. ..$ factor           : num 0.5
  .. .. .. ..$ family           : chr "symmetric"
  .. .. .. ..$ fill.confint     : NULL
  .. .. .. ..$ fill.histogram   : NULL
  .. .. .. ..$ fill.horizon     : chr [1:6] "#B41414" "#E03231" "#F7A99C" "#9FC8DC" ...
  .. .. .. ..$ fill.mountain    : chr [1:2] "#CCFFFF" "#FFCCFF"
  .. .. .. ..$ fontface.legend  : NULL
  .. .. .. ..$ fontfamily.legend: NULL
  .. .. .. ..$ fontsize.legend  : NULL
  .. .. .. ..$ fontcolor.legend : chr "#808080"
  .. .. .. ..$ gradient         : chr [1:9] "#F7FBFF" "#DEEBF7" "#C6DBEF" "#9ECAE1" ...
  .. .. .. ..$ groups           : NULL
  .. .. .. ..$ horizon.origin   : num 0
  .. .. .. ..$ horizon.scale    : NULL
  .. .. .. ..$ jitter.x         : logi FALSE
  .. .. .. ..$ jitter.y         : logi FALSE
  .. .. .. ..$ levels.fos       : NULL
  .. .. .. ..$ legend           : logi TRUE
  .. .. .. ..$ lineheight.legend: NULL
  .. .. .. ..$ lty.baseline     : NULL
  .. .. .. ..$ lty.mountain     : NULL
  .. .. .. ..$ lwd.baseline     : NULL
  .. .. .. ..$ lwd.mountain     : NULL
  .. .. .. ..$ min.distance     : num 0
  .. .. .. ..$ na.rm            : logi FALSE
  .. .. .. ..$ ncolor           : num 100
  .. .. .. ..$ notch.frac       : num 0.5
  .. .. .. ..$ notch            : logi FALSE
  .. .. .. ..$ pch              : num 20
  .. .. .. ..$ separator        : num 0
  .. .. .. ..$ showColorBar     : logi TRUE
  .. .. .. ..$ showSampleNames  : logi FALSE
  .. .. .. ..$ size             : NULL
  .. .. .. ..$ span             : num 0.2
  .. .. .. ..$ stackedBars      : logi TRUE
  .. .. .. ..$ stats            :function (x, coef = 1.5, do.conf = TRUE, do.out = TRUE)  
  .. .. .. ..$ transformation   : NULL
  .. .. .. ..$ type             : chr [1:2] "h" "smooth"
  .. .. .. ..$ varwidth         : logi FALSE
  .. .. .. ..$ window           : NULL
  .. .. .. ..$ windowSize       : NULL
  .. .. .. ..$ ylim             : num [1:2] 0 4
  .. .. .. ..$ yTicksAt         : NULL
  .. .. .. ..$ .__appliedScheme : chr "default"
  .. .. .. ..$ alpha            : num 1
  .. .. .. ..$ alpha.title      : NULL
  .. .. .. ..$ background.panel : chr "white"
  .. .. .. ..$ background.title : chr "white"
  .. .. .. ..$ background.legend: chr "transparent"
  .. .. .. ..$ cex.axis         : NULL
  .. .. .. ..$ cex.title        : NULL
  .. .. .. ..$ col.axis         : chr "black"
  .. .. .. ..$ col.border.title : chr "white"
  .. .. .. ..$ col.frame        : chr "lightgray"
  .. .. .. ..$ col.grid         : chr "#808080"
  .. .. .. ..$ col.line         : NULL
  .. .. .. ..$ col.symbol       : NULL
  .. .. .. ..$ fontcolor.title  : chr "black"
  .. .. .. ..$ fill             : chr "lightgray"
  .. .. .. ..$ fontcolour       : chr "black"
  .. .. .. ..$ fontface.title   : num 2
  .. .. .. ..$ fontface         : num 1
  .. .. .. ..$ fontfamily.title : chr "sans"
  .. .. .. ..$ fontfamily       : chr "sans"
  .. .. .. ..$ fontsize         : num 12
  .. .. .. ..$ frame            : logi FALSE
  .. .. .. ..$ h                : num -1
  .. .. .. ..$ lineheight       : num 1
  .. .. .. ..$ lty.grid         : chr "solid"
  .. .. .. ..$ lty              : chr "solid"
  .. .. .. ..$ lwd.border.title : num 1
  .. .. .. ..$ lwd.title        : num 1
  .. .. .. ..$ lwd.grid         : num 1
  .. .. .. .. [list output truncated]
  ..@ name      : chr "BE4max"
  ..@ imageMap  : NULL
  ..$ columns: chr "score"
> plotTracks(temp)
Error in simpleLoess(y, x, w, span, degree = degree, parametric = FALSE,  : 
  NA/NaN/Inf in foreign function call (arg 1)
ADD REPLY
0
Entering edit mode
Tim Peters ▴ 200
@tim-peters-7579
Last seen 3 months ago
Australia

Hi Jose and Russ,

Apologies to Jose for not seeing this earlier. Sometimes the loess smoother in the bottom panel will throw this error when CpGs are sparse within the domain, or the methylation changes abruptly. Adding an offset like Jose has done is a good fix.

Cheers, Tim

ADD COMMENT

Login before adding your answer.

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