Giter Club home page Giter Club logo

pypathway's Introduction

PyPathway

integrated Python toolkit for pathway based analysis

PyPI version Build Status

Installation

Install PyPathway via Anaconda is recommended.

  1. Download and install anaconda from Anaconda site
  2. 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 and WikiPathway
  • Functional set based and network based enrichment analysis algorithms implemented: ORA, GSEA and SPIA
  • Performance optimize for denovo enrichment algorithm MAGI and Hotnet2.
  • Network propagation algorithms random walk, RWR and heat kernel.
  • Interactive visualization and web page exportation for pathway, graph and analysis result.
  • Integrated with pandas, networkx and numpy. 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() and graph() 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

pypathway's People

Contributors

iseekwonderful avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pypathway's Issues

SPIA colorectal dataset results differ from original literature

Hey, I just had a quick question about the SPIA implementation. I noticed that in the tutorial you posted, the p-values for the Colorectal dataset seem to be quite different from the original literature values. For example, pPERT for Alzheimer's Disease is 0.229 in your example but 0.7260 in the original paper by Tarca et al. Is this due to updating of the KEGG database since that paper was published in 2008, or are the datasets used in both cases different?

Thanks!

Inconsistent results when running pathway analyses using Symbol/entrezid

Hi,
I am using the ora package to perform Reactome and KEGG analyses. I have gene symbols so I used IdMapping to convert them to entrezid. From the conversion I lost a small amount of genes (eg 4 over 1700+ genes in my degs subset).

I performed the analyses both using symbol and entrezid, however I get totally different results. I considered that the loss of genes from the conversion was insignificant to explain these differences, so I was wondering what is the problem.

Thanks

Cannot install in a clean virtualenv

A Python package should always be able to install itself in an empty virtualenv and handle dependencies automatically. Trying to do this with PyPathway fails:

$ git clone https://github.com/iseekwonderful/PyPathway.git
$ cd PyPathway
$ python3 -m venv build_env
$ source build_env/bin/activate
$ python3 -m pip install -e .
Obtaining file:///opt/repos/PyPathway
    ERROR: Command errored out with exit status 1:
     command: /opt/repos/PyPathway/build_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/repos/PyPathway/setup.py'"'"'; __file__='"'"'/opt/repos/PyPathway/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /opt/repos/PyPathway/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/opt/repos/PyPathway/setup.py", line 8, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This is because numpy is imported before the install_requires directive has a chance to install it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.