Bio::Annotation
Comment
Toolbar
Summary
Bio::Annotation::Comment - A comment object, holding text
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
$comment = Bio::Annotation::Comment->new();
$comment->text("This is the text of this comment");
$annotation->add_Annotation('comment', $comment);
Description
A holder for comments in annotations, just plain text. This is a very simple
object, and justifiably so.
Methods
Methods description
Title : as_text Usage : Function: Example : Returns : Args : |
Title : hash_tree Usage : Function: Example : Returns : Args : |
Title : new Usage : $comment = Bio::Annotation::Comment->new( '-text' => 'some text for this comment'); Function: This returns a new comment object, optionally with text filed Example : Returns : a Bio::Annotation::Comment object Args : a hash with -text optionally set |
Title : tagname Usage : $obj->tagname($newval) Function: Get/set the tagname for this annotation value.
Setting this is optional. If set, it obviates the need to provide
a tag to Bio::AnnotationCollectionI when adding this object. When
obtaining an AnnotationI object from the collection, the collection
will set the value to the tag under which it was stored unless the
object has a tag stored already.
Example :
Returns : value of tagname (a scalar)
Args : new value (a scalar, optional) |
Title : text Usage : $value = $self->text($newval) Function: get/set for the text field. A comment object just holds a single string which is accessible through this method Example : Returns : value of text Args : newvalue (optional) |
Methods code
sub as_text
{ my ($self) = @_;
return "Comment: ".$self->text; } |
sub hash_tree
{ my ($self) = @_;
my $h = {};
$h->{'text'} = $self->text; } |
sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my ($text,$tag) = $self->_rearrange([qw(TEXT TAGNAME)], @args);
defined $text && $self->text($text);
defined $tag && $self->tagname($tag);
return $self; } |
sub tagname
{ my ($self,$value) = @_;
if( defined $value) {
$self->{'tagname'} = $value;
}
return $self->{'tagname'}; } |
sub text
{ my ($self,$value) = @_;
if( defined $value) {
$self->{'text'} = $value;
}
return $self->{'text'};
}
1; } |
General documentation
Describe contact details here
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _
AnnotationI implementing functions | Top |
Specific accessors for Comments | Top |