goenrich

GO enrichment with python -- pandas meets networkx

https://github.com/jdrudolph/goenrich

Science Score: 20.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: ncbi.nlm.nih.gov
  • Committers with academic emails
    1 of 8 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords

annotation-enrichment bioinformatics gene-ontology
Last synced: 11 months ago · JSON representation

Repository

GO enrichment with python -- pandas meets networkx

Basic Info
  • Host: GitHub
  • Owner: jdrudolph
  • Language: Python
  • Default Branch: master
  • Size: 152 KB
Statistics
  • Stars: 88
  • Watchers: 5
  • Forks: 23
  • Open Issues: 1
  • Releases: 0
Topics
annotation-enrichment bioinformatics gene-ontology
Created about 11 years ago · Last pushed about 6 years ago
Metadata Files
Readme

README.rst

goenrich
========

.. image:: https://badges.gitter.im/Join%20Chat.svg
    :target: https://gitter.im/jdrudolph/goenrich?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

.. image:: https://readthedocs.org/projects/goenrich/badge/?version=latest
    :target: https://goenrich.readthedocs.org/en/latest

.. image:: https://travis-ci.org/jdrudolph/goenrich.svg?branch=master
    :target: https://travis-ci.org/jdrudolph/goenrich

Convenient GO enrichments from python. For use in ``python`` projects.

#. Builds the GO-ontology graph
#. Propagates GO-annotations up the graph
#. Performs enrichment test for all categories
#. Performs multiple testing correction
#. Allows for export to ``pandas`` for processing and ``graphviz`` for
   visualization

Installation
------------

| Install package from pypi and download ontology and needed annotations.

.. code:: shell

    pip install goenrich
    mkdir db
    # Ontology
    wget http://purl.obolibrary.org/obo/go/go-basic.obo -O db/go-basic.obo
    # UniprotACC
    wget http://geneontology.org/gene-associations/goa_human.gaf.gz -O db/gene_association.goa_human.gaf.gz
    # Yeast SGD
    wget http://downloads.yeastgenome.org/curation/literature/gene_association.sgd.gz -O db/gene_association.sgd.gz
    # Entrez GeneID
    wget ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz -O db/gene2go.gz

Run GO enrichment
-----------------

.. code:: python

  import goenrich

  # build the ontology
  O = goenrich.obo.ontology('db/go-basic.obo')

  # use all entrez geneid associations form gene2go as background
  # use annot = goenrich.read.goa('db/gene_association.goa_human.gaf.gz') for uniprot
  # use annot = goenrich.read.sgd('db/gene_association.sgd.gz') for yeast
  gene2go = goenrich.read.gene2go('db/gene2go.gz')
  # use values = {k: set(v) for k,v in annot.groupby('go_id')['db_object_symbol']} for uniprot/yeast
  values = {k: set(v) for k,v in gene2go.groupby('GO_ID')['GeneID']}

  # propagate the background through the ontology
  background_attribute = 'gene2go'
  goenrich.enrich.propagate(O, values, background_attribute)

  # extract some list of entries as example query
  # use query = annot['db_object_symbol'].unique()[:20]
  query = gene2go['GeneID'].unique()[:20]

  # for additional export to graphviz just specify the gvfile argument
  # the show argument keeps the graph reasonably small
  df = goenrich.enrich.analyze(O, query, background_attribute, gvfile='test.dot')

  # generate html
  df.dropna().head().to_html('example.html')

  # call to graphviz
  import subprocess
  subprocess.check_call(['dot', '-Tpng', 'test.dot', '-o', 'test.png'])

Generate ``png`` image using graphviz:

.. code:: shell

    dot -Tpng example.dot > example.png

or directly from python:

.. code:: python

  import subprocess
  subprocess.check_call(['dot', '-Tpng', 'example.dot', '-o', 'example.png'])

.. image:: https://cloud.githubusercontent.com/assets/2606663/8525018/cad3a288-23fe-11e5-813c-bd205a47eed8.png

Check the documentation for all available parameters

Licence & Contributors
======================

This work is licenced under the MIT licence

Contributions are welcome!

Special thanks
--------------

- `@lukauskas `_ for implementing i/o support for file-like objects.
- `@zfrenchee `_ for fixing a bug in the calculation of the test statistic.
- `@pommy1 `_ for implementing support for `networkx >= 2.0.0`.

Building the documentation
==========================

.. code:: shell

  sphinx-apidoc -f -o docs goenrich goenrich/tests

Owner

  • Name: Jan Rudolph
  • Login: jdrudolph
  • Kind: user
  • Location: Munich
  • Company: Phd student at MPI for Biochemistry

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 65
  • Total Committers: 8
  • Avg Commits per committer: 8.125
  • Development Distribution Score (DDS): 0.308
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
jandanielr j****h@g****m 45
Jan Rudolph r****h@b****e 14
Saulius Lukauskas l****s@g****m 1
Michael Flashman f****h@z****m 1
Alexander Lenail a****x@l****g 1
darachm n****e 1
pommy1 p****1 1
The Gitter Badger b****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 11
  • Total pull requests: 9
  • Average time to close issues: 3 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 9
  • Total pull request authors: 8
  • Average comments per issue: 2.27
  • Average comments per pull request: 2.0
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • srcoulombe (2)
  • mikpom (2)
  • iamjli (1)
  • ebolyen (1)
  • alexlenail (1)
  • josiahseaman (1)
  • keoughkath (1)
  • radusuciu (1)
  • jdrudolph (1)
Pull Request Authors
  • mikpom (2)
  • lukauskas (1)
  • gitter-badger (1)
  • alexlenail (1)
  • flashman (1)
  • jdrudolph (1)
  • srcoulombe (1)
  • darachm (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels
enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 47 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 8
  • Total versions: 27
  • Total maintainers: 1
pypi.org: goenrich

GO enrichment with python -- pandas meets networkx

  • Versions: 27
  • Dependent Packages: 1
  • Dependent Repositories: 8
  • Downloads: 47 Last month
Rankings
Dependent packages count: 4.7%
Dependent repos count: 5.2%
Stargazers count: 7.5%
Forks count: 7.8%
Average: 8.9%
Downloads: 19.3%
Maintainers (1)
Last synced: 11 months ago

Dependencies

setup.py pypi
  • networkx *
  • numpy *
  • pandas *
  • scipy *