[Bioperl-l] Annotations and annotation tags can be Ontology Terms

Hilmar Lapp hlapp at gnf.org
Mon Mar 10 18:01:49 EST 2003


I'm just rediscovering some of the work I did back in October last 
year, and since the ability to use ontology terms for annotations was 
demanded recently in some comments, I thought it's worth mentioning 
here.

The following is an excerpt from Bio::Annotation::SimpleValue. It 
essentially means instead of

	$svann = Bio::Annotation::SimpleValue->new(-value => "ADH");
	$anncoll->add_Annotation('gene_name', $svann);

you can do the following, which supposedly facilitates adhering to 
controlled, commonly used, vocabularies:

	$hugogene = Bio::Ontology::Term->new(-name => "gene name",
	                                     -ontology => "HUGO");
	$svann = Bio::Annotation::SimpleValue->new(-value => "ADH",
	                                           -tag_term => $hugogene);
	$anncoll->add_Annotation($svann); # tag is implicit

As an aside, you can also already annotate (associate) directly 
ontology terms:

	$goterm = # get a GO term to be associated somehow
	$ann = Bio::Annotation::OntologyTerm->new(-term => $goterm);
	$anncoll->add_Annotation($ann);  # tag is implicit

Taken from SimpleValue:

=head2 tag_term

  Title   : tag_term
  Usage   : $obj->tag_term($newval)
  Function: Get/set the L<Bio::Ontology::TermI> object representing
            the tag name.

            This is so you can specifically relate the tag of this
            annotation to an entry in an ontology. You may want to do
            this to associate an identifier with the tag, or a
            particular category, such that you can better match the tag
            against a controlled vocabulary.

            This accessor will return undef if it has never been set
            before in order to allow this annotation to stay
            light-weight if an ontology term representation of the tag
            is not needed. Once it is set to a valid value, tagname()
            will actually delegate to the name() of this term.

  Example :
  Returns : a L<Bio::Ontology::TermI> compliant object, or undef
  Args    : on set, new value (a scalar or undef, optional)
                                 ^^^^^^
                                 This is a documentation bug :|

	-hilmar
-- 
-------------------------------------------------------------
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