Bio::Annotation - A generic object for annotations.
use Bio::Annotation;use Bio::Annotation::DBLink;use Bio::Annotation::Comment;
my $link = new Bio::Annotation::DBLink(-database => 'TSC',-primary_id => 'TSC0000030');my $ann = Bio::Annotation->new('-description' => 'some description');$ann->add_DBLink($link);
my $comment = Bio::Annotation::Comment->new('-text' => 'Text of comment');my $comment2 = Bio::Annotation::Comment->new('-text' => 'Second comment');$ann->add_Comment($comment);$ann->add_Comment($comment2);
my $ref = Bio::Annotation::Reference->new( '-authors' => 'author line','-title' => 'title line','-location'=> 'location line','-start' => 12);$ann->add_Reference($ref);
# description is a simple, one line descriptionprint "Description is ",$ann->description, "\n";
foreach $comment ( $ann->each_Comment ) {# $comment is a Bio::Annotation::Comment objectprint "Comment: ", $comment->text(), "\n";}
foreach $link ( $ann->each_DBLink ) {# link is a Bio::Annotation::DBLink objectprint "Link to ",$link->primary_id, " in database", $link->database,"\n"; }
foreach $ref ( $ann->each_Reference ) {# link is a Bio::Annotation::Reference objectprint "Reference title ", $ref->title , "\n";}
The object represents generic biological annotation of an object. It has the ability to provide
a brief, one line descriptionfree text commentslinks to other biological objectsreferences to literature
It does not have the following abilities
The basis (experimental/non experimental/homology)of the annotation. This is considered to be part ofthe object which owns the annotation. This isbecause the type of relevant basis is usuallydependent on the object
The previous revisions of the objectThis should be a property of whatever database thisobject comes from
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
[email protected] - General discussionhttp://bio.perl.org/MailList.html - About the mailing lists
Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:
[email protected]http://bio.perl.org/bioperl-bugs/
Email [email protected] The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : $annotation = Bio::Annotation->new( '-description' => 'a description line');Function: Makes a new Annotation object. The main thingyou will want to do with this is add comment objects anddblink objects, with calls like
$annotation->add_Comment($comment);$annotation->add_DBLink($dblink);
Example :Returns : a new Bio::Annotation ObjectArgs : hash, potentially with one field, -description
description
Title : descriptionUsage : $obj->description($newval)Function:Example :Returns : value of descriptionArgs : newvalue (optional)
add_gene_name
Title : add_gene_nameUsage : $self->add_gene_name($name1[,$name2,...])Function: adds a reference objectExample :Returns :Args : a string, or a list of strings
remove_gene_name
Title : remove_gene_nameUsage : $self->remove_gene_name($index)Function: removes a particular gene nameExample :Returns :Args : index of the name to remove
each_gene_name
Title : each_gene_nameUsage : foreach $genename ( $self->each_gene_name() ) {print "seq has gene name $genename\n";}Function: gets the array of gene namesExample :Returns : an array of stringsArgs :
add_Reference
Title : add_ReferenceUsage : $self->add_Reference($ref1[,$ref2,...])Function: adds a reference objectExample :Returns :Args : a Bio::Annotation::Reference or derived object
remove_Reference
Title : remove_ReferenceUsage : $self->remove_Reference($index)Function: removes a reference objectExample :Returns :Args : index number from references array
each_Reference
Title : each_ReferenceUsage : foreach $ref ( $self->each_Reference() )Function: gets an array of referenceExample :Returns : an array of Bio::Annotation::Reference or derived objectsArgs :
add_Comment
Title : add_CommentUsage : $self->add_Comment($ref)Function: adds a Comment objectExample :Returns :Args : a Bio::Annotation::Comment or derived object
remove_Comment
Title : remove_CommentUsage : $self->remove_Comment($index)Function: removes a comment objectExample :Returns :Args : index number from comments array
each_Comment
Title : each_CommentUsage : foreach $ref ( $self->each_Comment() )Function: gets an array of Comment of objectsExample :Returns : an array of Bio::Annotation::Comment or derived objectsArgs : none
add_DBLink
Title : add_DBLinkUsage : $self->add_DBLink($ref)Function: adds a link objectExample :Returns :Args : a Bio::Annotation::DBLink or derived object
remove_DBLink
Title : remove_DBLinkUsage : $self->remove_DBLink($index)Function: removes a DBLink objectExample :Returns :Args : index number from links array
each_DBLink
Title : each_DBLinkUsage : foreach $ref ( $self->each_DBlink() )Function: gets an array of DBlink of objectsExample :Returns : an array of Bio::Annotation::DBlink or derived objectsArgs :