enrichplot icon indicating copy to clipboard operation
enrichplot copied to clipboard

gseaplot2 : error in red-to-blue gradient

Open bug1303 opened this issue 5 years ago • 1 comments

I was wondering what the red-to-blue gradient should represent (geom_rect in subplot 2). In broadinstitute's GSEA results, the switch from red to blue happens on the zero-cross of the ranked list metric, as seems intuitive. This is not the case for gseaplot2. Here, instead intervals are found based on where there are hits (gsdata$position). From glancing at the function, it seems that it tries to put equally many hits (vertical bars) into one shade. However, from data that is very much enriched on one end, it becomes visible that the min/max ranges are actually the wrong way round.

e.g. in this Example, the first 'hit' was at gene 6028, which falls in the 5th (and last red) interval, while the last blue box is that wide (as I expected the first red one should be):

gseaplot2_screenshot

So, as a minimum this should be turned around; or more probably, the whole finding of intervals should be based on the ranked values instead, unless I'm overlooking something. In this case, please enlighten me.

bug1303 avatar Apr 01 '19 18:04 bug1303

I actually have the same question too.

May I know if anyone can explain a little bit? Much appreciated!🙏🏻

MarcusLCC avatar Nov 17 '22 14:11 MarcusLCC