id
Usage - print $term->id() or $term->id($id)
Returns - the term ID (string)
Args - the term ID (string)
Function - gets/sets the ID of this term
namespace
Usage - print $term->namespace()
Returns - the namespace of this term (character); otherwise, 'NN'
Args - none
Function - gets the namespace of this term
subnamespace
Usage - print $term->subnamespace()
Returns - the subnamespace of this term (character); otherwise, 'X'
Args - none
Function - gets the subnamespace of this term
code
Usage - print $term->code()
Returns - the code of this term (character); otherwise, '0000000'
Args - none
Function - gets the code of this term
name
Usage - print $term->name() or $term->name($name)
Returns - the name (string) of this term
Args - the name (string) of this term
Function - gets/sets the name of this term
is_anonymous
Usage - print $term->is_anonymous() or $term->is_anonymous("1")
Returns - either 1 (true) or 0 (false)
Args - either 1 (true) or 0 (false)
Function - tells whether this term is anonymous or not.
alt_id
Usage - $term->alt_id() or $term->alt_id($id1, $id2, $id3, ...)
Returns - an array with the alternate id(s) of this term
Args - the alternate id(s) of this term
Function - gets/sets the alternate id(s) of this term
def
Usage - $term->def() or $term->def($def)
Returns - the definition (CCO::Core::Def) of this term
Args - the definition (CCO::Core::Def) of this term
Function - gets/sets the definition of the term
def_as_string
Usage - $term->def_as_string() or $term->def_as_string("During meiosis, the synthesis of DNA proceeding from the broken 3' single-strand DNA end that uses the homologous intact duplex as the template.", "[GOC:elh, PMID:9334324]")
Returns - the definition (string) of this term
Args - the definition (string) of this term plus the dbxref list (string) describing the source of this definition
Function - gets/sets the definition of this term
comment
Usage - print $term->comment() or $term->comment("This is a comment")
Returns - the comment (string) of this term
Args - the comment (string) of this term
Function - gets/sets the comment of this term
subset
Usage - $term->subset() or $term->subset($ss1, $ss2, $ss3, ...)
Returns - an array with the subset to which this term belongs
Args - the subset(s) to which this term belongs
Function - gets/sets the subset(s) to which this term belongs
synonym_set
Usage - $term->synonym_set() or $term->synonym_set($synonym1, $synonym2, $synonym3, ...)
Returns - an array with the synonym(s) of this term
Args - the synonym(s) of this term
Function - gets/sets the synonym(s) of this term
synonym_as_string
Usage - print $term->synonym_as_string() or $term->synonym_as_string("this is a synonym text", "[CCO:ea]", "EXACT")
Returns - an array with the synonym(s) of this term
Args - the synonym text (string), the dbxrefs (string) and synonym type (string) of this term
Function - gets/sets the synonym(s) of this term
xref_set
Usage - $term->xref_set() or $term->xref_set($dbxref_set)
Returns - a Dbxref set with the analogous xref(s) of this term in another vocabulary
Args - analogous xref(s) of this term in another vocabulary
Function - gets/sets the analogous xref(s) of this term in another vocabulary
xref_set_as_string
Usage - $term->xref_set_as_string() or $term->xref_set_as_string("[Reactome:20610, EC:2.3.2.12]")
Returns - the dbxref set with the analogous xref(s) of this term; [] if the set is empty
Args - the dbxref set with the analogous xref(s) of this term
Function - gets/sets the dbxref set with the analogous xref(s) of this term
disjoint_from
Usage - $term->disjoint_from() or $term->disjoint_from($disjoint_term_id1, $disjoint_term_id2, $disjoint_term_id3, ...)
Returns - the disjoint term id(s) (string(s)) from this one
Args - the term id(s) (string) that is (are) disjoint from this one
Function - gets/sets the disjoint term(s) from this one
is_obsolete
Usage - print $term->is_obsolete()
Returns - either 1 (true) or 0 (false)
Args - either 1 (true) or 0 (false)
Function - tells whether the term is obsolete or not. 'false' by default.
replaced_by
Usage - print $term->replaced_by($replacing_id)
Returns - id of the replacing term
Args - id of the replacing term
Function - gets/sets the replacing term for this term
consider
Usage - print $term->consider()
Returns - appropiate substitute for an obsolete term
Args - appropiate substitute for an obsolete term
Function - gets/sets the appropiate substitute for this obsolete term
builtin
Usage - $term->builtin() or $term->builtin(1) or $term->builtin(0)
Returns - tells if this term is builtin to the OBO format; false by default
Args - 1 (true) or 0 (false)
Function - gets/sets the value indicating whether this term is builtin to the OBO format
equals
Usage - print $term->equals($another_term)
Returns - either 1 (true) or 0 (false)
Args - the term (CCO::Core::Term) to compare with
Function - tells whether this term is equal to the parameter
NAME CCO::Core::Term - a universal in an ontology =head1 SYNOPSIS
use CCO::Core::Term; use CCO::Core::Def; use CCO::Util::DbxrefSet; use CCO::Core::Dbxref; use CCO::Core::Synonym; use strict;
# three new terms my $n1 = CCO::Core::Term->new(); my $n2 = CCO::Core::Term->new(); my $n3 = CCO::Core::Term->new();
# id's $n1->id("CCO:P0000001"); $n2->id("CCO:P0000002"); $n3->id("CCO:P0000003");
# alt_id $n1->alt_id("CCO:P0000001_alt_id"); $n2->alt_id("CCO:P0000002_alt_id1", "CCO:P0000002_alt_id2", "CCO:P0000002_alt_id3", "CCO:P0000002_alt_id4");
# name $n1->name("One"); $n2->name("Two"); $n3->name("Three");
$n1->is_obsolete(1); $n1->is_obsolete(0); $n1->is_anonymous(1); $n1->is_anonymous(0);
# synonyms my $syn1 = CCO::Core::Synonym->new(); $syn1->type('EXACT'); my $def1 = CCO::Core::Def->new(); $def1->text("Hola mundo1"); my $sref1 = CCO::Core::Dbxref->new(); $sref1->name("CCO:vm"); my $srefs_set1 = CCO::Util::DbxrefSet->new(); $srefs_set1->add($sref1); $def1->dbxref_set($srefs_set1); $syn1->def($def1); $n1->synonym($syn1);
my $syn2 = CCO::Core::Synonym->new(); $syn2->type('BROAD'); my $def2 = CCO::Core::Def->new(); $def2->text("Hola mundo2"); my $sref2 = CCO::Core::Dbxref->new(); $sref2->name("CCO:ls"); $srefs_set1->add_all($sref1); my $srefs_set2 = CCO::Util::DbxrefSet->new(); $srefs_set2->add_all($sref1, $sref2); $def2->dbxref_set($srefs_set2); $syn2->def($def2); $n2->synonym($syn2);
my $syn3 = CCO::Core::Synonym->new(); $syn3->type('BROAD'); my $def3 = CCO::Core::Def->new(); $def3->text("Hola mundo2"); my $sref3 = CCO::Core::Dbxref->new(); $sref3->name("CCO:ls"); my $srefs_set3 = CCO::Util::DbxrefSet->new(); $srefs_set3->add_all($sref1, $sref2); $def3->dbxref_set($srefs_set3); $syn3->def($def3); $n3->synonym($syn3);
# synonym as string $n2->synonym_as_string("Hello world2", "[CCO:vm2, CCO:ls2]", "EXACT");
# xref $n1->xref("Uno"); $n1->xref("Eins"); $n1->xref("Een"); $n1->xref("Un"); $n1->xref("Uj"); my $xref_length = $n1->xref()->size();
my $def = CCO::Core::Def->new(); $def->text("Hola mundo"); my $ref1 = CCO::Core::Dbxref->new(); my $ref2 = CCO::Core::Dbxref->new(); my $ref3 = CCO::Core::Dbxref->new();
$ref1->name("CCO:vm"); $ref2->name("CCO:ls"); $ref3->name("CCO:ea");
my $refs_set = CCO::Util::DbxrefSet->new(); $refs_set->add_all($ref1,$ref2,$ref3); $def->dbxref_set($refs_set); $n1->def($def); $n2->def($def);
# def as string $n2->def_as_string("This is a dummy definition", "[CCO:vm, CCO:ls, CCO:ea \"Erick Antezana\"] {opt=first}"); my @refs_n2 = $n2->def()->dbxref_set()->get_set(); my %r_n2; foreach my $ref_n2 (@refs_n2) { $r_n2{$ref_n2->name()} = $ref_n2->name(); }
DESCRIPTION A Term in the ontology.
AUTHOR
Erick Antezana, <erant@psb.ugent.be>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by erant
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.