NAME
OBO::CCO::CCO_ID_Term_Map - A map between CCO IDs and term names.
SYNOPSIS
use OBO::CCO::CCO_ID_Term_Map;
$cco_id_set = CCO_ID_Term_Map -> new;
$cco_id_set->file("ontology.ids");
$file = $cco_id_set -> file;
$size = $cco_id_set -> size;
$cco_id_set->file("CCO");
if ($cco_id_set->add("CCO:C1234567")) { ... }
$new_id = $cco_id_set->get_new_id("CCO", "C");
DESCRIPTION
The OBO::CCO::CCO_ID_Term_Map class implements a map for storing CCO IDs and their corresponding names.
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.
put
Usage - $map->put("CCO:P0000056", "cell cycle")
Returns - none
Args - CCO id (string), term name (string)
Function - either puts a new entry in the map or modifies an existing entry by changing the term name
Remark - prior to adding new entries to the map, use method get_new_cco_id()
get_new_cco_id
Usage - $map->get_new_cco_id("CCO", "P", "cell cycle")
Returns - a new CCO ID (string)
Args - idspace (string), subnamespace (string), term (string)
Function - get a new CCO ID and insert it (put) into this map
get_cco_id_by_term
Usage - $map->get_cco_id_by_term($term_name)
Returns - the CCO id associated to the given term name
Args - a term name (string)
Function - the term associated to the given term
get_term_by_cco_id
Usage - $map->get_term_by_cco_id($cco_id)
Returns - the term name (string) associated to the given CCO id
Args - a CCO id (string)
Function - the term name associated to the given CCO id
keys_set
Usage - $map->keys_set()
Returns - the keys (or CCO ids)
Args - none
Function - the keys (or CCO ids)
values_set
Usage - $map->values_set()
Returns - the values (or terms names)
Args - none
Function - the keys (or terms names)
contains_key
Usage - $map->contains_key($k)
Returns - 1 (true) or 0 (false)
Args - a key or CCO id
Function - 1 (true) or 0 (false)
contains_value
Usage - $map->contains_value($v)
Returns - 1 (true) or 0 (false)
Args - a value or term
Function - 1 (true) or 0 (false)
size
Usage - $map->size()
Returns - the size of this map
Args - none
Function - the size of this map
file
Usage - $map->file()
Returns - the size of this map
Args - none
Function - the size of this map
clear
Usage - $map->clear()
Returns - clears this map
Args - none
Function - clears this map
is_empty
Usage - $map->is_empty()
Returns - 1 (true) or 0 (false)
Args - none
Function - tells if this map is empty
write_map
Usage - $map->write_map()
Returns - none
Args - none
Function - prints the contents of the map to the file associated to this object
remove_by_key
Usage - $map->remove_by_key('CCO:B0000001')
Returns - the value corresponding to the given key that will be eventually removed
Args - the key (CCO ID as string) of the entry to be removed (string)
Function - removes one entry from the map