Main Content

getrelatives

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

Description

RelativeIDs = getrelatives(GeneontObj,ID) searches GeneontObj, a geneont object, for GO terms that are relatives of the GO term(s) specified by ID, which is a GO term identifier or vector of identifiers. The result RelativeIDs is a vector of GO term identifiers including ID.

example

[RelativeIDs,Counts] = getrelatives(GeneontObj,ID) also returns the number of times each relative is found.

Tip

The Counts return value is useful when you tally counts in gene enrichment studies.

___ = getrelatives(GeneontObj,ID,Name,Value), for any output arguments, specifies additional options using one or more name-value arguments. For example, you can restrict the search to have up to two levels up in the gene ontology by specifying RelativeIDs = getrelatives(GeneontObj,ID,Height=2).

Examples

collapse all

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

GO = geneont('Live',true)
Gene Ontology object with 47266 Terms.

Retrieve the immediate relatives for the mitochondrial membrane GO term with a GO identifier of 31966.

RelativeIDs = getrelatives(GO,31966,'levels',1)
RelativeIDs = 8×1

        5740
        5741
        5743
       31090
       31966
       44289
       90692
       98573

Create a subordinate Gene Ontology.

subontology = GO(RelativeIDs)
Gene Ontology object with 8 Terms.

Create a report of the subordinate Gene Ontology terms, that includes the GO identifier and name.

rpt = get(subontology.terms,{'id','name'})
rpt=8×2 cell array
    {[ 5740]}    {'mitochondrial envelope'                         }
    {[ 5741]}    {'mitochondrial outer membrane'                   }
    {[ 5743]}    {'mitochondrial inner membrane'                   }
    {[31090]}    {'organelle membrane'                             }
    {[31966]}    {'mitochondrial membrane'                         }
    {[44289]}    {'mitochondrial inner-outer membrane contact site'}
    {[90692]}    {'mitochondrial membrane scission site'           }
    {[98573]}    {'intrinsic component of mitochondrial membrane'  }

Retrieve all relatives for the mitochondrial outer membrane GO term with an identifier of 5741.

RelativeIDs = getrelatives(GO,5741)
RelativeIDs = 7×1

        5741
       31306
       31315
       31966
       31968
       32473
       98799

Create a subordinate Gene Ontology.

subontology = GO(RelativeIDs)
Gene Ontology object with 7 Terms.

Create a report of the subordinate Gene Ontology terms.

rpt = get(subontology.terms,{'id','name'})
rpt=7×2 cell array
    {[ 5741]}    {'mitochondrial outer membrane'                       }
    {[31306]}    {'intrinsic component of mitochondrial outer membrane'}
    {[31315]}    {'extrinsic component of mitochondrial outer membrane'}
    {[31966]}    {'mitochondrial membrane'                             }
    {[31968]}    {'organelle outer membrane'                           }
    {[32473]}    {'cytoplasmic side of mitochondrial outer membrane'   }
    {[98799]}    {'outer mitochondrial membrane protein complex'       }

To view the relationships among the subordinate ontology, create a plot.

cm = getmatrix(subontology);
BG = digraph(cm,get(subontology.terms,"name"));
plot(BG,Layout="force")

Figure contains an axes object. The axes object contains an object of type graphplot.

Input Arguments

collapse all

Gene ontology object, specified as the output of the geneont command.

Example: geneont('Live',true)

Gene ontology ID numbers, specified as a nonnegative integer vector.

Example: 5

Data Types: single | double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: RelativeIDs = getrelatives(GeneontObj,ID,Levels=1)

Number of search levels up in gene ontology, specified as a positive integer.

Example: 4

Data Types: single | double

Number of search levels down in gene ontology, specified as a positive integer.

Example: 4

Data Types: single | double

Number of levels to search up and down in the gene ontology, specified as a positive integer. If you specify Levels, the value overrides any values in Height and Depth.

Example: 2

Data Types: single | double

Relations to match, specified as one of the following:

  • 'is_a'

  • 'part_of'

  • 'both'

Example: 'is_a'

Data Types: char | string

Indication to exclude ID from RelativeIDs, specified as false or true. This argument can fail to apply when getrelatives reaches the term while searching the ontology.

Example: true

Data Types: logical

Output Arguments

collapse all

ID numbers of relatives of GeneontObj, returned as a nonnegative integer vector. By default, RelativeIDs includes ID, unless you set the Exclude argument to true.

Number of times each relative is found, returned as a column vector of integers. Counts has the same number of elements as terms in GeneontObj.

Version History

Introduced before R2006a