zqfang / GSEApy

Gene Set Enrichment Analysis in Python
http://gseapy.rtfd.io/
BSD 3-Clause "New" or "Revised" License
548 stars 114 forks source link

KeyError: 'Adjusted P-value' in dotplot #165

Closed alexlenail closed 2 years ago

alexlenail commented 2 years ago

from the docs

from gseapy import barplot, dotplot

dotplot(res.res2d, title='WikiPathways_2019_Mouse', cmap='viridis_r', size=20, figsize=(3,5))

throws error:

KeyError: 'Adjusted P-value'

the columsn of res2d are

 Index(['Name', 'Term', 'ES', 'NES', 'NOM p-val', 'FDR q-val', 'FWER p-val',
       'Tag %', 'Gene %', 'Lead_genes'],
zqfang commented 2 years ago

dotplot is not designed for GSEA results initially.

However, if you install gseapy from the lastest push, you could do this

from gseapy import dotplot
# to save your figure, make sure that ``ofname`` is not None
ax = dotplot(pre_res.res2d, 
             column="FDR q-val",
             title='KEGG_2016',
             cmap=plt.cm.viridis, 
             size=8, # adjust dot size
             figsize=(4,5), cutoff=0.25)

image