[Bioperl-l] ontology error

S.Paul s.paul at surrey.ac.uk
Wed Jun 9 16:28:22 EDT 2004

Hi Everybody:

I am trying to write an ontology based on the structure of the PDB file and  am not sure why I am getting the following error message:

------------- EXCEPTION  -------------
MSG: term  already defined

STACK Bio::Ontology::SimpleOntologyEngine::add_term C:/Perl/site/lib/Bio/Ontolog
STACK Bio::Ontology::Ontology::add_term C:/Perl/site/lib/Bio/Ontology/Ontology.p
STACK toplevel js3_ontology2.pl:19

If I run only section 1 then it works but when I run section 2 I get the above error message. 

Thanks for the help in advance



       use Bio::Annotation::OntologyTerm;
       use Bio::Annotation::Collection;
       use Bio::Ontology::Term;
       use Bio::Ontology::Ontology;
       use Bio::Ontology::RelationshipType;

        my $coll = new Bio::Annotation::Collection;

       # this also implements a tag/value pair, where tag _and_ value are treated
       # as ontology terms; tagname is synonym to ontology and label is the same as name
       my $annterm = new Bio::Annotation::OntologyTerm(-label => 'Dopa Decarboxylase',
                                                       -tagname => 'Protein Name',
                                                       -identifier =>'1JS3',
                                                       -definition =>
     'Crystal Structure of Dopa Decarboxylase in complex with the 
      2 Inhibitor Carbidopa');
       # ontology terms can be added directly - they implicitly have a tag

       # implementation is by composition - you can get/set the term object
       # e.g.
       my $term = $annterm->term(); # term is-a Bio::Ontology::TermI
       print "ontology term: \n",$term->name(),"(ID ",$term->identifier(),
             "), ontology: ",$term->ontology()->name(),"\n",

 #ontology for 1JS3 pdb file: Crystal structure of Dopa decarboxylase in complex with the 2
 #inhibitor carbidopa
 # create ontology object   
 my $ont = Bio::Ontology::Ontology->new(-name => "PDSequence_PDB");  
 # add terms, relationships ...    
 my $bp = Bio::Ontology::Term->new(-name => "Title");  
 my $obf = Bio::Ontology::Term->new(-name => "Compound");  

 my $partof = Bio::Ontology::RelationshipType->get_instance("PART_OF");  
 $ont->add_relationship($bp, $obf, $partof); 
 print "the ontology \n",$ont;             
Sujoy Paul, PRISE Centre, UniS, s.paul at surrey.ac.uk

More information about the Bioperl-l mailing list