Bio::Annotation DBLink
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Annotation::DBLink - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Bio::AnnotationI
Bio::IdentifiableI
Bio::Root::Root
Inherit
Bio::AnnotationI Bio::IdentifiableI Bio::Root::Root
Synopsis
   $link1 = new Bio::Annotation::DBLink(-database => 'TSC',
-primary_id => 'TSC0000030'
);
#or $link2 = new Bio::Annotation::DBLink(); $link2->database('dbSNP'); $link2->primary_id('2367'); # DBLink is-a Bio::AnnotationI object, can be added to annotation # collections, e.g. the one on features or seqs $feat->annotation->add_Annotation('dblink', $link2);
Description
Provides an object which represents a link from one object to something
in another database without prescribing what is in the other database
Methods
as_textDescriptionCode
authorityDescriptionCode
commentDescriptionCode
databaseDescriptionCode
hash_treeDescriptionCode
namespaceDescriptionCode
new
No description
Code
object_idDescriptionCode
optional_idDescriptionCode
primary_idDescriptionCode
tagnameDescriptionCode
versionDescriptionCode
Methods description
as_textcode    nextTop
 Title   : as_text
Usage :
Function:
Example :
Returns :
Args :
authoritycodeprevnextTop
 Title   : authority
Usage : $authority = $obj->authority()
Function: a string which represents the organisation which
granted the namespace, written as the DNS name for
organisation (eg, wormbase.org)
Returns : A scalar
commentcodeprevnextTop
 Title   : comment
Usage : $self->comment($newval)
Function: get/set of comments (comment object)
Sets or gets comments of this dblink, which is sometimes relevant
Example :
Returns : value of comment (Bio::Annotation::Comment)
Args : newvalue (optional)
databasecodeprevnextTop
 Title   : database
Usage : $self->database($newval)
Function: set/get on the database string. Databases are just
a string here which can then be interpretted elsewhere
Example :
Returns : value of database
Args : newvalue (optional)
hash_treecodeprevnextTop
 Title   : hash_tree
Usage :
Function:
Example :
Returns :
Args :
namespacecodeprevnextTop
 Title   : namespace
Usage : $string = $obj->namespace()
Function: A string representing the name space this identifier
is valid in, often the database name or the name
describing the collection
For DBLink this is the same as database(). Returns : A scalar
object_idcodeprevnextTop
 Title   : object_id
Usage : $string = $obj->object_id()
Function: a string which represents the stable primary identifier
in this namespace of this object. For DNA sequences this
is its accession_number, similarly for protein sequences
This is aliased to primary_id(). Returns : A scalar
optional_idcodeprevnextTop
 Title   : optional_id
Usage : $self->optional_id($newval)
Function: get/set for the optional_id (a string)
optional id is a slot for people to use as they wish. The main issue is that some databases do not have a clean single string identifier scheme. It is hoped that the primary_id can behave like a reasonably sane "single string identifier" of objects, and people can use/abuse optional ids to their heart's content to provide precise mappings. Example : Returns : value of optional_id Args : newvalue (optional)
primary_idcodeprevnextTop
 Title   : primary_id
Usage : $self->primary_id($newval)
Function: set/get on the primary id (a string)
The primary id is the main identifier used for this object in
the database. Good examples would be accession numbers. The id
is meant to be the main, stable identifier for this object
Example :
Returns : value of primary_id
Args : newvalue (optional)
tagnamecodeprevnextTop
 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)
versioncodeprevnextTop
 Title   : version
Usage : $version = $obj->version()
Function: a number which differentiates between versions of
the same object. Higher numbers are considered to be
later and more relevant, but a single object described
the same identifier should represent the same concept
Returns : A number
Methods code
as_textdescriptionprevnextTop
sub as_text {
   my ($self) = @_;

   return "Direct database link to ".$self->primary_id." in database ".$self->database;
}
authoritydescriptionprevnextTop
sub authority {
    my ($obj,$value) = @_;
    if( defined $value) {
	$obj->{'authority'} = $value;
    }
    return $obj->{'authority'};
}
commentdescriptionprevnextTop
sub comment {
   my ($self,$value) = @_;
   if( defined $value) {
      $self->{'comment'} = $value;
    }
    return $self->{'comment'};
}
databasedescriptionprevnextTop
sub database {
   my ($self,$value) = @_;

   if( defined $value) {
      $self->{'database'} = $value;
    }
    return $self->{'database'};
}
hash_treedescriptionprevnextTop
sub hash_tree {
   my ($self) = @_;
   
   my $h = {};
   $h->{'database'}   = $self->database;
   $h->{'primary_id'} = $self->primary_id;
   if( defined $self->optional_id ) {
       $h->{'optional_id'} = $self->optional_id;
   }
   if( defined $self->comment ) {
       # we know that comments have hash_tree methods
$h->{'comment'} = $self->comment; } return $h;
}
namespacedescriptionprevnextTop
sub namespace {
    return shift->database(@_);
}

1;
}
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;

  my $self = $class->SUPER::new(@args);

  my ($database, $primary_id, $optional_id, $comment, $tag, $ns, $auth, $v) =
      $self->_rearrange([qw(DATABASE
			    PRIMARY_ID
			    OPTIONAL_ID
			    COMMENT
			    TAGNAME
			    NAMESPACE
			    AUTHORITY
			    VERSION
			    )], @args);
  
  $database    && $self->database($database);
  $primary_id  && $self->primary_id($primary_id);
  $optional_id && $self->optional_id($optional_id);
  $comment     && $self->comment($comment);
  $tag         && $self->tagname($tag);
  # Bio::IdentifiableI parameters:
$ns && $self->namespace($ns); # this will override $database
$auth && $self->authority($auth); defined($v) && $self->version($v); return $self;
}
object_iddescriptionprevnextTop
sub object_id {
    return shift->primary_id(@_);
}
optional_iddescriptionprevnextTop
sub optional_id {
   my ($self,$value) = @_;
   if( defined $value) {
      $self->{'optional_id'} = $value;
    }
    return $self->{'optional_id'};
}
primary_iddescriptionprevnextTop
sub primary_id {
   my ($self,$value) = @_;
   if( defined $value) {
      $self->{'primary_id'} = $value;
    }
    return $self->{'primary_id'};
}
tagnamedescriptionprevnextTop
sub tagname {
    my ($self,$value) = @_;
    if( defined $value) {
	$self->{'tagname'} = $value;
    }
    return $self->{'tagname'};
}
versiondescriptionprevnextTop
sub version {
    my ($self,$value) = @_;
    if( defined $value) {
	$self->{'_version'} = $value;
    }
    return $self->{'_version'};
}
General documentation
AUTHOR - Ewan BirneyTop
Ewan Birney - birney@ebi.ac.uk
APPENDIXTop
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _
AnnotationI implementing functionsTop
Specific accessors for DBLinksTop
Methods for Bio::IdentifiableI complianceTop