The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Find terms by synonym or alternate label or xref</title>
</head>
<body>
	
<h2>Getting a term by its features (e.g. synonyms, xref)</h2>
	
<ol>
	<li><a href="#1">Get a term by its name or any of its synonyms.</a></li>
		
	<li><a href="#2">Get a term by one of its xref's.</a></li>

</ol>
	
	<ol>
	<li> <b><a name="1">Get a term by its name or any of its synonyms:</a></b>
		<pre>
		
			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();
			
		</pre>
	</li>
	
	<li> <b><a name="2">Get a term by one of its xref's:</a></b>
		<pre>
		
			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();
			
		</pre>
	</li>
	</ol>
</body>
</html>