Getting a term by its features (e.g. synonyms, xref)

  1. Get a term by its name or any of its synonyms.
  2. Get a term by one of its xref's.
  1. Get a term by its name or any of its synonyms:
    		
    			use OBO::Parser::OBOParser;
    			
    			my $my_parser = OBO::Parser::OBOParser->new();
    			my $ontology = $my_parser->work("my_obo_ontology.obo");
    			
    			my $synonym = "cell-cycle";
    			my $interesting_term = $ontology->get_term_by_name_or_synonym($synonym);
    			
    			print "The name of the term is: ", $interesting_term->name();
    			
    		
  2. Get a term by one of its xref's:
    		
    			use OBO::Parser::OBOParser;
    			
    			my $my_parser = OBO::Parser::OBOParser->new();
    			my $ontology = $my_parser->work("my_obo_ontology.obo");
    			
    			my $db  = "Reactome";
    			my $acc = "12345";
    			
    			my $interesting_term = $ontology->get_term_by_xref($db, $acc);
    			
    			print "The name of the term is: ", $interesting_term->name();