I'm using GSEApy to do my enrichment analysis. I sorted my pre_res based on nes. I was trying to get GSEA plot for the first term, which is the most enriched. The most enriched was 'Mitotic G2/M Transition Checkpoint (GO:0044818)'. Here is the code I attempted to generate the plot
I even looked at the documentation but I'm not sure why it is giving me TypeError. Do I need to add something in the term=?
Any help is much appreciated. Thank you.
** only works in functions (kwargs). To unpack an object use *object.
Looking at this example:
# or use this to have more control on the plot# from gseapy import gseaplot2# terms = pre_res.res2d.Term[1:5]# hits = [pre_res.results[t]['hits'] for t in terms]# runes = [pre_res.results[t]['RES'] for t in terms]# fig = gseaplot2(terms=terms, ress=runes, hits=hits,# rank_metric=gs_res.ranking,# legend_kws={'loc': (1.2, 0)}, # set the legend loc# figsize=(4,5)) # rank_metric=pre_res.ranking
If you want to specify many term then you need to provide the input as a list. The easiest way to do this is like this: