[Bioperl-l] ontology help
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
As for what's causing the error, it is most likely the following call
at line# 503.
$relfact->create_object(-object_term => $parent_term,
-predicate_term => $rel_info,
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
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 =>
> 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
> STACK Bio::Ontology::Relationship::subject_term
> STACK Bio::Ontology::Relationship::new
> STACK Bio::Factory::ObjectFactory::create_object
> STACK Bio::Ontology::SimpleOntologyEngine::get_relationships
> STACK Bio::Ontology::Ontology::get_relationships
> STACK Bio::DB::Persistent::PersistentObject::AUTOLOAD
> 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 ?
> Marc Logghe, Ph.D.
> Senior Scientist
> Scientific Computing Group
> Devgen nv
> Technologiepark 9
> B - 9052 Ghent-Zwijnaarde
> 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
>> Any use of the information contained herein (including, but not
>> limited to,
>> total or partial reproduction, communication or distribution in any
>> by persons other than the designated recipient(s) is prohibited.
>> If you have received this e-mail in error, please notify the sender
>> 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
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
More information about the Bioperl-l