{"id":21390,"library":"goatools","title":"GOATOOLS","description":"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.","status":"active","version":"1.6.4","language":"python","source_language":"en","source_url":"https://github.com/tanghaibao/goatools","tags":["bioinformatics","gene ontology","enrichment analysis","GOEA","GO-term"],"install":[{"cmd":"pip install goatools","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Data manipulation for gene lists and results","package":"pandas","optional":false},{"reason":"Numerical computations","package":"numpy","optional":false},{"reason":"Statistical tests (Fisher's exact test)","package":"scipy","optional":false}],"imports":[{"note":"GOEnrichmentStudy is in the top-level goatools module, not a submodule","wrong":"from goatools.go_enrichment import GOEnrichmentStudy","symbol":"GOEnrichmentStudy","correct":"from goatools import GOEnrichmentStudy"},{"note":"GODag is in obo_parser submodule","wrong":"from goatools import GODag","symbol":"obo_parser","correct":"from goatools.obo_parser import GODag"},{"note":"GOAssociation is in associations submodule","wrong":"from goatools.annotations import GOAssociation","symbol":"GOAssociation","correct":"from goatools.associations import GOAssociation"}],"quickstart":{"code":"from goatools import GOEnrichmentStudy\nfrom goatools.obo_parser import GODag\nfrom goatools.associations import read_associations\n\n# Download go-basic.obo from http://geneontology.org/ontology/go-basic.obo\nobodag = GODag('go-basic.obo')\n\n# Load gene-to-GO associations (tab-separated: gene_id\\tGO_id)\nassoc = read_associations('gene2go.tsv', obodag, no_top=True)\n\n# List of gene IDs of interest (e.g., from RNA-seq)\ngene_list = ['GENE1', 'GENE2', 'GENE3']\n\n# Background population (e.g., all genes in genome)\npopulation = list(assoc.keys())\n\n# Run enrichment\ngoea = GOEnrichmentStudy(population, assoc, obodag, propagate_count=True, alpha=0.05)\nresults = goea.run_study(gene_list)\n\nprint(results[:5])","lang":"python","description":"Basic workflow: load GO DAG, load associations, run enrichment study."},"warnings":[{"fix":"Download go-basic.obo from http://geneontology.org/ontology/go-basic.obo and pass local path.","message":"The `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.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure exactly two columns: gene_symbol\\tGO:0000000.","message":"The `associations` file must be tab-separated with two columns: gene_id and GO_id. Extra columns or non-tab separators cause silent errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from goatools.associations import read_associations`.","message":"The function `goatools.evidence._evidence_filter` was removed in v1.0. Use `goatools.associations` instead.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Set `propagate_count=True` in GOEnrichmentStudy constructor.","message":"Enrichment results may have many rows with the same p-value due to propagation. Use `propagate_count=True` to avoid spurious significance.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Instantiate GODag: obodag = GODag('go-basic.obo'). Then use obodag['GO:0008150'].","cause":"Trying to use GODag as a dictionary without calling `GODag('go-basic.obo')` first.","error":"AttributeError: 'GODag' object has no attribute 'get'"},{"fix":"Ensure tab-separated file with exactly two columns: gene_id and GO_id. Use `head -n5 gene2go.tsv` to verify.","cause":"The associations file is malformed (e.g., wrong delimiter, extra columns).","error":"ValueError: Read associations: No data parsed, check file format"},{"fix":"Run `pip install goatools` in your active environment.","cause":"goatools not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'goatools'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}