PyPathway
PyPathway copied to clipboard
A python package for pathway visualization
PyPathway
integrated Python toolkit for pathway based analysis
Installation
Install PyPathway via Anaconda is recommended.
- Download and install anaconda from Anaconda site
- Install
PyPathway
by
conda install -c steamedsheep pypathway
NOTE: If you want to install pypathway
via pypi
, please refer to the Installation section
Documentation and tests
View the docs at github.io
Regular tests and notebook (nbval) tests
Features
- Public databases APIs:
STRING
,BioGRID
,KEGG
,Reactome
andWikiPathway
- Functional set based and network based enrichment analysis algorithms implemented:
ORA
,GSEA
andSPIA
- Performance optimize for denovo enrichment algorithm
MAGI
andHotnet2
. - Network propagation algorithms
random walk
,RWR
andheat kernel
. - Interactive visualization and web page exportation for pathway, graph and analysis result.
- Integrated with
pandas
,networkx
andnumpy
. Most of the methods accept both text file and data structure from these packages - Dynamic visualization for
IPython notebook
. - Most classes implement
__repr__
method for interactive environment.
Network process
Intuitive APIs for querying and retrieval interaction network from public database. The return object are stored in networkx.Graph
object.
Support databases
-
KEGG
-
Reactome
-
WikiPathway
-
STRING
-
BioGRID
Search
from pypathway import PublicDatabase
kg = PublicDatabase.search_kegg('CD4')
wp = PublicDatabase.search_wp('CD4')
rt = PublicDatabase.search_reactome('CD4')
Load
pathway = r[0].load()
Plot
pathway.draw()
IPython notebook examples
Enrichment Analysis
Support methods
- ORA
- GSEA
- Network enrichment (SPIA and Enrichment)
- denovo enrichment (MAGI and Hotnet2)
Implementation / Interface
- Staticmethod
run()
for the starting of the analysis
r = SPIA.run(all=c.background, de=c.deg, organism='hsa')
-
table
,plot()
andgraph()
method for the presentation of the analysis
res.table
res.plot()
res.graph()
IPython examples
Modeling
- the Python Interface and optimize for
MAGI
- several c extension for
Hotnet
permutation performance
Propagation
Implemented algorithms
- Random walk
random_walk(G, h)
- Random walk with restart
random_walk_with_restart(G, h, rp=0.7, n=-1)
- Heat kernel
diffusion_kernel(G, h, rp=0.8, n=100)
Implementation detail
image source: Network propagation: a universal amplifier of genetic associations
IPython notebook examples
Utility and Performance
- The Id converter
- GMT file manager
- network and expression data sets.
- numpy implementation of SPIA
- node swap c extension for Hotnet2
- multi-threading for MAGI