getancestors

Class: geneont

Find terms that are ancestors of specified Gene Ontology (GO) term

Syntax

AncestorIDs = getancestors(GeneontObj, ID)
[AncestorIDs, Counts] = getancestors(GeneontObj, ID)

... = getancestors(..., 'Height', HeightValue, ...)
... = getancestors(..., 'Relationtype', RelationtypeValue, ...)
... = getancestors(..., 'Exclude', ExcludeValue, ...)

Description

AncestorIDs = getancestors(GeneontObj, ID) searches GeneontObj, a geneont object, for GO terms that are ancestors of the GO term(s) specified by ID, which is a GO term identifier or vector of identifiers. It returns AncestorIDs, a vector of GO term identifiers including ID. ID is a nonnegative integer or a vector containing nonnegative integers.

[AncestorIDs, Counts] = getancestors(GeneontObj, ID) also returns the number of times each ancestor is found. Counts is a column vector with the same number of elements as terms in GeneontObj.

... = getancestors(..., 'PropertyName', PropertyValue, ...) calls getancestors with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:


... = getancestors(..., 'Height', HeightValue, ...)
searches up through a specified number of levels, HeightValue, in the gene ontology. HeightValue is a positive integer. Default is Inf.

... = getancestors(..., 'Relationtype', RelationtypeValue, ...) searches for specified relationship types, RelationtypeValue, in the gene ontology. RelationtypeValue is a string. Choices are 'is_a', 'part_of', or 'both' (default).

... = getancestors(..., 'Exclude', ExcludeValue, ...) controls excluding ID, the original queried term(s), from the output AncestorIDs, unless the term was reached while searching the gene ontology. Choices are true or false (default).

Input Arguments

GeneontObjA geneont object, such as created by the geneont constructor function.
IDGO term identifier or vector of identifiers.
HeightValuePositive integer specifying the number of levels to search upward in the gene ontology.
RelationtypeValue

String specifying the relationship types to search for in the gene ontology. Choices are:

  • 'is_a'

  • 'part_of'

  • 'both' (default)

ExcludeValueControls excluding ID, the original queried term(s), from the output AncestorIDs, unless the term was reached while searching the gene ontology. Choices are true or false (default).

Output Arguments

AncestorIDsVector of GO term identifiers including ID.
CountsColumn vector with the same number of elements as terms in GeneontObj, indicating the number of times each ancestor is found.

Examples

  1. Download the current version of the Gene Ontology database from the Web into a geneont object in the MATLAB® software.

    GO = geneont('LIVE', true)

    The MATLAB software creates a geneont object and displays the number of terms in the database.

    Gene Ontology object with 24316 Terms.
  2. Retrieve the ancestors of the Gene Ontology term with an identifier of 46680.

    ancestors = getancestors(GO,46680)
    
    ancestors =
            8150
            9636
           17085
           42221
           46680
           50896
  3. Create a subordinate Gene Ontology.

    subontology = GO(ancestors)
    
    Gene Ontology object with 6 Terms.
    
  4. Create and display a report of the subordinate Gene Ontology terms, that includes the GO identifier and name.

    rpt = get(subontology.terms,{'id','name'})
    
        [ 8150]    'biological_process'
        [ 9636]    'response to toxin' 
        [17085]             [1x23 char]
        [42221]             [1x29 char]
        [46680]    'response to DDT'   
        [50896]             [1x20 char]
    
  5. View relationships of the subordinate Gene Ontology by using the getmatrix method to create a connection matrix to pass to the biograph function.

    cm = getmatrix(subontology);
    BG = biograph(cm, get(subontology.terms, 'name'));
    view(BG)

Was this topic helpful?