This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Gene set enrichment tool for RNA-Seq in Python?

Is there a library in Python for doing gene set enrichment analysis (GSEA, http://www.broadinstitute.org/gsea/index.jsp)? A library/tool that takes a foreground set of genes, a background set, a gene sets database like the one available from Broad and does the analysis without relying on microarray-specific items like probe IDs? All the tools I found are made for microarrays but I want to do this for rna-seq. If there's no library in Python, is there a command line tool that can do this again without relying on probe IDs?

gsea gene-ontology go rna-seq python

4 answers

There's nothing about gene set analysis that is dependent on array probe Ids; once you have gene level expression measurements (ie. indexed by gene symbol or entrez gene id) you can use any of the existing tools (eg GSEA). Some of them do have features to convert from probesets to gene symbols, but you don't need to use that feature.

It's also pretty straightforward to roll your own simple enrichment analysis in python. A python library would be nice though; I have some code for this that I've been meaning to tidy up..

which existing tools would you use, apart from GSEA?

Just set some cutoffs and run hypergeometric tests by computing overlaps using python sets and calculating significance with scipy.stats.hypergeom and statsmodels.sandbox.stats.multicomp

Maybe contrary to the spirit of your question, but there are many great tools for this available for R from Bioconductor. I can see advantages of a python native library, but it might be faster to call R from python.

The top two results for googling "GSEA python" were these libraries: pygsa and geseabase, and as Adrian already told you the analysis is independent of probeids. You will find the data format guides for GSEA and for pygsa library here: GSEA data format guide

What about 'GSEAPY: Gene Set Enrichment Analysis in Python'?

Log in to answer this question.