Open Vanessa104 opened 3 months ago
Thanks for catching it @Vanessa104. While your solution works, it outputs the warning
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
We need to find a more 'radical' solution.
What about trans=c("log10", "reverse")
?
Thanks for catching it @Vanessa104. While your solution works, it outputs the warning
Scale for colour is already present. Adding another scale for colour, which will replace the existing scale.
We need to find a more 'radical' solution.
The warning is because scale_color_manual is already defined in the hyp_dots() function (at line 111), so defining it again will give you a warning. If we replace the current line 111 with the new code, then there will be no warnings. I didn’t commit the change and created this issue instead, in case there is a better solution or in case there are other developments going on.
When drawing dot plot Function hyp_dots() when used for a mylti_hyp object. See the significance legend:![image](https://github.com/montilab/hypeR/assets/56649879/f3f7cd9d-2f00-40ae-822c-3946b3f66bf9)
This is likely due to the newer version of the package
scales
. Unsure which version exactly, but it seems like internal function .reverselog_trans() which is based on scales::trans_new() is not working well.Solution: https://github.com/montilab/hypeR/blob/master/R/hyp_dots.R Line 111. Change this line to:
scale_color_continuous(high = "#114357", low = "#E53935", trans = scales::log10_trans(), guide = guide_colorbar(reverse = TRUE))
Or, add this after using hyp_dots() to overwrite the existing function.
hyp_dots(...) + scale_color_continuous(...insert above...)
Example output:![image](https://github.com/montilab/hypeR/assets/56649879/9817ec7d-c7ad-4c45-a2de-77ba966bfc7c)