Science Score: 46.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: nature.com -
✓Committers with academic emails
5 of 32 committers (15.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python library to handle Gene Ontology (GO) terms
Basic Info
Statistics
- Stars: 851
- Watchers: 23
- Forks: 216
- Open Issues: 42
- Releases: 0
Topics
Metadata Files
README.md
GOATOOLS: A Python library for Gene Ontology analyses
| | | | ------- | --------------------------------------------------------------------- | | Authors | Haibao Tang (tanghaibao) | | | DV Klopfenstein (dvklopfenstein) | | | Brent Pedersen (brentp) | | | Fidel Ramirez (fidelram) | | | Aurelien Naldi (aurelien-naldi) | | | Patrick Flick (patflick) | | | Jeff Yunes (yunesj) | | | Kenta Sato (bicycle1885) | | | Chris Mungall (cmungall) | | | Greg Stupp (stuppie) | | | David DeTomaso (deto) | | | Olga Botvinnik (olgabot) | | Email | tanghaibao@gmail.com | | License | BSD |
How to cite
[!TIP] GOATOOLS is now published in Scientific Reports!
Klopfenstein DV, ... Tang H (2018) GOATOOLS: A Python library for Gene Ontology analyses Scientific reports
- GO Grouping: Visualize the major findings in a gene ontology enrichment analysis (GOEA) more easily with grouping. A detailed description of GOATOOLS GO grouping is found in the manuscript.
- Compare GO lists:
Compare two or more lists
of GO IDs using
compare_gos.py, which can be used with or without grouping. - Stochastic GOEA simulations: One of the findings resulting from our simulations is: Larger study sizes result in higher GOEA sensitivity, meaning fewer truly significant observations go unreported. The code for the stochastic GOEA simulations described in the paper is found here

Contents
This package contains a Python library to
Process over- and under-representation of certain GO terms, based on Fisher's exact test. With numerous multiple correction routines including locally implemented routines for Bonferroni, Sidak, Holm, and false discovery rate. Also included are multiple test corrections from statsmodels: FDR Benjamini/Hochberg, FDR Benjamini/Yekutieli, Holm-Sidak, Simes-Hochberg, Hommel, FDR 2-stage Benjamini-Hochberg, FDR 2-stage Benjamini-Krieger-Yekutieli, FDR adaptive Gavrilov-Benjamini-Sarkar, Bonferroni, Sidak, and Holm.
Process the obo-formatted file from Gene Ontology website. The data structure is a directed acyclic graph (DAG) that allows easy traversal from leaf to root.
Read GO Association files:
- GAF (GO Annotation File)
- GPAD (Gene Product Association Data)
- NCBI's gene2go file
- id2gos format. See example
Print decendants count and/or information content for a list of GO terms
Get parents or ancestors for a GO term with or without optional relationships, including Print details about a GO ID's parents
Compare two or more lists of GO IDs
Group GO terms for easier viewing
Map GO terms (or protein products with multiple associations to GO terms) to GOslim terms (analog to the map2slim.pl script supplied by geneontology.org)
Installation
Make sure your Python version >= 3.7, and download an
.obo file of the most current
GO:
bash
wget http://current.geneontology.org/ontology/go-basic.obo
or .obo file for the most current GO
Slim terms (e.g.
generic GOslim) :
bash
wget http://current.geneontology.org/ontology/subsets/goslim_generic.obo
PyPI
bash
pip install goatools
To install the development version:
bash
pip install git+git://github.com/tanghaibao/goatools.git
Bioconda
bash
conda install -c bioconda goatools
Dependencies
When installing via PyPI or Bioconda as described above, all dependencies are automatically downloaded. Alternatively, you can manually install:
For statistical testing of GO enrichment:
scipy.stats.fisher_exactstatsmodels(optional) for access to a variety of statistical tests for GOEA
To plot the ontology lineage, install one of these two options:
- Graphviz, for graph visualization.
- pygraphviz, Python binding for communicating with Graphviz:
- pydot, a Python interface to Graphviz's Dot language.
Cookbook
run.sh contains example cases, which calls the utility scripts in the
scripts folder.
Find GO enrichment of genes under study
See examples in find_enrichment
The find_enrichment.py takes as arguments files
containing:
- gene names in a study
- gene names in population (or other study if
--compareis specified) - an association file that maps a gene name to a GO category.
Please look at tests/data folder to see examples on how to make these
files. when ready, the command looks like:
bash
python scripts/find_enrichment.py --pval=0.05 --indent data/study \
data/population data/association
and can filter on the significance of (e)nrichment or (p)urification. it can report various multiple testing corrected p-values as well as the false discovery rate.
The e in the "Enrichment" column means "enriched" - the concentration
of GO term in the study group is significantly higher than those in
the population. The "p" stands for "purified" - significantly lower
concentration of the GO term in the study group than in the population.
Important note: by default, find_enrichment.py propagates counts
to all the parents of a GO term. As a result, users may find terms in
the output that are not present in their association file. Use
--no_propagate_counts to disable this behavior.
Write GO hierarchy
wr_hier.py: Given a GO ID, write the hierarchy below (default) or above (--up) the given GO.
Plot GO lineage
go_plot.py:- Plots user-specified GO term(s) up to root
- Multiple user-specified GOs
- User-defined colors
- Plot relationships (
-r) - Optionally plot children of user-specfied GO terms
plot_go_term.pycan plot the lineage of a certain GO term, by:
bash
python scripts/plot_go_term.py --term=GO:0008135
This command will plot the following image.

Sometimes people like to stylize the graph themselves, use option
--gml to generate a GML output which can then be used in an external
graph editing software like Cytoscape. The
following image is produced by importing the GML file into Cytoscape
using yFile orthogonal layout and solid VizMapping. Note that the GML
reader plugin may need to be
downloaded and installed in the plugins folder of Cytoscape:
bash
python scripts/plot_go_term.py --term=GO:0008135 --gml

Map GO terms to GOslim terms
See map_to_slim.py for usage. As arguments it takes the gene ontology
files:
- the current gene ontology file
go-basic.obo - the GOslim file to be used (e.g.
goslim_generic.oboor any other GOslim file)
The script either maps one GO term to its GOslim terms, or protein products with multiple associations to all its GOslim terms.
To determine the GOslim terms for a single GO term, you can use the following command:
bash
python scripts/map_to_slim.py --term=GO:0008135 go-basic.obo goslim_generic.obo
To determine the GOslim terms for protein products with multiple associations:
bash
python scripts/map_to_slim.py --association_file=data/association go-basic.obo goslim_generic.obo
Where the association file has the same format as used for
find_enrichment.py.
The implementation is similar to map2slim.
Technical notes
Available statistical tests for calculating uncorrected p-values
For calculating uncorrected p-values, we use SciPy:
Available multiple test corrections
We have implemented several significance tests:
bonferroni, bonferroni correctionsidak, sidak correctionholm, hold correctionfdr, false discovery rate (fdr) implementation using resampling
Additional methods are available if statsmodels is installed:
sm_bonferroni, bonferroni one-step correctionsm_sidak, sidak one-step correctionsm_holm-sidak, holm-sidak step-down method using Sidak adjustmentssm_holm, holm step-down method using Bonferroni adjustmentssimes-hochberg, simes-hochberg step-up method (independent)hommel, hommel closed method based on Simes tests (non-negative)fdr_bh, fdr correction with Benjamini/Hochberg (non-negative)fdr_by, fdr correction with Benjamini/Yekutieli (negative)fdr_tsbh, two stage fdr correction (non-negative)fdr_tsbky, two stage fdr correction (non-negative)fdr_gbs, fdr adaptive Gavrilov-Benjamini-Sarkar
In total 15 tests are available, which can be selected using option
--method. Please note that the default FDR (fdr) uses a resampling
strategy which may lead to slightly different q-values between runs.
iPython Notebooks
Optional attributes
Run a Ontology Enrichment Analysis (GOEA)
goea_nbt3102 human phenotype ontologies
Show many study genes are associated with RNA, translation, mitochondria, and ribosomal
Report level and depth counts of a set of GO terms
Find all human protein-coding genes associated with cell cycle
Calculate annotation coverage of GO terms on various species
Determine the semantic similarities between GO terms
semantic_similarity semanticsimilaritywang
Obsolete GO terms are loaded upon request
Want to Help?
Prior to submitting your pull request, please add a test which verifies your code, and run:
console
make test
Items that we know we need include:
- Add code coverage runs
- Edit tests in the
makefileunder the comment - Help setting up documentation. We are using Sphinx and Python docstrings to create documentation. For documentation practice, use make targets:
bash
make mkdocs_practice
To remove practice documentation:
bash
make rmdocs_practice
Once you are happy with the documentation do:
bash
make gh-pages
Star History
Copyright (C) 2010-2021, Haibao Tang et al. All rights reserved.
Owner
- Name: Haibao Tang
- Login: tanghaibao
- Kind: user
- Location: San Francisco Bay Area
- Website: https://scholar.google.com/citations?user=66lj2Z0AAAAJ
- Twitter: tanghaibao
- Repositories: 14
- Profile: https://github.com/tanghaibao
Genomics data monkey, hacking on human genetics and diverse agricultural crops
GitHub Events
Total
- Issues event: 10
- Watch event: 76
- Delete event: 1
- Issue comment event: 3
- Push event: 3
- Pull request event: 3
- Fork event: 5
- Create event: 2
Last Year
- Issues event: 10
- Watch event: 76
- Delete event: 1
- Issue comment event: 3
- Push event: 3
- Pull request event: 3
- Fork event: 5
- Create event: 2
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| dvklopfenstein | d****n | 1,239 |
| Haibao Tang | t****o@g****m | 143 |
| fidelram | f****z@g****m | 26 |
| Olga Botvinnik | o****k@g****m | 22 |
| brentp | b****e@g****m | 14 |
| Alex Warwick Vesztrocy | a****5@u****k | 6 |
| r4d2 | p****k@g****m | 6 |
| Kenta Sato | b****5@g****m | 4 |
| Aurélien Naldi | a****i@u****h | 3 |
| James Pino | j****o@v****u | 3 |
| Chris Mungall | c****m@b****g | 3 |
| David DeTomaso | d****o@g****m | 2 |
| Greg Stupp | g****p@s****u | 2 |
| Li Xing | l****1@g****m | 2 |
| SLotreck | l****s@m****u | 2 |
| Uwe | u****t@i****h | 2 |
| Abolfazl (Abe) | 5****b | 1 |
| Douglas Myers-Turnbull | d****l@g****m | 1 |
| Michael Simpson | m****l@s****m | 1 |
| Lucas van Dijk | i****o@r****t | 1 |
| Gun.io Whitespace Robot | c****t@g****o | 1 |
| Fabio Zanini | f****i@f****m | 1 |
| Jeffrey Yunes | j****f@y****s | 1 |
| Mark Fiers | m****2@g****m | 1 |
| Philipp A | f****p@w****e | 1 |
| Piquipato | 3****o | 1 |
| RossLabCSU | 4****U | 1 |
| SchwarzMarek | s****k@o****m | 1 |
| Siebren Frölich | 4****f | 1 |
| Yo Co | 5****s | 1 |
| and 2 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 102
- Total pull requests: 54
- Average time to close issues: over 1 year
- Average time to close pull requests: about 20 hours
- Total issue authors: 93
- Total pull request authors: 13
- Average comments per issue: 2.5
- Average comments per pull request: 0.28
- Merged pull requests: 50
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 7
- Pull requests: 4
- Average time to close issues: 12 days
- Average time to close pull requests: about 1 hour
- Issue authors: 7
- Pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Maryam-Haghani (4)
- jasperhyp (3)
- WinterFor (2)
- AoifeHughes (2)
- ThHarbig (2)
- HelloWorldLTY (2)
- msbentsen (1)
- sjfleming (1)
- Lix1993 (1)
- stefan-dam (1)
- pomorale (1)
- akaur1988 (1)
- genignored (1)
- simonwm (1)
- ecgenomics (1)
Pull Request Authors
- tanghaibao (36)
- dvklopfenstein (4)
- SchwarzMarek (2)
- avigailtaylor (2)
- iosonofabio (2)
- serenalotreck (1)
- siebrenf (1)
- yotamcons (1)
- flying-sheep (1)
- Piquipato (1)
- RossLabCSU (1)
- fossabot (1)
- abearab (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 11,000 last-month
- Total docker downloads: 917
-
Total dependent packages: 18
(may contain duplicates) -
Total dependent repositories: 54
(may contain duplicates) - Total versions: 97
- Total maintainers: 2
pypi.org: goatools
Python scripts to find enrichment of GO terms
- Homepage: http://github.com/tanghaibao/goatools
- Documentation: https://goatools.readthedocs.io/
- License: BSD
-
Latest release: 1.5.1
published 6 months ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/tanghaibao/goatools
- Documentation: https://pkg.go.dev/github.com/tanghaibao/goatools#section-documentation
- License: bsd-2-clause
-
Latest release: v1.4.12
published over 1 year ago
Rankings
spack.io: py-goatools
Python scripts to find enrichment of GO terms
- Homepage: https://github.com/tanghaibao/goatools
- License: []
-
Latest release: 0.7.11
published almost 4 years ago
Rankings
Maintainers (1)
conda-forge.org: goatools
- Homepage: https://github.com/tanghaibao/goatools
- License: BSD-2-Clause
-
Latest release: 1.2.3
published over 3 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite