The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

put

Usage    - $map->put("CCO:P0000056", "cell cycle")
Returns  - the old value of the key if this one was defined
Args     - CCO id (string), term name (string)
Function - puts an entry in the map
Remark   - for adding entries into 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     - namespace (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  - 1 (true) or 0 (false)
Args     - 
Function - prints the contents of the map to a file 

NAME

CCO::Util::CCO_ID_Term_Map - a map between CCO IDs and term names.

SYNOPSIS

use CCO::Util::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 CCO::Util::CCO_ID_Term_Map class implements a map for storing CCO IDs and their corresponding names.

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.