[Bioperl-l] ontology help

Marc Logghe Marc.Logghe at devgen.com
Tue Jun 22 03:50:01 EDT 2004


Hi all,
I am struggling with the Bio::Ontology::* packages and ontologies in general ...
Suppose I have 3 ontologies: ONTa, ONTb and ONTa2ONTbMap. The latter is actually only containing relations between terms of  the other 2 ontologies (subject terms belong to ONTa, object terms to ONTb) and predicate terms. The 3 Bio::Ontology::Ontology objects are fetched from biosql, by loading their terms and relations. 
Problem is how do I perform a query using the Bio::Ontology::* API in order to find all the relations in ONTa2ONTbMap to a term from ontology ONTa ?
I tried it like this:
my ($key) = $ONTa->find_terms(-name => 'primer_bind');
my ($rel) = $ONTa2ONTbMap->find_terms(-name => 'optional_qualifier_for');
my @rels = $ONTa2ONTbMap->get_relationships($key);

but then I get an exception:
------------- EXCEPTION  -------------
MSG: Found [scalar] where [Bio::Ontology::TermI] expected
STACK Bio::Ontology::Relationship::_check_class /home/marcl/src/bioperl/bioperl-live/Bio/Ontology/Relationship.pm:378
STACK Bio::Ontology::Relationship::subject_term /home/marcl/src/bioperl/bioperl-live/Bio/Ontology/Relationship.pm:242
STACK Bio::Ontology::Relationship::new /home/marcl/src/bioperl/bioperl-live/Bio/Ontology/Relationship.pm:162
STACK Bio::Factory::ObjectFactory::create_object /home/marcl/src/bioperl/bioperl-live/Bio/Factory/ObjectFactory.pm:150
STACK Bio::Ontology::SimpleOntologyEngine::get_relationships /home/marcl/src/bioperl/bioperl-live/Bio/Ontology/SimpleOntologyEngine.pm:504
STACK Bio::Ontology::Ontology::get_relationships /home/marcl/src/bioperl/bioperl-live/Bio/Ontology/Ontology.pm:386
STACK Bio::DB::Persistent::PersistentObject::AUTOLOAD /home/marcl/src/bioperl/bioperl-db/Bio/DB/Persistent/PersistentObject.pm:541
STACK toplevel ./validate_feature.pl:22

--------------------------------------

when I change the last line to $key_ont->get_relationships(), an empty list is returned. 
I am obviously missing something. I am pretty sure that the relations are there (verbositiy  while fetching from database, and data dump of the ontology objects).
Can somebody shed some light ? 
Regards,
Marc









***********************************************************
Marc Logghe, Ph.D.
Senior Scientist
Scientific Computing Group
Devgen nv
Technologiepark 9
B - 9052 Ghent-Zwijnaarde
Belgium
Tel: +32 9 324 24 88
Fax: +32 9 324 24 25

> **** DISCLAIMER ********************************************************** 
> "This e-mail and any attachments thereto may contain information 
> which is confidential and/or protected by intellectual property 
> rights and are intended for the sole use of the recipient(s) named above. 
> Any use of the information contained herein (including, but not limited to, 
> total or partial reproduction, communication or distribution in any form) 
> by persons other than the designated recipient(s) is prohibited. 
> If you have received this e-mail in error, please notify the sender either 
> by telephone or by e-mail and delete the material from any computer. 
> Thank you for your cooperation."
> 



More information about the Bioperl-l mailing list