Usage - $set->add($element) Returns - the added element Args - the element to be added. It must have an ID Function - adds an element to this set
Usage - $set->add_all($ele1, $ele2, $ele3, ...) Returns - the last added id (e.g. an object of type OBO::XO::OBO_ID) Args - the elements to be added Function - adds the given elements to this set
Usage - $set->remove($element_to_be_removed) Returns - 1 (true) if this set contained the given element Args - element (it must have an ID) to be removed from this set, if present Function - removes an element from this set if it is present
Usage - $set->contains($id) Returns - 1 (true) or 0 (false) Args - the element (it must have an ID) to look up Function - tells if the given ID is in this set
Usage - $set->equals($other_set) Returns - 1 (true) or 0 (false) Args - the other set to check with Function - tells if this set is equal to the given one
OBO::Util::ObjectSet - An implementation of a set of OBO ontology objects.
use OBO::Util::ObjectSet;
$set = OBO::Util::ObjectSet->new();
$id = OBO::XO::OBO_ID->new();
$size = $set->size();
if ($ok) {
$set->add($term);
} else {
$set->add($term); $set->add($relationship);
}
The OBO::Util::ObjectSet class implements a set of ontology objects such as Terms, Relationships, etc.
Erick Antezana, <erick.antezana -@- gmail.com>
Copyright (c) 2006-2015 by Erick Antezana. All rights reserved.
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.
To install OBO::Util::Set, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OBO::Util::Set
CPAN shell
perl -MCPAN -e shell install OBO::Util::Set
For more information on module installation, please visit the detailed CPAN module installation guide.