dear All,
I think there is a bug in the plotrt
function of xcms
: I get an error message after specifying the colors for individual samples in the plotrt
. Without specifying the colors using the col
argument the function works as expected.
The code:
## xset is a xcmsSet from 3 mzML files; defining the colors: > FileCols <- brewer.pal(length(sampnames(xset)), "Set1") > FileCols [1] "#E41A1C" "#377EB8" "#4DAF4A" ## plotting with these colors: > plotrt(xset, col=FileCols) Error in 1:max(col) : NA/NaN argument In addition: Warning message: In .local(object, ...) : NAs introduced by coercion
The sessionInfo:
> sessionInfo() R version 3.1.2 (2014-10-31) Platform: x86_64-apple-darwin14.0.0/x86_64 (64-bit) 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] grid parallel stats graphics grDevices utils datasets [8] methods base other attached packages: [1] lattice_0.20-30 xcms_1.42.0 mzR_2.0.0 [4] Rcpp_0.11.4 ascii_2.1 RColorBrewer_1.1-2 [7] Biobase_2.26.0 BiocGenerics_0.12.1 loaded via a namespace (and not attached): [1] codetools_0.2-10 compiler_3.1.2 tools_3.1.2
cheers, jo
Thanks for your quick reply!
Yes, I also checked the source code and got to that conclusion. I've forked the xcms project on github and modified the code so that it will also allow submission of color definitions other than numeric (hope the maintainer will accept the pull request...).
cheers, jo