Closed Ni-Ar closed 6 years ago
Thanks for your feedback. Yes, it is a bug and has been fixed.
Thanks for the support! I still have 2 more questions:
gseaplot
function in the future releases of DOSE
? DOSE
via devtools::install_github("GuangchuangYu/DOSE")
will I now be able to plot correctly with gseaplot
? No. DOSE will not contain any plot function in future release, you should refer to the enrichplot package.
For update, pls use:
devtools::install_github(c("GuangchuangYu/DOSE", "GuangchuangYu/enrichplot", "GuangchuangYu/clusterProfiler"))
I see, good to know! Thank you very much for clarifying. :)
Sorry to bother again I just want to highlight that if one goes for the latest versions with
devtools::install_github(c("GuangchuangYu/DOSE", "GuangchuangYu/enrichplot", "GuangchuangYu/clusterProfiler"))
this might cause some conflicts when using ChIPSeeker package as well.
library("ChIPseeker")
# Error: object ‘upsetplot’ is not exported by 'namespace:DOSE'
This is not really a problem for me now. I guess this is just a temporary issue, I think it will be fixed with the next release of Bioconductor 3.7.
Yes, it will be fine in next release.
how do I increase the font size in gseaplot?
Here is how I would do it:
gseaplot
function returns a ggplot
object so you could still add layers as you would do like this for example ggplot( ... ) + theme(text = element_text(size = 18)
which should increase all the text of the plot to size 18.
I use this trick to add information in the title of plot as shown in the example below where I use the labs(title = ...)
layer to add information to the title of the plot.
# Call GSEA function
obj_gse <- gseGO(...)
# Coerc GSEA object into dataframe
df_gse <- as.data.frame(obj_gse)
# Plot the "ID_GO_Term" you like and have the Description, NES and adjusted pvalue in the title
gseaplot(obj_gse, geneSetID = "ID_GO_Term", color.line = "springgreen3",
color = "gray89", by = "runningScore") + # or by = preranked
labs(title=paste0("GO term: ",
df_gse[df_gse$ID==ID_GO_Term, "Description"],
". NES: ",
round(df_gse[df_gse$ID==ID_GO_Term,"NES"], 2),
". -log10(padj): ",
round(-log10(df_gse[df_gse$ID==ID_GO_Term,"p.adjust"]), 2) ),
y = "")
So to address your question it really depends what you mean by "font", what layer are you interested in? You should be able to change specific elements of the plot using theme(...)
, have a look here.
Hi Guangchuang,
I just came across a strange behaviour of your
gseaplot
function. Please have a look at the attached plots: while walking the ranked list the the enrichment score increases instead of decreasing .I paste here a long list of ENTREZ ID with fold changes to reproduce the same results I get.
I use the current latest version of these packages:
Here is some dummy data
and I create a ranked list like this
I checked if there are duplicates in my data that could possible cause this behaviour, but there were none.
The data itself looks like this when plotted
So when I do a GSEA I call gseGO with these parameters. The IDs are mouse.
With this threshold I find 94 (
nrow(as.data.frame(gse_obj))
) significant GO terms Until here I had no problems, but if I start plotting the data I feel something is going wrong.For example:
returns this plot:
You can see that where the Running enrichment Score should be decreasing because there are no genes in such GO term the line remains flat and increases the more you progress along the ranked list instead of decreasing. Now I'm not an expert of GSEA but I think this behaviour is not correct, right?
In addition, to figure out what was going wrong I tried to re-create locally your help functions
gseaScores
that I copied-pasted from here and thegsInfo
that I took from here thatgseaplot
is using.If add those function to my local environment and make a copy version of
gseaplot
calledlocal_gseaplot
which are identical and differ only in the name, in such a case the plots looks correct to me.Here are your functions that I used to try to fix this plotting problem:
exactly identical copy of your
gseaplot
functionand in fact when I try to plot the same GO term with the same data:
it gives me a correct plot!
Do you think this could be a bug?
I hope this issue is not a duplicate, I googled and could not find any other similar issue.
This is my
sessionInfo()