NAME
OBO::XO::OBO_ID_Term_Map - A map between OBO IDs and term names.
SYNOPSIS
use OBO::XO::OBO_ID_Term_Map;
$obo_id_set = OBO_ID_Term_Map->new();
$obo_id_set->file("gene_ontology.ids");
$file = $obo_id_set->file();
$size = $obo_id_set->size();
$obo_id_set->file("OBO");
if ($obo_id_set->add("OBO:0007049")) { ... }
$new_id = $obo_id_set->get_new_id("GO");
DESCRIPTION
The OBO::XO::OBO_ID_Term_Map class implements a map for storing OBO 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("GO:0007049", "cell cycle")
Returns - the size of map
Args - OBO 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_id()
get_new_id
Usage - $map->get_new_id("GO", "cell cycle")
Returns - a new OBO ID (string)
Args - idspace (string), term (string)
Function - get a new OBO ID and insert it (put) into this map
get_term_by_id
Usage - $map->get_term_by_id($obo_id)
Returns - the term name (string) associated to the given OBO id
Args - an OBO id (string)
Function - the term name associated to the given OBO id
get_id_by_term
Usage - $map->get_id_by_term($term_name)
Returns - the OBO id associated to the given term name
Args - a term name (string)
Function - the term associated to the given term
keys_set
Usage - $map->keys_set()
Returns - the keys (or OBO ids)
Args - none
Function - the keys (or OBO 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 OBO 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)
equals
Usage - $map->equals($other_map)
Returns - 1 (true) or 0 (false)
Args - another map
Function - compares two maps and tells whether they are identical or not
size
Usage - $map->size()
Returns - the size of this map
Args - none
Function - the size of this map
file
Usage - $map->file()
Returns - the file of this map
Args - none
Function - the file 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('OBO:B0000001')
Returns - the value corresponding to the given key that will be eventually removed
Args - the key (OBO ID as string) of the entry to be removed (string)
Function - removes one entry from the map