Package: goatools
Tools for Gene OntologyAuthorsHaibao 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)Emailtanghaibao@gmail.comLicenseBSDDescriptionThis package contains a Python library toProcess 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 fromstatsmodels: 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 fromGene Ontology
website. The data structure is a directed
acyclic graph (DAG) that allows easy traversal from leaf to root.ReadGO Association files:GAF (GO Annotation
File)GPAD (Gene Product Association Data)NCBI's gene2go fileid2gos format. SeeexamplePrintdecendants countand/orinformation contentfor a list of GO termsGet parents or ancestors for a GO term with or without optional
relationships, includingPrint details about a
GO ID's parentsCompare two or more lists of GO IDsPlot GO hierarchiesWrite GO hierarchies to an ASCII text fileGroup GO terms for easier viewingMap GO terms (or protein products with multiple associations to
GO terms) to GOslim terms (analog to the map2slim.pl script supplied
by geneontology.org)To CiteKlopfenstein DV, Zhang L, Pedersen BS, ... Tang HGOATOOLS: A Python library for Gene Ontology analysesScientific reports| (2018) 8:10872 | DOI:10.1038/s41598-018-28948-zGO 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 themanuscript.Compare GO lists:
Comparetwoor more lists
of GO IDs usingcompare_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 foundhereInstallationMake sure your Python version >= 3.7, and download an.obofile of the most currentGO:wgethttp://current.geneontology.org/ontology/go-basic.oboor.obofile for the most currentGO
Slimterms (e.g.
generic GOslim) :wgethttp://current.geneontology.org/ontology/subsets/goslim_generic.oboPyPIpipinstallgoatoolsTo install the development version:pipinstallgit+git://github.com/tanghaibao/goatools.gitBiocondacondainstall-cbiocondagoatoolsDependenciesWhen 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 GOEATo 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.Cookbookrun.shcontains example cases, which calls the utility scripts in thescriptsfolder.Find GO enrichment of genes under studySee examples infind_enrichmentThefind_enrichment.pytakes as arguments files
containing:gene names in a studygene names in population (or other study if--compareis specified)an association file that maps a gene name to a GO category.Please look attests/datafolder to see examples on how to make these
files. when ready, the command looks like:pythonscripts/find_enrichment.py--pval=0.05--indentdata/study\data/populationdata/associationand 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.Theein the "Enrichment" column means "enriched" - the concentration
of GO term in the study group is significantlyhigherthan those in
the population. The "p" stands for "purified" - significantlylowerconcentration of the GO term in the study group than in the population.Important note: by default,find_enrichment.pypropagates counts
to all the parents of a GO term. As a result, users may find terms in
the output that are not present in theirassociationfile. Use--no_propagate_countsto disable this behavior.Write GO hierarchywr_hier.py: Given a GO ID, write the hierarchy below (default)
or above (--up) the given GO.Plot GO lineagego_plot.py:Plots user-specified GO term(s) up to rootMultiple user-specified GOsUser-defined colorsPlot relationships (-r)Optionally plot children of user-specfied GO termsplot_go_term.pycan plot the lineage
of a certain GO term, by:pythonscripts/plot_go_term.py--term=GO:0008135This command will plot the following image.Sometimes people like to stylize the graph themselves, use option--gmlto generate a GML output which can then be used in an external
graph editing software likeCytoscape. The
following image is produced by importing the GML file into Cytoscape
using yFile orthogonal layout and solid VizMapping. Note that theGML
reader pluginmay need to be
downloaded and installed in thepluginsfolder of Cytoscape:pythonscripts/plot_go_term.py--term=GO:0008135--gmlMap GO terms to GOslim termsSeemap_to_slim.pyfor usage. As arguments it takes the gene ontology
files:the current gene ontology filego-basic.obothe 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:pythonscripts/map_to_slim.py--term=GO:0008135go-basic.obogoslim_generic.oboTo determine the GOslim terms for protein products with multiple
associations:pythonscripts/map_to_slim.py--association_file=data/associationgo-basic.obogoslim_generic.oboWhere theassociationfile has the same format as used forfind_enrichment.py.The implementation is similar tomap2slim.Technical notesAvailable statistical tests for calculating uncorrected p-valuesFor calculating uncorrected p-values, we use SciPy:scipy.stats.fisher_exactAvailable multiple test correctionsWe have implemented several significance tests:bonferroni, bonferroni correctionsidak, sidak correctionholm, hold correctionfdr, false discovery rate (fdr) implementation using resamplingAdditional methods are available ifstatsmodelsis 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-SarkarIn 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.iPythonNotebooksOptional attributesdefinitionRun a Ontology Enrichment Analysis (GOEA)goea_nbt3102human phenotype ontologiesShow many study genes are associated with RNA, translation, mitochondria, and ribosomalgoea_nbt3102_group_resultsReport level and depth counts of a set of GO termsreport_depth_levelFind all human protein-coding genes associated with cell cyclecell_cycleCalculate annotation coverage of GO terms on various speciesannotation_coverageDetermine the semantic similarities between GO termssemantic_similaritysemantic_similarity_wangObsolete GO terms are loaded upon requestgodag_obsolete_termsWant to Help?Prior to submitting your pull request, please add a test which verifies your code, and run:make testItems that we know we need include:Add code coverage runsEdit tests in themakefileunder the commentHelp setting updocumentation. We
are using Sphinx and Python docstrings to create documentation.
For documentation practice, use make targets:makemkdocs_practiceTo remove practice documentation:makermdocs_practiceOnce you are happy with the documentation do:makegh-pagesStar HistoryCopyright (C) 2010-2021, Haibao Tang et al. All rights reserved.