NAME

Bio::AnnotatableI - the base interface an annotatable object must implement

SYNOPSIS

use Bio::SeqIO;
# get an annotatable object somehow: for example, Bio::SeqI objects
# are annotatable
my $seqio = Bio::SeqIO->new(-fh => \*STDIN, -format => 'genbank');
while (my $seq = $seqio->next_seq()) {
    # $seq is-a Bio::AnnotatableI, hence:
    my $ann_coll = $seq->annotation();
    # $ann_coll is-a Bio::AnnotationCollectionI, hence:
    my @all_anns = $ann_coll->get_Annotations();
    # do something with the annotation objects
}

DESCRIPTION

This is the base interface that all annotatable objects must implement. A good example is Bio::Seq which is an AnnotableI object.

FEEDBACK

Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:

http://bugzilla.open-bio.org/

AUTHOR

Hilmar Lapp E<lt>hlapp@gmx.netE<gt>
Allen Day E<lt>allenday@ucla.eduE<gt>

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

annotation

Title   : annotation
Usage   : $obj->annotation($newval)
Function: Get the annotation collection for this annotatable object.
Example : 
Returns : a Bio::AnnotationCollectionI implementing object, or undef
Args    : on set, new value (a Bio::AnnotationCollectionI
          implementing object, optional) (an implementation may not
          support changing the annotation collection)

See Bio::AnnotationCollectionI

"*_tag_*" METHODS

The methods below allow mapping of the old "get_tag_values()"-style annotation access to Bio::AnnotationCollectionI. These need not be implemented in a Bio::AnnotationCollectionI compliant class, as they are built on top of the methods.

DEPRECATED: DO NOT USE THESE FOR FUTURE DEVELOPMENT.

has_tag

Usage   : $count = $obj->has_tag($tag)
Function: returns the number of annotations corresponding to $tag
Returns : an integer
Args    : tag name
Note    : DEPRECATED

Use "get_Annotations" instead.

add_tag_value

Usage   : See add_Annotation
Function:
Returns : 
Args    : DEPRECATED

See Bio::AnnotationCollectionI::add_Annotation

get_Annotations

Usage   : my $parent   = $obj->get_Annotations('Parent');
          my @parents = $obj->get_Annotations('Parent');
Function: a wrapper around Bio::Annotation::Collection::get_Annotations().
Returns : returns annotations as
          Bio::Annotation::Collection::get_Annotations() does, but
          additionally returns a single scalar in scalar context
          instead of list context so that if an annotation tag
          contains only a single value, you can do:

          $parent = $feature->get_Annotations('Parent');

          instead of:

          ($parent) = ($feature->get_Annotations('Parent'))[0];

          if the 'Parent' tag has multiple values and is called in a
          scalar context, the number of annotations is returned.

Args    : an annotation tag name.

get_tag_values

Usage   : @annotations = $obj->get_tag_values($tag)
Function: returns annotations corresponding to $tag
Returns : a list of scalars
Args    : tag name
Note    : DEPRECATED

This method is essentially "get_Annotations", use it instead.

get_tagset_values

Usage   : @annotations = $obj->get_tagset_values($tag1,$tag2)
Function: returns annotations corresponding to a list of tags.
          this is a convenience method equivalent to multiple calls
          to get_tag_values with each tag in the list.
Returns : a list of Bio::AnnotationI objects.
Args    : a list of tag names
Note    : DEPRECATED

See Bio::AnnotationCollectionI::get_Annotations

get_all_tags

Usage   : @tags = $obj->get_all_tags()
Function: returns a list of annotation tag names.
Returns : a list of tag names
Args    : none
Note    : DEPRECATED

See Bio::AnnotationCollectionI::get_all_annotation_keys

remove_tag

Usage   : See remove_Annotations().
Function:
Returns : 
Args    : DEPRECATED
Note    : Contrary to what the name suggests, this method removes
          all annotations corresponding to $tag, not just a
          single anntoation.

See Bio::AnnotationCollectionI::remove_Annotations