Closed CharlineJnnt closed 3 months ago
I can reproduce your problem!
It is a bug in the code of the ridgeplot
function (that actually is part of the enrichplot
library).
Specifically these 2 lines:
if (fill == "qvalue") {
fill <- "qvalues"
}
if (!fill %in% colnames(x@result)) {
stop("'fill' variable not available ...")
Basically, when calling the ridgeplot
function, if you define the argument fill = "qvalue"
, then within the function the argument "qvalue"
is renamed to "qvalues"
(thus with an s
).
Yet, in the output there is NO column present named qvalues
, but only qvalue
(without an s
), This throws the error...
A quick fix is to manually rename in the output the corresponding column to qvalues
(thus with an s
).
@GuangchuangYu : could you please fix this bug?
> library(DOSE)
> data(geneList)
> edo2 <- gseDO(geneList)
using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
preparing geneSet collections...
GSEA analysis...
leading edge analysis...
done...
>
> ## reported error is reproducible!
>
> ridgeplot(edo2, fill = "qvalue")
Error in ridgeplot.gseaResult(x, showCategory = showCategory, fill = fill, :
'fill' variable not available ...
>
> ## check column names of the results
> ## note that the 8th column contains the qvalue.
> colnames(edo2@result)
[1] "ID" "Description" "setSize" "enrichmentScore"
[5] "NES" "pvalue" "p.adjust" "qvalue"
[9] "rank" "leading_edge" "core_enrichment"
> colnames(edo2@result)[8]
[1] "qvalue"
>
> ## renames 'qvalue' to 'qvalues' (thus with an s)
> colnames(edo2@result)[8] <- "qvalues"
>
> ## check
> colnames(edo2@result)[8]
[1] "qvalues"
>
> ## create ridgplot based on qvalue
> ## works!
>
> ridgeplot(edo2, fill = "qvalue")
Picking joint bandwidth of 0.225
>
Thank you ! This fixes my bug !
fixed and thanks, see https://github.com/YuLab-SMU/enrichplot/commit/c7d162c84ef7fc6ac9942fee10ef4f7f50be43ca.
Hello,
I have performed a GSEA enrichment analysis using data from the DOSE library, then, I ran the ridgeplot() function by changing values in the fill argument. I have tested the 3 available values, fill = "pvalue", fill = "p.adjust" and fill = "qvalue". It worked for the 2 first values but not for the last one.
My code is
Can you help me ?