[Bioperl-l] ontology help

Hilmar Lapp hlapp at gmx.net
Wed Jun 23 12:02:46 EDT 2004


Problem #1 is that SimpleOntologyEngine.pm is not used by the dag-edit  
flat file parsers and therefore is maintained less well thanf the  
alternative engine implementation SimpleGOEngine.pm, yet it is the  
default engine if you create a new Ontology instance yourself.

We could change the default, but SimpleGOEngine.pm depends on Graph.pm  
being installed while SimpleOntologyEngine has no external  
dependencies. We could also check at runtime whether Graph.pm is  
available and only then switch the default.

I'd appreciate some comments from people, especially those who use the  
Bio::Ontology system, as to what people would consider the best default  
behavior.

As for what's causing the error, it is most likely the following call  
at line# 503.

		     	$relfact->create_object(-object_term    => $parent_term,
					     	-subject_term   =>
					         	$self->get_term_by_identifier(
							            $child_id),
					     	-predicate_term => $rel_info,
					     	-ontology =>$parent_term->ontology
					     	);

get_term_by_identifier() returns an array, not a scalar, and an array  
in scalar context evaluates to the number of elements (a scalar, not a  
term object). I've fixed this in cvs HEAD. Let me know if this solves  
the problem.

	-hilmar

On Tuesday, June 22, 2004, at 09:50  AM, Marc Logghe wrote:

> 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."
>>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------




More information about the Bioperl-l mailing list