All Projects → tanghaibao → Goatools

tanghaibao / Goatools

Licence: bsd-2-clause
Python library to handle Gene Ontology (GO) terms

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Goatools

viralrecall
Detection of NCLDV signatures in 'omic data
Stars: ✭ 15 (-96.39%)
Mutual labels:  genomics
Seq
A high-performance, Pythonic language for bioinformatics
Stars: ✭ 263 (-36.63%)
Mutual labels:  genomics
Bowtie2
A fast and sensitive gapped read aligner
Stars: ✭ 365 (-12.05%)
Mutual labels:  genomics
PHANOTATE
PHANOTATE: a tool to annotate phage genomes.
Stars: ✭ 38 (-90.84%)
Mutual labels:  genomics
Postgui
A React web application to query and share any PostgreSQL database.
Stars: ✭ 260 (-37.35%)
Mutual labels:  genomics
Gwa tutorial
A comprehensive tutorial about GWAS and PRS
Stars: ✭ 303 (-26.99%)
Mutual labels:  genomics
mccortex
De novo genome assembly and multisample variant calling
Stars: ✭ 105 (-74.7%)
Mutual labels:  genomics
Bwa Mem2
The next version of bwa-mem
Stars: ✭ 408 (-1.69%)
Mutual labels:  genomics
Pygeno
Personalized Genomics and Proteomics. Main diet: Ensembl, side dishes: SNPs
Stars: ✭ 261 (-37.11%)
Mutual labels:  genomics
Megahit
Ultra-fast and memory-efficient (meta-)genome assembler
Stars: ✭ 343 (-17.35%)
Mutual labels:  genomics
Eggnog Mapper
Fast genome-wide functional annotation through orthology assignment
Stars: ✭ 256 (-38.31%)
Mutual labels:  genomics
Vcfanno
annotate a VCF with other VCFs/BEDs/tabixed files
Stars: ✭ 259 (-37.59%)
Mutual labels:  genomics
Pyfaidx
Efficient pythonic random access to fasta subsequences
Stars: ✭ 307 (-26.02%)
Mutual labels:  genomics
varsome-api-client-python
Example client programs for Saphetor's VarSome annotation API
Stars: ✭ 21 (-94.94%)
Mutual labels:  genomics
Jbrowse
A modern genome browser built with JavaScript and HTML5.
Stars: ✭ 393 (-5.3%)
Mutual labels:  genomics
gff3toembl
Converts Prokka GFF3 files to EMBL files for uploading annotated assemblies to EBI
Stars: ✭ 27 (-93.49%)
Mutual labels:  genomics
Arvados
An open source platform for managing and analyzing biomedical big data
Stars: ✭ 274 (-33.98%)
Mutual labels:  genomics
Vcflib
C++ library and cmdline tools for parsing and manipulating VCF files
Stars: ✭ 414 (-0.24%)
Mutual labels:  genomics
Jcvi
Python library to facilitate genome assembly, annotation, and comparative genomics
Stars: ✭ 404 (-2.65%)
Mutual labels:  genomics
Jvarkit
Java utilities for Bioinformatics
Stars: ✭ 313 (-24.58%)
Mutual labels:  genomics

Tools for Gene Ontology

DIO Latest PyPI version bioconda Github Actions

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 [email protected]
License BSD

Description

This package contains a Python library to

To Cite

Please cite the following research paper if you use GOATOOLS in your research:

Klopfenstein DV, Zhang L, Pedersen BS, ... Tang H GOATOOLS: A Python library for Gene Ontology analyses Scientific reports | (2018) 8:10872 | DOI:10.1038/s41598-018-28948-z

  • GO Grouping: Visualize the major findings in a gene ontology enrichment analysis (GEOA) 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 scripts/compare_gos.py. This script 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

Installation

Make sure your Python version >= 2.7, install the latest stable version via PyPI:

pip install goatools

To install the development version:

pip install git+git://github.com/tanghaibao/goatools.git

.obo file for the most current GO:

wget http://geneontology.org/ontology/go-basic.obo

.obo file for the most current GO Slim terms (e.g. generic GOslim) :

wget http://www.geneontology.org/ontology/subsets/goslim_generic.obo

Dependencies

  • Simplest is to install via bioconda. See details here.

  • To calculate the uncorrected p-values, there are currently twooptions:

    • fisher for calculating Fisher's exact test:
    pip install fisher
    
    • fisher from SciPy's stats package

    • statsmodels (optional) for access to a variety of statistical tests for GOEA:

    pip install statsmodels
    
  • To plot the ontology lineage, install one of these two options:

    • Graphviz

      • Graphviz, for graph visualization.
      • pygraphviz, Python binding for communicating with Graphviz:
      pip install pygraphviz
      
    • 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 examples

See find_enrichment.py for usage. It takes as arguments files containing:

  • gene names in a study
  • gene names in population (or other study if --compare is 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:

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

  • scripts/wr_hier.py: Given a GO ID, write the hierarchy below (default) or above (--up) the given GO.

Plot GO lineage

  • scripts/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
  • scripts/plot_go_term.py

plot_go_term.py

See plot_go_term.py for usage. plot_go_term.py can plot the lineage of a certain GO term, by:

python scripts/plot_go_term.py --term=GO:0008135

This command will plot the following image.

GO term lineage

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:

python scripts/plot_go_term.py --term=GO:0008135 --gml

GO term lineage (Cytoscape)

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.obo or 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:

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:

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 implemented algorithm is described in more detail at the go-perl documentation of map2slim.

Technical notes

Available statistical tests for calculating uncorrected p-values

There are currently two fisher tests available for calculating uncorrected p-values. Both fisher options from the fisher package and SciPy's stats package calculate the same pvalues, but provide the user an option in installing packages.

Available multiple test corrections

We have implemented several significance tests:

  • bonferroni, bonferroni correction
  • sidak, sidak correction
  • holm, hold correction
  • fdr, false discovery rate (fdr) implementation using resampling

Additional methods are available if statsmodels is installed:

  • sm_bonferroni, bonferroni one-step correction
  • sm_sidak, sidak one-step correction
  • sm_holm-sidak, holm-sidak step-down method using Sidak adjustments
  • sm_holm, holm step-down method using Bonferroni adjustments
  • simes-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

Run a Gene Ontology Enrichment Analysis (GOEA)

https://github.com/tanghaibao/goatools/blob/main/notebooks/goea_nbt3102.ipynb

Show many study genes are associated with RNA, translation, mitochondria, and ribosomal

https://github.com/tanghaibao/goatools/blob/main/notebooks/goea_nbt3102_group_results.ipynb

Report level and depth counts of a set of GO terms

https://github.com/tanghaibao/goatools/blob/main/notebooks/report_depth_level.ipynb

Find all human protein-coding genes associated with cell cycle

https://github.com/tanghaibao/goatools/blob/main/notebooks/cell_cycle.ipynb

Calculate annotation coverage of GO terms on various species

https://github.com/tanghaibao/goatools/blob/main/notebooks/annotation_coverage.ipynb

Determine the semantic similarities between GO terms

Obsolete GO terms are loaded upon request

https://github.com/tanghaibao/goatools/blob/main/notebooks/godag_obsolete_terms.ipynb

Want to Help?

Prior to submitting your pull request, please add a test which verifies your code, and run:

make test

Items that we know we need include:

  • Add code coverage runs

  • Edit tests in the makefile under the comment, # TBD, suchthey run using nosetests

  • Help setting up documentation. We are using Sphinx and Python docstrings to create documentation. For documentation practice, use make targets:

    make mkdocs_practice
    

    To remove practice documentation:

    make rmdocs_practice
    

    Once you are happy with the documentation do:

    make gh-pages
    

Copyright (C) 2010-2018, Haibao Tang et al. All rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].