Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
GOATOOLS
GOATOOLS

User guide

  • Command-line guides
    • Gene Ontolog Enrichment Analyses (GOEA) from the command-line
    • Plot the GO hierarchy with goatools go_plot
    • Print all or part of the GO hierarchy
    • NCBI GeneID and Symbol
  • Tutorials
    • Do enrichment analyses using the Human Phenotype Ontology (HPO)
    • Loading the optional definition attribute
    • Calculating Annotation Coverage
    • Reading Annotations from a GO Association File (GAF)
    • Reading a Gene Product Association Data (GPAD) file
    • Annotations in NCBI’s gene2go file
    • How to download background genes from NCBI
    • Cell Cycle genes
    • How to traverse to GO children and descendants
    • Information Content for Custom GO Annotations (id2go format)
    • How to get Descendants Count and Information Content
    • How to get GO IDs up both the ‘is a’ and ‘part of’ relationships
    • Loading obsolete GO terms
    • Run a Gene Ontology Enrichment Analysis (GOEA)
    • Run a GOEA. Print study genes as either IDs symbols
    • Gene Ontology Enrichment Analysis (GOEA)
    • Group Significant GO terms by Frequently Seen Words
    • How to extract information from parent GO terms
    • How to traverse to GO parents and ancestors
    • Adding optional relationships changes the dcnt value
    • Relationships in the GO
    • Report counts of GO terms at various levels and depths
    • Computing basic semantic similarities between GO terms
    • Calculating Wang’s Semantic Similarity between two GO Terms
    • Notebook Images
    • GO parents

Reference

  • API reference
    • goatools package
      • goatools.anno package
        • goatools.anno.extensions package
          • goatools.anno.extensions.extension module
          • goatools.anno.extensions.extensions module
          • goatools.anno.extensions.factory module
        • goatools.anno.init package
          • goatools.anno.init.reader_gaf module
          • goatools.anno.init.reader_genetogo module
          • goatools.anno.init.reader_gpad module
          • goatools.anno.init.reader_idtogos module
          • goatools.anno.init.utils module
        • goatools.anno.annoreader_base module
        • goatools.anno.broad_gos module
        • goatools.anno.dnld_ebi_goa module
        • goatools.anno.eco2group module
        • goatools.anno.factory module
        • goatools.anno.gaf_reader module
        • goatools.anno.genetogo_reader module
        • goatools.anno.gpad_reader module
        • goatools.anno.idtogos_reader module
        • goatools.anno.opts module
        • goatools.anno.update_association module
      • goatools.cli package
        • goatools.cli.compare_gos module
        • goatools.cli.docopt_parse module
        • goatools.cli.fetch_associations module
        • goatools.cli.find_enrichment module
        • goatools.cli.gos_get module
        • goatools.cli.gosubdag_plot module
        • goatools.cli.grouped module
        • goatools.cli.main module
        • goatools.cli.map_to_slim module
        • goatools.cli.ncbi_gene_results_to_python module
        • goatools.cli.plot_go_term module
        • goatools.cli.prt_terms module
        • goatools.cli.wr_hierarchy module
        • goatools.cli.wr_sections module
      • goatools.godag package
        • goatools.godag.consts module
        • goatools.godag.go_tasks module
        • goatools.godag.obo_optional_attributes module
        • goatools.godag.obographs module
        • goatools.godag.prtfncs module
        • goatools.godag.prttime module
        • goatools.godag.relationship_combos module
        • goatools.godag.relationship_str module
        • goatools.godag.reldepth module
        • goatools.godag.typedef module
      • goatools.goea package
        • goatools.goea.algorithms package
          • goatools.goea.algorithms.base module
          • goatools.goea.algorithms.classic module
          • goatools.goea.algorithms.elim module
        • goatools.goea.go_enrichment_ns module
      • goatools.gosubdag package
        • goatools.gosubdag.plot package
          • goatools.gosubdag.plot.go2color module
          • goatools.gosubdag.plot.go_edge module
          • goatools.gosubdag.plot.go_name_shorten module
          • goatools.gosubdag.plot.go_node module
          • goatools.gosubdag.plot.goea_results module
          • goatools.gosubdag.plot.gosubdag_plot module
          • goatools.gosubdag.plot.plot module
        • goatools.gosubdag.rpt package
          • goatools.gosubdag.rpt.wr_xlsx module
          • goatools.gosubdag.rpt.write_hierarchy module
        • goatools.gosubdag.go_edges module
        • goatools.gosubdag.go_most_specific module
        • goatools.gosubdag.go_paths module
        • goatools.gosubdag.go_tasks module
        • goatools.gosubdag.godag_rcnt module
        • goatools.gosubdag.godag_rcnt_init module
        • goatools.gosubdag.gosubdag module
        • goatools.gosubdag.gosubdag_init module
        • goatools.gosubdag.utils module
      • goatools.grouper package
        • goatools.grouper.aart_geneproducts_all module
        • goatools.grouper.aart_geneproducts_one module
        • goatools.grouper.colors module
        • goatools.grouper.grprdflts module
        • goatools.grouper.grprobj module
        • goatools.grouper.grprobj_init module
        • goatools.grouper.grprplt module
        • goatools.grouper.hdrgos module
        • goatools.grouper.plotobj module
        • goatools.grouper.read_goids module
        • goatools.grouper.sorter module
        • goatools.grouper.sorter_gos module
        • goatools.grouper.sorter_nts module
        • goatools.grouper.tasks module
        • goatools.grouper.utils module
        • goatools.grouper.wr_sections module
        • goatools.grouper.wrxlsx module
      • goatools.parsers package
        • goatools.parsers.david_chart module
        • goatools.parsers.ncbi_gene_file_reader module
      • goatools.rpt package
        • goatools.rpt.goea_nt_xfrm module
        • goatools.rpt.nts_xfrm module
        • goatools.rpt.prtfmt module
        • goatools.rpt.rpt_lev_depth module
        • goatools.rpt.write_hierarchy_base module
      • goatools.semsim package
        • goatools.semsim.termwise package
          • goatools.semsim.termwise.dag_a module
          • goatools.semsim.termwise.wang module
      • goatools.associations module
      • goatools.base module
      • goatools.evidence_codes module
      • goatools.go_enrichment module
      • goatools.go_search module
      • goatools.godag_obosm module
      • goatools.godag_plot module
      • goatools.godag_small module
      • goatools.mapslim module
      • goatools.multiple_testing module
      • goatools.nt_utils module
      • goatools.obo_parser module
      • goatools.obo_tasks module
      • goatools.pvalcalc module
      • goatools.randseed module
      • goatools.ratio module
      • goatools.semantic module
      • goatools.statsdescribe module
      • goatools.utils module
      • goatools.version module
      • goatools.wr_tbl module
      • goatools.wr_tbl_class module
Back to top
View this page

Print all or part of the GO hierarchy¶

  • Write the entire GO hierarchy for all genes from one species (human)

Write the entire GO hierarchy for all genes from one species (human)¶

$ goatools wr_hier BP MF CC --gene2go=gene2go --taxid=9606 --dash_len=17 --concise -o human_BP_MF_CC.txt

Arguments¶

  • BP MF CC => Aliases for top GO IDs for biological_process(GO:0008150), molecular_function(GO:0003674) & cellular_process(GO:0005575)

  • –gene2go=gene2go –taxid=9606 => Tells goatools wr_hier to read the associations in file, “gene2go” for human(9606)

  • –dash_len=17 => Adds spacing so the GO information printed next to each GO ID does not shift around. The BP branch is 17 GO IDs deep, so 17 is the right number for this print.

  • –concise => Because GO IDs can have multiple parents, the same sub-path can be printed multiple times, taking up gobs of space in a report and making the hierarchy report more difficult to read. To print a sub-path just once when it occurs more than one time, use this arg. If you use this arg, your report will be 37k lines. If you do not use this arg, your report will be 351,557 lines due to duplication

Further Details¶

GO IDs that are in the association will be marked with a “>” at the beginning of the line. The numbers on the GO line include the total count of all descendants (e.g., 265) determined from the GO DAG and the information content score determined from the associations (e.g., 7.01)

  --- GO:0009628   BP 265  7.01 D02 response to abiotic stimulus
  ---- GO:0071214  BP  68  8.30 D04 cellular response to abiotic stimulus
> ----- GO:0071257 BP   0 11.48 D05 cellular response to electrical stimulus

The two ancestor GO IDs preceding the marked(>) GO:0071257 are not in the human association, but are in the hierarchy leading down to GO:0071257 , which is in the association.

–concise causes a line which uses ‘=’ to indicate depth instead of ‘-‘:

> ======== GO:0071295  BP 13 10.97 L05 D07 cellular response to vitamin

The use of ‘=’ instead of ‘-’ to show a level of depth means that this GO AND its lower level terms were printed earlier and will not be duplicated to save space. In the case of GO:0071295, the first detailed print looks like this:

> -------- GO:0071295  BP 13 10.97 L05 D07 cellular response to vitamin
> --------- GO:0071307 BP  0 13.27 L06 D08 cellular response to vitamin K
> --------- GO:0071231 BP  0 13.27 L05 D08 cellular response to folic acid
> --------- GO:0071301 BP  0 13.96 L05 D08 cellular response to vitamin B1
> --------- GO:0071298 BP  0 13.96 L05 D08 cellular response to L-ascorbic acid
> --------- GO:0071305 BP  0 11.56 L05 D08 cellular response to vitamin D
> --------- GO:0071306 BP  0 13.27 L05 D08 cellular response to vitamin E

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

Next
NCBI GeneID and Symbol
Previous
Plot the GO hierarchy with goatools go_plot
Copyright © 2010-present, Haibao Tang et al.
Made with Sphinx and @pradyunsg's Furo
On this page
  • Print all or part of the GO hierarchy
    • Write the entire GO hierarchy for all genes from one species (human)
      • Arguments
      • Further Details