Unable to set xlab argument using glMDPlot.MArrayLM()
Closed this issue · 12 comments
Hi,
When using glMDPlot on a microarray data set, I seem to be unable to modify the labels on the left panel (since expression data is not logCPM). It works well without setting the xlab argument, but when I try to change this label, I get the following error:
Error in glMDPlot.hidden(plotting.data, sample.exp, display.columns, search.by, :
formal argument "xlab" matched by multiple actual arguments
I can provide data if needed.
Thanks,
JP
call (works if I exclude the xlab line) :
glMDPlot(fit.all_v2, status=res2, anno=fData(eset.norm), coef=1, display.columns = fvarLabels(eset.norm)[c(2,4,6,9,10)],
xlab='Average log2 intensity',
id.column = 'Probe_Id', folder=paste0('Glimma-',colnames(fit.all_v2)[1]), groups=pData(eset.norm)$Class,
counts=exprs(eset.norm), side.ylab = 'Normalized log intensity',
transform = FALSE, samples=sampleNames(eset.norm))
I've updated with a potential fix (#115), try reinstalling with devtools::install_github("Shians/Glimma")
and see if it helps.
It seems to be working now, thanks! Also, much faster.
I had found a workaround where I used a topTable result which called glMDPlot.default(). Although now if I try that, it seems that a column "GeneID" is mandatory even if it's not the id.column specified. I got the following error:
Error in checkSideMainPresent(side.main, anno, x) :
column "GeneID" cannot be found in x or anno.
Another problem I had when calling glMDPlot.default() was when trying to show "adj.P.Val" in the table. The table shown an empty column for adj.P.Val (not in the mouseover of the left panel though). And the HTML file returns the following pop-up error when opening:
"DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'adj.P.Val' for row 0, column 6. For more information about this error, please see http://datatables.net/tn/4"
It looks like a parsing issue...
Best regards,
JP
The id.column argument has been renamed to side.main. Try that instead.
Could you provide a minimal example for me to run to reproduce the parsing error? I know I've run into the error before and there are already a few sanitisers in there to try and prevent it, but I guess there are still corner cases I haven't caught.
Sure, sorry for the delay.
Here is a sample dataset in attachment.
RData file to load : https://drive.google.com/open?id=0Bx9mgPPt3IPeVmQ0UmVxTC1hS0E
You can reproduce the error by running the following code:
# Testing with Volcano plot and topTable results
res2 <- decideTests(fit_example, adjust.method = 'BH')
top <- topTable(fit_example, coef=1, number=Inf, sort='none')
top$NLP <- -1 * log10(top$P.Value)
glMDPlot(top, xval="logFC", yval="NLP", status=res2[,1],
anno=fData(eset_example), display.columns = c(colnames(top)[c(2,4,6,9,10)],'P.Value', "adj.P.Val"),
jitter=10, main=colnames(fit_example)[1], ylab='-log10(p-value)', xlab='log2(FC)',
side.main = 'Probe_Id', folder=paste0('GvolcanoTest-',colnames(fit_example)[1]),
groups=pData(eset_example)$Class, html=colnames(fit.all)[1],
counts=exprs(eset_example), side.ylab = 'Normalized log intensity',
transform = FALSE, samples=sampleNames(eset.norm))
Using side.main indeed fixed the other problem. Thanks!
JP
Forgot to attach my session_info just in case:
Session info ----------------------------------------------------------
setting value
version R version 3.3.2 (2016-10-31)
system x86_64, darwin13.4.0
ui RStudio (1.0.136)
language (EN)
collate en_CA.UTF-8
tz America/Montreal
date 2017-03-27
Packages --------------------------------------------------------------
package * version date source
assertthat 0.1 2013-12-06 CRAN (R 3.3.0)
broom 0.4.2 2017-02-13 CRAN (R 3.3.2)
colorspace 1.3-2 2016-12-14 CRAN (R 3.3.2)
DBI 0.6 2017-03-09 CRAN (R 3.3.2)
devtools * 1.12.0 2016-06-24 CRAN (R 3.3.0)
digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
dplyr * 0.5.0 2016-06-24 CRAN (R 3.3.0)
forcats 0.2.0 2017-01-23 CRAN (R 3.3.2)
foreign 0.8-67 2016-09-13 CRAN (R 3.3.0)
ggplot2 * 2.2.1 2016-12-30 cran (@2.2.1)
gtable 0.2.0 2016-02-26 CRAN (R 3.3.0)
haven 1.0.0 2016-09-23 CRAN (R 3.3.0)
hms 0.3 2016-11-22 CRAN (R 3.3.2)
httr 1.2.1 2016-07-03 CRAN (R 3.3.0)
jsonlite 1.3 2017-02-28 CRAN (R 3.3.2)
lattice 0.20-34 2016-09-06 CRAN (R 3.3.0)
lazyeval 0.2.0 2016-06-12 CRAN (R 3.3.0)
lubridate 1.6.0 2016-09-13 CRAN (R 3.3.0)
magrittr 1.5 2014-11-22 CRAN (R 3.3.0)
memoise 1.0.0 2016-01-29 CRAN (R 3.3.0)
mnormt 1.5-5 2016-10-15 CRAN (R 3.3.0)
modelr 0.1.0 2016-08-31 CRAN (R 3.3.0)
munsell 0.4.3 2016-02-13 CRAN (R 3.3.0)
nlme 3.1-131 2017-02-06 CRAN (R 3.3.2)
plyr 1.8.4 2016-06-08 CRAN (R 3.3.0)
psych 1.6.12 2017-01-08 CRAN (R 3.3.2)
purrr * 0.2.2 2016-06-18 CRAN (R 3.3.0)
R6 2.2.0 2016-10-05 CRAN (R 3.3.0)
Rcpp 0.12.10 2017-03-19 CRAN (R 3.3.2)
readr * 1.0.0 2016-08-03 CRAN (R 3.3.0)
readxl * 0.1.1 2016-03-28 CRAN (R 3.3.0)
reshape2 1.4.2 2016-10-22 CRAN (R 3.3.0)
rvest 0.3.2 2016-06-17 CRAN (R 3.3.0)
scales 0.4.1 2016-11-09 CRAN (R 3.3.2)
stringi 1.1.2 2016-10-01 CRAN (R 3.3.0)
stringr 1.2.0 2017-02-18 CRAN (R 3.3.2)
tibble * 1.2 2016-08-26 CRAN (R 3.3.0)
tidyr * 0.6.1 2017-01-10 CRAN (R 3.3.2)
tidyverse * 1.1.1 2017-01-27 CRAN (R 3.3.2)
withr 1.0.2 2016-06-20 CRAN (R 3.3.0)
xml2 1.1.1 2017-01-24 CRAN (R 3.3.2)
Thanks for the help debugging! This should be fixed by (#117), essentially the problem was that string.replace() in JavaScript only substituted the first instance, so "Adj.P.Value" only had the first "." sanitised and not the second.
I'm having a similar problem with glXYPlot function, even with the devtools install version.
In the below code, the first plot executes, the 2nd gives me an error.
glXYPlot(x=-log10(temp_anno[,"Aspirin_PValue"]), y=-log10(temp_anno[,"Ticagrelor_PValue"]),anno=temp_anno, counts=rnaseq_filtered$log2CPM, groups=group)
glXYPlot(x=-log10(temp_anno[,"Aspirin_PValue"]), y=-log10(temp_anno[,"Ticagrelor_PValue"]),anno=temp_anno, counts=rnaseq_filtered$log2CPM, groups=group, xlab = "Aspirin log10 Pvalue")
Error in checkThat(xval, isIn(names(x))) :
Second argument should contain the first.
temp_anno is a data frame with annotation, and results from 2 different models - I'm trying to contrast results. I've displayed select columns below.
GeneID gene_short_name chr Aspirin_PValue Ticagrelor_adjPVal
1 ENSG00000000003 TSPAN6 chrX 0.5559545 0.234764559
2 ENSG00000000419 DPM1 chr20 0.2627934 0.031830175
3 ENSG00000000457 SCYL3 chr1 0.5572664 0.304617684
4 ENSG00000000460 C1orf112 chr1 0.3135721 0.004203597
5 ENSG00000000938 FGR chr1 0.1927285 0.001003761
6 ENSG00000001036 FUCA2 chr6 0.5625262 0.035319455
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5
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] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Glimma_1.3.22 knitr_1.15.1 edgeR_3.14.0 lme4_1.1-12 Matrix_1.2-8 ggplot2_2.2.1 reshape2_1.4.2 limma_3.28.21
loaded via a namespace (and not attached):
[1] Biobase_2.32.0 httr_1.2.1 jsonlite_1.4 splines_3.3.2 Formula_1.2-1
[6] assertthat_0.1 statmod_1.4.29 highr_0.6 stats4_3.3.2 latticeExtra_0.6-28
[11] RSQLite_1.1-2 backports_1.0.5 lattice_0.20-34 digest_0.6.12 GenomicRanges_1.24.3
[16] RColorBrewer_1.1-2 XVector_0.12.1 checkmate_1.8.2 minqa_1.2.4 colorspace_1.3-2
[21] htmltools_0.3.5 plyr_1.8.4 DESeq2_1.14.1 XML_3.98-1.5 devtools_1.12.0
[26] genefilter_1.54.2 zlibbioc_1.18.0 xtable_1.8-2 scales_0.4.1 BiocParallel_1.8.2
[31] git2r_0.18.0 htmlTable_1.9 tibble_1.2 annotate_1.50.1 IRanges_2.6.1
[36] withr_1.0.2 SummarizedExperiment_1.2.3 nnet_7.3-12 BiocGenerics_0.18.0 lazyeval_0.2.0
[41] survival_2.40-1 magrittr_1.5 memoise_1.0.0 nlme_3.1-131 MASS_7.3-45
[46] foreign_0.8-67 BiocInstaller_1.22.3 tools_3.3.2 data.table_1.10.4 stringr_1.2.0
[51] S4Vectors_0.10.3 munsell_0.4.3 locfit_1.5-9.1 cluster_2.0.5 AnnotationDbi_1.34.4
[56] GenomeInfoDb_1.8.7 grid_3.3.2 RCurl_1.95-4.8 nloptr_1.0.4 htmlwidgets_0.8
[61] bitops_1.0-6 base64enc_0.1-3 labeling_0.3 gtable_0.2.0 DBI_0.6
[66] curl_2.3 R6_2.2.0 gridExtra_2.2.1 Hmisc_4.0-2 stringi_1.1.2
[71] parallel_3.3.2 Rcpp_0.12.9 geneplotter_1.52.0 rpart_4.1-10 acepack_1.4.1
I have the same issue as @ramharmony, have you managed to solve the bug? I've also installed the devtools version, and still doesn't solve the issue. I would appreaciate any help,
Thank you!
I will look into it soon, sorry the glXYPlot isn't as well tested, I mostly use the glMDPlot with edgeR.
Thanks everyone who reported this, sorry it took me so long to fix. The issue should be due to having spaces or other non-alphanumeric in the label names. This is fixed in #157. If there are further problems please open a new issue.
Email from @u9090
Still a bug in the colname of the html table.
Tried to make a glXYPlot with 'ylab="ylab="-log10(p-value)"'.
The table displays the dataframe formating 'X.log10.p.value'.
Cannot fix, the table is fundamentally based on data.frame, if the column name cannot be represented in the base R data.frame then it cannot be shown in the HTML table. The solution to this would be to either include another argument (there are already too many in my opinion) that sets character labels for the columns, or to use one of the more specialised data.frame alternative implementations.
I'm not inclined to do either, the first is more work on the user's end and gives much potential for errors. The second requires support of non-standard objects, which requires me to track through much of my code to avoid any conversions to data.frame.