Main Content

geneont

Class: geneont

Create geneont object and term objects

Syntax

GeneontObj = geneont
GeneontObj = geneont('File', FileValue)
GeneontObj = geneont('Live', LiveValue)
GeneontObj = geneont('Live', LiveValue, 'ToFile', ToFileValue)

Description

GeneontObj = geneont creates GeneontObj, a geneont object, from the gene_ontology.obo file in the MATLAB® current directory. It also creates multiple term objects, one for each term in the geneont object.

GeneontObj = geneont('File', FileValue) creates GeneontObj, a geneont object, from FileValue, a character vector specifying the file name of an Open Biomedical Ontology (OBO)-formatted file that is on the MATLAB search path.

GeneontObj = geneont('Live', LiveValue) controls the creation of GeneontObj, a geneont object, from the current version of the Gene Ontology database.

Choices are true or false (default).

Note

The full Gene Ontology database may take several minutes to download when you run this function using the 'Live' property.

GeneontObj = geneont('Live', LiveValue, 'ToFile', ToFileValue), when LiveValue is true, creates GeneontObj, a geneont object, from the most recent version of the Gene Ontology database and saves the contents of this file to ToFileValue, a character vector specifying a file name or a path and file name.

Input Arguments

FileValueCharacter vector specifying the file name of an OBO-formatted file that is on the MATLAB search path.
LiveValueControls the creation of the most up-to-date geneont object. Enter true to create GeneontObj, a geneont object, from the most recent version of the Gene Ontology database. Default is false.
ToFileValueCharacter vector specifying a file name or path and file name to which to save the contents of the current version of the Gene Ontology database.

Output Arguments

GeneontObjMATLAB object containing gene ontology information.

Examples

expand all

Download the current version of the Gene Ontology database from the Web into a geneont object.

GeneontObj = geneont('LIVE', true)

The number of term objects associated with the geneont object is displayed.

Gene Ontology object with 47386 Terms.

Display information about the geneont object.

get(GeneontObj)
default_namespace: 'gene_ontology'
                    format_version: '1.2'
                      data_version: 'releases/2019-04-17'
                           version: ''
                              date: ''
                          saved_by: ''
                 auto_generated_by: ''
                         subsetdef: {15×1 cell}
                            import: ''
                    synonymtypedef: 'systematic_synonym "Systematic synonym" EXACT'
                           idspace: ''
    default_relationship_id_prefix: ''
                        id_mapping: ''
                            remark: 'Includes Ontology(OntologyID(OntologyIRI(<http://purl.obolibrary.org/obo/go/never_in_taxon.owl>))) [Axioms: 18 Logical Axioms: 0]'
                           typeref: ''
                  unrecognized_tag: {'ontology'  'go'}
                             Terms: [47386×1 geneont.term]

Search for all GO terms in the geneont object that contain the character vector ribosome in the field name, and use the geneont.terms property to create a MATLAB structure array of term objects containing those terms.

comparison = regexpi(get(GeneontObj.terms,'name'),'ribosome');
indices = find(~cellfun('isempty',comparison));
terms_with_ribosmome = GeneontObj.terms(indices)
  33×1 struct array with fields:

    id
    name
    ontology
    definition
    comment
    synonym
    is_a
    part_of
    obsolete

Note

Although the terms property is a column vector with handles to term objects, in the MATLAB Command Window, it displays as a structure array, with one structure for each GO term in the geneont object.