Registry / data / goatools

goatools

JSON →
library1.6.5pypypi✓ verified 79d ago

A Python library to find enrichment of Gene Ontology (GO) terms among a set of genes. It provides tools for GO term enrichment analysis (Fisher's exact test, GOEA), GO term association, and visualization of GO hierarchies. Current version 1.6.4, released June 2024. Regular updates every few months.

pip install goatools
INSTALL
IMPORT
SIG · GOATOOLS
G
goatools
datapythonv1.6.5
Install
26.3s avg
Import
Disk
595MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.6.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 36.8s
py 3.11
✓ —
✓ 35.7s
py 3.12
✓ 0.1s
✓ 40.8s
py 3.13
✓ 0.1s
✓ 39s
py 3.9
✕ build_error
✓ 31.5s
595MB installed
● package 595MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GOEnrichmentStudy
from goatools.goea.go_enrichment_ns import GOEnrichmentStudy
from goatools import GOEnrichmentStudy

Basic workflow: load GO DAG, load associations, run enrichment study.

from goatools import GOEnrichmentStudy from goatools.obo_parser import GODag from goatools.associations import read_associations # Download go-basic.obo from http://geneontology.org/ontology/go-basic.obo obodag = GODag('go-basic.obo') # Load gene-to-GO associations (tab-separated: gene_id\tGO_id) assoc = read_associations('gene2go.tsv', obodag, no_top=True) # List of gene IDs of interest (e.g., from RNA-seq) gene_list = ['GENE1', 'GENE2', 'GENE3'] # Background population (e.g., all genes in genome) population = list(assoc.keys()) # Run enrichment goea = GOEnrichmentStudy(population, assoc, obodag, propagate_count=True, alpha=0.05) results = goea.run_study(gene_list) print(results[:5])
Debug
Known issues
gotchaThe `GODag` expects a local OBO file. Many users forget to download go-basic.obo first. Use `goatools.obo_parser.GODag('http://purl.obolibrary.org/obo/go/go-basic.obo')` to fetch remotely only if you have stable internet; but for reproducibility, download locally.
fix
Download go-basic.obo from http://geneontology.org/ontology/go-basic.obo and pass local path.
affects: all
gotchaThe `associations` file must be tab-separated with two columns: gene_id and GO_id. Extra columns or non-tab separators cause silent errors.
fix
Ensure exactly two columns: gene_symbol\tGO:0000000.
affects: all
deprecatedThe function `goatools.evidence._evidence_filter` was removed in v1.0. Use `goatools.associations` instead.
fix
Use `from goatools.associations import read_associations`.
affects: >=1.0
gotchaEnrichment results may have many rows with the same p-value due to propagation. Use `propagate_count=True` to avoid spurious significance.
fix
Set `propagate_count=True` in GOEnrichmentStudy constructor.
affects: all
Upgrade
Version history
1.6.5latest on PyPI · released May 12, 2026
Audit
Dependencies
pandasrequiredData manipulation for gene lists and results
numpyrequiredNumerical computations
scipyrequiredStatistical tests (Fisher's exact test)
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
goatools — pip install goatools · libregistry