NAME

OBO::Core::Ontology - An ontology holding terms and their relationships.

SYNOPSIS

use OBO::Core::Ontology;

use OBO::Core::Term;

use OBO::Core::Relationship;

use OBO::Core::RelationshipType;

use strict;

# three new terms

my $n1 = OBO::Core::Term->new();

my $n2 = OBO::Core::Term->new();

my $n3 = OBO::Core::Term->new();

# new ontology

my $onto = OBO::Core::Ontology->new;

$n1->id("CCO:P0000001");

$n2->id("CCO:P0000002");

$n3->id("CCO:P0000003");

$n1->name("One");

$n2->name("Two");

$n3->name("Three");

my $def1 = OBO::Core::Def->new();

$def1->text("Definition of One");

my $def2 = OBO::Core::Def->new();

$def2->text("Definition of Two");

my $def3 = OBO::Core::Def->new();

$def3->text("Definition of Three");

$n1->def($def1);

$n2->def($def2);

$n3->def($def3);

$onto->add_term($n1);

$onto->add_term($n2);

$onto->add_term($n3);

$onto->delete_term($n1);

$onto->add_term($n1);

# new term

my $n4 = OBO::Core::Term->new();

$n4->id("CCO:P0000004");

$n4->name("Four");

my $def4 = OBO::Core::Def->new();

$def4->text("Definition of Four");

$n4->def($def4);

$onto->delete_term($n4);

$onto->add_term($n4);

# add term as string

my $new_term = $onto->add_term_as_string("CCO:P0000005", "Five");

$new_term->def_as_string("This is a dummy definition", "[CCO:vm, CCO:ls, CCO:ea \"Erick Antezana\"]");

my $n5 = $new_term;

# five new relationships

my $r12 = OBO::Core::Relationship->new();

my $r23 = OBO::Core::Relationship->new();

my $r13 = OBO::Core::Relationship->new();

my $r14 = OBO::Core::Relationship->new();

my $r35 = OBO::Core::Relationship->new();

$r12->id("CCO:P0000001_is_a_CCO:P0000002");

$r23->id("CCO:P0000002_part_of_CCO:P0000003");

$r13->id("CCO:P0000001_participates_in_CCO:P0000003");

$r14->id("CCO:P0000001_participates_in_CCO:P0000004");

$r35->id("CCO:P0000003_part_of_CCO:P0000005");

$r12->type("is_a");

$r23->type("part_of");

$r13->type("participates_in");

$r14->type("participates_in");

$r35->type("part_of");

$r12->link($n1, $n2);

$r23->link($n2, $n3);

$r13->link($n1, $n3);

$r14->link($n1, $n4);

$r35->link($n3, $n5);

# get all terms

my $c = 0;

my %h;

foreach my $t (@{$onto->get_terms()}) {

$h{$t->id()} = $t;

$c++;

}

# get terms with argument

my @processes = sort {$a->id() cmp $b->id()} @{$onto->get_terms("CCO:P.*")};

my @odd_processes = sort {$a->id() cmp $b->id()} @{$onto->get_terms("CCO:P000000[35]")};

$onto->idspace_as_string("CCO", "http://www.cellcycle.org/ontology/CCO");

my @same_processes = @{$onto->get_terms_by_subnamespace("P")};

my @no_processes = @{$onto->get_terms_by_subnamespace("p")};

# add relationships

$onto->add_relationship($r12);

$onto->add_relationship($r23);

$onto->add_relationship($r13);

$onto->add_relationship($r14);

$onto->add_relationship($r35);

# add relationships and terms linked by this relationship

my $n11 = OBO::Core::Term->new();

my $n21 = OBO::Core::Term->new();

$n11->id("CCO:P0000011"); $n11->name("One one"); $n11->def_as_string("Definition One one", "");

$n21->id("CCO:P0000021"); $n21->name("Two one"); $n21->def_as_string("Definition Two one", "");

my $r11_21 = OBO::Core::Relationship->new();

$r11_21->id("CCO:R0001121"); $r11_21->type("r11-21");

$r11_21->link($n11, $n21);

$onto->add_relationship($r11_21); # adds to the ontology the terms linked by this relationship

# get all relationships

my %hr;

foreach my $r (@{$onto->get_relationships()}) {

$hr{$r->id()} = $r;

}

# get children

my @children = @{$onto->get_child_terms($n1)};

@children = @{$onto->get_child_terms($n3)};

my %ct;

foreach my $child (@children) {

$ct{$child->id()} = $child;

}

@children = @{$onto->get_child_terms($n2)};

# get parents

my @parents = @{$onto->get_parent_terms($n3)};

@parents = @{$onto->get_parent_terms($n1)};

@parents = @{$onto->get_parent_terms($n2)};

# get all descendents

my @descendents1 = @{$onto->get_descendent_terms($n1)};

my @descendents2 = @{$onto->get_descendent_terms($n2)};

my @descendents3 = @{$onto->get_descendent_terms($n3)};

my @descendents5 = @{$onto->get_descendent_terms($n5)};

# get all ancestors

my @ancestors1 = @{$onto->get_ancestor_terms($n1)};

my @ancestors2 = @{$onto->get_ancestor_terms($n2)};

my @ancestors3 = @{$onto->get_ancestor_terms($n3)};

# get descendents by term subnamespace

my @descendents4 = @{$onto->get_descendent_terms_by_subnamespace($n1, 'P')};

my @descendents5 = @{$onto->get_descendent_terms_by_subnamespace($n2, 'P')};

my @descendents6 = @{$onto->get_descendent_terms_by_subnamespace($n3, 'P')};

my @descendents6 = @{$onto->get_descendent_terms_by_subnamespace($n3, 'R')};

# get ancestors by term subnamespace

my @ancestors4 = @{$onto->get_ancestor_terms_by_subnamespace($n1, 'P')};

my @ancestors5 = @{$onto->get_ancestor_terms_by_subnamespace($n2, 'P')};

my @ancestors6 = @{$onto->get_ancestor_terms_by_subnamespace($n3, 'P')};

my @ancestors6 = @{$onto->get_ancestor_terms_by_subnamespace($n3, 'R')};

# three new relationships types

my $r1 = OBO::Core::RelationshipType->new();

my $r2 = OBO::Core::RelationshipType->new();

my $r3 = OBO::Core::RelationshipType->new();

$r1->id("CCO:R0000001");

$r2->id("CCO:R0000002");

$r3->id("CCO:R0000003");

$r1->name("is_a");

$r2->name("part_of");

$r3->name("participates_in");

# add relationship types

$onto->add_relationship_type($r1);

$onto->add_relationship_type($r2);

$onto->add_relationship_type($r3);

# get descendents or ancestors linked by a particular relationship type

my $rel_type1 = $onto->get_relationship_type_by_name("is_a");

my $rel_type2 = $onto->get_relationship_type_by_name("part_of");

my $rel_type3 = $onto->get_relationship_type_by_name("participates_in");

my @descendents7 = @{$onto->get_descendent_terms_by_relationship_type($n5, $rel_type1)};

@descendents7 = @{$onto->get_descendent_terms_by_relationship_type($n5, $rel_type2)};

@descendents7 = @{$onto->get_descendent_terms_by_relationship_type($n2, $rel_type1)};

@descendents7 = @{$onto->get_descendent_terms_by_relationship_type($n3, $rel_type3)};

my @ancestors7 = @{$onto->get_ancestor_terms_by_relationship_type($n1, $rel_type1)};

@ancestors7 = @{$onto->get_ancestor_terms_by_relationship_type($n1, $rel_type2)};

@ancestors7 = @{$onto->get_ancestor_terms_by_relationship_type($n1, $rel_type3)};

@ancestors7 = @{$onto->get_ancestor_terms_by_relationship_type($n2, $rel_type2)};

# add relationship type as string

my $relationship_type = $onto->add_relationship_type_as_string("CCO:R0000004", "has_participant");

# get relationship types

my @rt = @{$onto->get_relationship_types()};

my %rrt;

foreach my $relt (@rt) {

$rrt{$relt->name()} = $relt;

}

my @rtbt = @{$onto->get_relationship_types_by_term($n1)};

my %rtbth;

foreach my $relt (@rtbt) {

$rtbth{$relt} = $relt;

}

# get_head_by_relationship_type

my @heads_n1 = @{$onto->get_head_by_relationship_type($n1, $onto->get_relationship_type_by_name("participates_in"))};

my %hbrt;

foreach my $head (@heads_n1) {

$hbrt{$head->id()} = $head;

}

DESCRIPTION

This module supports the manipulatation of OBO-formatted ontologies, such as the Gene Ontology (http://www.geneontology.org/) or the Cell Cycle Ontology (http://www.cellcycleontology.org). Basically, it represents a directed acyclic graph (DAG) holding the terms (OBO::Core::Term) which in turn are linked by relationships (OBO::Core::Relationship). Those relationships have an associated relationship type (OBO::Core::RelationshipType).

AUTHOR

Erick Antezana, <erick.antezana -@- gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2006, 2007, 2008, 2009, 2010 by Erick Antezana

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

id

Usage    - print $ontology->id() or $ontology->id($id)
Returns  - the ontology ID (string)
Args     - the ontology ID (string)
Function - gets/sets the ontology ID

name

Usage    - print $ontology->name() or $ontology->name($name)
Returns  - the name (string) of the ontology
Args     - the name (string) of the ontology
Function - gets/sets the name of the ontology

imports

Usage    - $onto->imports() or $onto->imports($id1, $id2, $id3, ...)
Returns  - a set (OBO::Util::Set) with the imported id ontologies
Args     - the ontology id(s) (string) 
Function - gets/sets the id(s) of the ontologies that are imported by this one

date

Usage    - print $ontology->date()
Returns  - the current date (in dd:MM:yyyy HH:mm format) of the ontology
Args     - the current date (in dd:MM:yyyy HH:mm format) of the ontology
Function - gets/sets the date of the ontology

default_namespace

Usage    - print $ontology->default_namespace() or $ontology->default_namespace("cellcycle_ontology")
Returns  - the default namespace (string) of this ontology
Args     - the default namespace (string) of this ontology
Function - gets/sets the default namespace of this ontology

idspaces

Usage    - $ontology->idspaces() or $ontology->idspaces($IDspace)
Returns  - the id spaces, as a set (OBO::Util::IDspaceSet) of OBO::Core::IDspace's, of this ontology
Args     - the id spaces, as a set (OBO::Util::IDspaceSet) of OBO::Core::IDspace's, of this ontology
Function - gets/sets the idspaces of this ontology

data_version

Usage    - print $ontology->data_version()
Returns  - the data version (string) of this ontology
Args     - the data version (string) of this ontology
Function - gets/sets the data version of this ontology

saved_by

Usage    - print $ontology->saved_by()
Returns  - the username of the person (string) to last save this ontology
Args     - the username of the person (string) to last save this ontology
Function - gets/sets the username of the person to last save this ontology

remarks

Usage    - print $ontology->remarks()
Returns  - the remarks (OBO::Util::Set) of this ontology
Args     - the remarks (OBO::Util::Set) of this ontology
Function - gets/sets the remarks of this ontology

subset_def_set

Usage    - $onto->subset_def_set() or $onto->subset_def_set($ss1, $ss2, $ss3, ...)
Returns  - a map (OBO::Util::SubsetDefSet) with the subset definition(s) used in this ontology. A subset is a view over an ontology
Args     - a subset definition(s) (OBO::Core::SubsetDef) used in this ontology 
Function - gets/sets the subset definition(s) of this ontology
      

synonym_type_def_set

Usage    - $onto->synonym_type_def_set() or $onto->synonym_type_def_set($st1, $st2, $st3, ...)
Returns  - a set (OBO::Util::SynonymTypeDefSet) with the synonym type definitions used in this ontology. A synonym type is a description of a user-defined synonym type 
Args     - the synonym type definition(s) (OBO::Core::SynonymTypeDef) used in this ontology 
Function - gets/sets the synonym type definitions (s) of this ontology
      

add_term

Usage    - $ontology->add_term($term)
Returns  - the just added term (OBO::Core::Term)
Args     - the term (OBO::Core::Term) to be added. The ID of the term to be added must have already been defined.
Function - adds a term to this ontology

add_term_as_string

Usage    - $ontology->add_term_as_string($term_id, $term_name)
Returns  - the just added term (OBO::Core::Term)
Args     - the term id (string) and the term name (string) of term to be added
Function - adds a term to this ontology

add_relationship_type

Usage    - $ontology->add_relationship_type($relationship_type)
Returns  - the just added relationship type (OBO::Core::RelationshipType)
Args     - the relationship type to be added (OBO::Core::RelationshipType). The ID of the relationship type to be added must have already been defined.
Function - adds a relationship type to this ontology

add_relationship_type_as_string

Usage    - $ontology->add_relationship_type_as_string($relationship_type_id, $relationship_type_name)
Returns  - the just added relationship type (OBO::Core::RelationshipType)
Args     - the relationship type id (string) and the relationship type name (string) of the relationship type to be added
Function - adds a relationship type to this ontology

delete_term

Usage    - $ontology->delete_term($term)
Returns  - none
Args     - the term (OBO::Core::Term) to be deleted
Function - deletes a term from this ontology

has_term

Usage    - print $ontology->has_term($term)
Returns  - true or false
Args     - the term (OBO::Core::Term) to be tested
Function - checks if the given term belongs to this ontology

has_term_id

Usage    - print $ontology->has_term_id($term_id)
Returns  - true or false
Args     - the term id (string) to be tested
Function - checks if the given term id corresponds to a term held by this ontology

has_relationship_type

Usage    - print $ontology->has_relationship_type($relationship_type)
Returns  - true or false
Args     - the relationship type (OBO::Core::RelationshipType) to be tested
Function - checks if the given relationship type belongs to this ontology

has_relationship_type_id

Usage    - print $ontology->has_relationship_type_id($relationship_type_id)
Returns  - true or false
Args     - the relationship type id (string) to be tested
Function - checks if the given relationship type id corresponds to a relationship type held by this ontology

has_relationship_id

Usage    - print $ontology->has_relationship_id($rel_id)
Returns  - true or false
Args     - the relationship id (string) to be tested
Function - checks if the given relationship id corresponds to a relationship held by this ontology

equals

Usage    - print $ontology->equals($another_ontology)
Returns  - either 1 (true) or 0 (false)
Args     - the ontology (OBO::Core::Ontology) to compare with
Function - tells whether this ontology is equal to the parameter

get_terms

Usage    - $ontology->get_terms() or $ontology->get_terms("CCO:I.*")
Returns  - the terms held by this ontology as a reference to an array of OBO::Core::Term's
Args     - none or the regular expression for filtering the terms by id's
Function - returns the terms held by this ontology

get_terms_by_subnamespace

Usage    - $ontology->get_terms_by_subnamespace() or $ontology->get_terms_by_subnamespace("P") or or $ontology->get_terms_by_subnamespace("Pa")
Returns  - the terms held by this ontology corresponding to the requested subnamespace as a reference to an array of OBO::Core::Term's
Args     - none or the subnamespace: 'P', 'I', 'Pa', 'Ia' and so on.
Function - returns the terms held by this ontology corresponding to the requested subnamespace

get_terms_by_subset

Usage    - $ontology->get_terms_by_subset("GO_SLIM")
Returns  - the terms held by this ontology belonging to the given subset as a reference to an array of OBO::Core::Term's
Args     - a subset name
Function - returns the terms held by this ontology belonging to the requested subset

get_relationships

Usage    - $ontology->get_relationships()
Returns  - the relationships held by this ontology as a reference to an array of OBO::Core::Relationship's
Args     - none
Function - returns the relationships held by this ontology

get_relationship_types

Usage    - $ontology->get_relationship_types()
Returns  - a reference to an array with the relationship types (OBO::Core::RelationshipType) held by this ontology
Args     - none
Function - returns the relationship types held by this ontology

get_relationships_by_source_term

Usage    - $ontology->get_relationships_by_source_term($source_term)
Returns  - a reference to an array with the relationship (OBO::Core::Relationship) connecting this term to its children
Args     - the term (OBO::Core::Term) for which its relationships will be found out
Function - returns the relationships associated to the given source term

get_relationships_by_target_term

Usage    - $ontology->get_relationships_by_target_term($target_term)
Returns  - a reference to an array with the relationship (OBO::Core::Relationship) connecting this term to its parents
Args     - the term (OBO::Core::Term) for which its relationships will be found out
Function - returns the relationships associated to the given target term

get_term_by_id

Usage    - $ontology->get_term_by_id($id)
Returns  - the term (OBO::Core::Term) associated to the given ID
Args     - the term's ID (string)
Function - returns the term associated to the given ID

set_term_id

Usage    - $ontology->set_term_id($term, $new_id)
Returns  - the term (OBO::Core::Term) with its new ID
Args     - the term (OBO::Core::Term) and its new term's ID (string)
Function - sets a new term ID for the given term 

get_relationship_type_by_id

Usage    - $ontology->get_relationship_type_by_id($id)
Returns  - the relationship type (OBO::Core::RelationshipType) associated to the given id
Args     - the relationship type's id (string)
Function - returns the relationship type associated to the given id

get_term_by_name

Usage    - $ontology->get_term_by_name($name)
Returns  - the term (OBO::Core::Term) associated to the given name
Args     - the term's name (string)
Function - returns the term associated to the given name
Remark   - the argument (string) is case sensitive

get_term_by_name_or_synonym

Usage    - $ontology->get_term_by_name_or_synonym($name)
Returns  - the term (OBO::Core::Term) associated to the given name or *EXACT* synonym
Args     - the term's name or synonym (string)
Function - returns the term associated to the given name or *EXACT* synonym
Remark   - this function should be carefully used since among ontologies there may be homonyms at the level of the synonyms (e.g. genes)
Remark   - the argument (string) is case sensitive

get_terms_by_name

Usage    - $ontology->get_terms_by_name($name)
Returns  - the term set (OBO::Util::TermSet) with all the terms (OBO::Core::Term) having $name in their names 
Args     - the term's name (string)
Function - returns the terms having $name in their names 

get_relationship_type_by_name

Usage    - $ontology->get_relationship_type_by_name($name)
Returns  - the relationship type (OBO::Core::RelationshipType) associated to the given name
Args     - the relationship type's name (string)
Function - returns the relationship type associated to the given name

add_relationship

Usage    - $ontology->add_relationship($relationship)
Returns  - none
Args     - the relationship (OBO::Core::Relationship) to be added between two existing terms or two relationship types
Function - adds a relationship between either two terms or two relationship types. If the terms or relationship types bound by this relationship are not yet in the ontology, they will be added

get_relationship_by_id

Usage    - print $ontology->get_relationship_by_id()
Returns  - the relationship (OBO::Core::Relationship) associated to the given id
Args     - the relationship id (string)
Function - returns the relationship associated to the given relationship id

get_child_terms

Usage    - $ontology->get_child_terms($term)
Returns  - a reference to an array with the child terms (OBO::Core::Term) of the given term
Args     - the term (OBO::Core::Term) for which the children will be found
Function - returns the child terms of the given term

get_parent_terms

Usage    - $ontology->get_parent_terms($term)
Returns  - a reference to an array with the parent terms (OBO::Core::Term) of the given term
Args     - the term (OBO::Core::Term) for which the parents will be found
Function - returns the parent terms of the given term

get_head_by_relationship_type

Usage    - $ontology->get_head_by_relationship_type($term, $relationship_type) or $ontology->get_head_by_relationship_type($rel_type, $relationship_type)
Returns  - a reference to an array of terms (OBO::Core::Term) or relationship types (OBO::Core::RelationshipType) pointed out by the relationship of the given type; otherwise undef
Args     - the term (OBO::Core::Term) or relationship type (OBO::Core::RelationshipType) and the pointing relationship type (OBO::Core::RelationshipType)
Function - returns the terms or relationship types pointed out by the relationship of the given type

get_tail_by_relationship_type

Usage    - $ontology->get_tail_by_relationship_type($term, $relationship_type) or $ontology->get_tail_by_relationship_type($rel_type, $relationship_type)
Returns  - a reference to an array of terms (OBO::Core::Term) or relationship types (OBO::Core::RelationshipType) pointing out the given term by means of the given relationship type; otherwise undef
Args     - the term (OBO::Core::Term) or relationship type (OBO::Core::RelationshipType) and the relationship type (OBO::Core::RelationshipType)
Function - returns the terms or relationship types pointing out the given term by means of the given relationship type

get_root_terms

Usage    - $ontology->get_root_terms()
Returns  - the root term(s) held by this ontology (as a reference to an array of OBO::Core::Term's)
Args     - none
Function - returns the root term(s) held by this ontology

get_number_of_terms

Usage    - $ontology->get_number_of_terms()
Returns  - the number of terms held by this ontology
Args     - none
Function - returns the number of terms held by this ontology

get_number_of_relationships

Usage    - $ontology->get_number_of_relationships()
Returns  - the number of relationships held by this ontology
Args     - none
Function - returns the number of relationships held by this ontology

get_number_of_relationship_types

Usage    - $ontology->get_number_of_relationship_types()
Returns  - the number of relationship types held by this ontology
Args     - none
Function - returns the number of relationship types held by this ontology

export

Usage    - $ontology->export($file_handle, $export_format)
Returns  - exports this ontology
Args     - the file handle (STDOUT, STDERR, ...) and the format: obo (by default), xml, owl, dot, gml, xgmml, sbml. Default file handle: STDOUT.
Function - exports this ontology

subontology_by_terms

Usage    - $ontology->subontology_by_terms($term_set)
Returns  - a subontology with the given terms from this ontology 
Args     - the terms (OBO::Util::TermSet) that will be included in the subontology
Function - creates a subontology based on the given terms from this ontology

get_subontology_from

Usage    - $ontology->get_subontology_from($new_root_term)
Returns  - a subontology from the given term of this ontology 
Args     - the term (OBO::Core::Term) that is the root of the subontology
Function - creates a subontology having as root the given term

obo_id2owl_id

Usage    - $ontology->obo_id2owl_id($term)
Returns  - the ID for OWL representation.
Args     - the OBO-type ID.
Function - Transform an OBO-type ID into an OWL-type one. E.g. CCO:I1234567 -> CCO_I1234567

owl_id2obo_id

Usage    - $ontology->owl_id2obo_id($term)
Returns  - the ID for OBO representation.
Args     - the OWL-type ID.
Function - Transform an OWL-type ID into an OBO-type one. E.g. CCO_I1234567 -> CCO:I1234567

char_hex_http

Usage    - $ontology->char_hex_http($seq)
Returns  - the sequence with the numeric HTML representation for the given special character
Args     - the sequence of characters
Function - Transforms a character into its equivalent HTML number, e.g. : -> &#58;

get_terms_idspace

Usage    - $ontology->get_terms_idspace()
Returns  - the idspace (e.g. GO) of the terms held by this ontology
Args     - none
Function - look for the idspace of the terms held by this ontology
Remark   - it is assumed that all terms share the same idspace (e.g. GO)

get_descendent_terms

Usage    - $ontology->get_descendent_terms($term) or $ontology->get_descendent_terms($term_id)
Returns  - a set with the descendent terms (OBO::Core::Term) of the given term
Args     - the term, as an object (OBO::Core::Term) or string (e.g. GO:0003677), for which all the descendents will be found
Function - returns recursively all the child terms of the given term

get_ancestor_terms

Usage    - $ontology->get_ancestor_terms($term)
Returns  - a set with the ancestor terms (OBO::Core::Term) of the given term
Args     - the term (OBO::Core::Term) for which all the ancestors will be found
Function - returns recursively all the parent terms of the given term

get_descendent_terms_by_subnamespace

Usage    - $ontology->get_descendent_terms_by_subnamespace($term, subnamespace)
Returns  - a set with the descendent terms (OBO::Core::Term) of the given subnamespace 
Args     - the term (OBO::Core::Term), the subnamespace (string, e.g. 'P', 'R', 'Ia' etc)
Function - returns recursively the given term's children of the given subnamespace

get_ancestor_terms_by_subnamespace

Usage    - $ontology->get_ancestor_terms_by_subnamespace($term, subnamespace)
Returns  - a set with the ancestor terms (OBO::Core::Term) of the given subnamespace 
Args     - the term (OBO::Core::Term), the subnamespace (string, e.g. 'P', 'R', 'Ia' etc)
Function - returns recursively the given term's parents of the given subnamespace

get_descendent_terms_by_relationship_type

Usage    - $ontology->get_descendent_terms_by_relationship_type($term, $rel_type)
Returns  - a set with the descendent terms (OBO::Core::Term) of the given term linked by the given relationship type
Args     - OBO::Core::Term object, OBO::Core::RelationshipType object
Function - returns recursively all the child terms of the given term linked by the given relationship type

get_ancestor_terms_by_relationship_type

Usage    - $ontology->get_ancestor_terms_by_relationship_type($term, $rel_type)
Returns  - a set with the ancestor terms (OBO::Core::Term) of the given term linked by the given relationship type
Args     - OBO::Core::Term object, OBO::Core::RelationshipType object
Function - returns recursively the parent terms of the given term linked by the given relationship type

create_rel

Usage    - $ontology->create_rel->($tail, $type, $head)
Returns  - the OBO::Core::Ontology object
Args     - an OBO::Core::(Term|Relationship) object, a relationship type string, and an OBO::Core::(Term|Relationship) object, 
Function - creates and adds a new relationship to the ontology

get_term_by_xref

Usage    - $ontology->get_term_by_xref($db, $acc)
Returns  - the term (OBO::Core::Term) associated with the given external database ID. 'undef' is returned if there is no term for the given arguments.	
Args     - the name of the external database and the ID (strings)
Function - returns the term associated with the given external database ID

get_paths_term1_term2

Usage    - $ontology->get_paths_term1_term2($term1, $term2)
Returns  - an array of references to the paths between term1 and term2
Args     - the IDs of the terms for which a path (or paths) will be found
Function - returns the path(s) linking term1 and terms2, where term1 is more specific than term2

get_paths_term_terms

Usage    - $ontology->get_paths_term_terms($term, $set_of_terms)
Returns  - an array of references to the paths between a given term ID and a given set of terms IDs 
Args     - the IDs of the terms for which a path (or paths) will be found
Function - returns the path(s) linking term and the given set of terms

get_paths_term_terms_same_rel

Usage    - $ontology->get_paths_term_terms_same_rel($term_id, $set_of_terms, $type_of_relationship)
Returns  - an array of references to the paths between a given term ID and a given set of terms IDs 
Args     - the IDs of the terms for which a path (or paths) will be found and the ID of the relationship type 
Function - returns the path(s) linking term and the given set of terms along the same relationship (e.g. is_a)