NAME
Bio::Annotation::DBLink - untyped links between databases
SYNOPSIS
$link1 = Bio::Annotation::DBLink->new(-database => 'TSC',-primary_id => 'TSC0000030');#or$link2 = Bio::Annotation::DBLink->new();$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.
Aside from Bio::AnnotationI, this class also implements Bio::IdentifiableI.
AUTHOR - Ewan Birney
Ewan Birney - [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : $dblink = Bio::Annotation::DBLink->new(-database =>"GenBank",-primary_id => "M123456");Function: Creates a new instance of this class.Example :Returns : A new instance of Bio::Annotation::DBLink.Args : Named parameters. At present, the following parameters arerecognized.-database the name of the database referenced by the xref-primary_id the primary (main) id of the referenced entry(usually this will be an accession number)-optional_id a secondary ID under which the referenced entryis known in the same database-comment comment text for the dbxref-tagname the name of the tag under which to add thisinstance to an annotation bundle (usually 'dblink')-type the type of information in the referenced entry(e.g. protein, mRNA, structure)-namespace synonymous with -database (also overrides)-version version of the referenced entry-authority attribute of the Bio::IdentifiableI interface-url attribute of the Bio::IdentifiableI interface
AnnotationI implementing functions
as_text
Title : as_textUsage :Function:Example :Returns :Args :
display_text
Title : display_textUsage : my $str = $ann->display_text();Function: returns a string. Unlike as_text(), this method returns a stringformatted as would be expected for te specific implementation.One can pass a callback as an argument which allows custom textgeneration; the callback is passed the current instance and any textreturnedExample :Returns : a stringArgs : [optional] callback
hash_tree
Title : hash_treeUsage :Function:Example :Returns :Args :
tagname
Title : tagnameUsage : $obj->tagname($newval)Function: Get/set the tagname for this annotation value.Setting this is optional. If set, it obviates the need toprovide a tag to Bio::AnnotationCollectionI when addingthis object. When obtaining an AnnotationI object from thecollection, the collection will set the value to the tagunder which it was stored unless the object has a tagstored already.Example :Returns : value of tagname (a scalar)Args : new value (a scalar, optional)
Specific accessors for DBLinks
database
Title : databaseUsage : $self->database($newval)Function: set/get on the database string. Databases are justa string here which can then be interpreted elsewhereExample :Returns : value of databaseArgs : newvalue (optional)
primary_id
Title : primary_idUsage : $self->primary_id($newval)Function: set/get on the primary id (a string)The primary id is the main identifier used for this object inthe database. Good examples would be accession numbers. The idis meant to be the main, stable identifier for this objectExample :Returns : value of primary_idArgs : newvalue (optional)
optional_id
Title : optional_idUsage : $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. Themain issue is that some databases do not have a cleansingle string identifier scheme. It is hoped that theprimary_id can behave like a reasonably sane "single stringidentifier" of objects, and people can use/abuse optionalids to their heart's content to provide precise mappings.Example :Returns : value of optional_idArgs : newvalue (optional)
comment
Title : commentUsage : $self->comment($newval)Function: get/set of comments (comment object)Sets or gets comments of this dblink, which is sometimes relevantExample :Returns : value of comment (Bio::Annotation::Comment)Args : newvalue (optional)
type
Title : typeUsage : $self->type($newval)Function: get/set of typeSets or gets the type of this dblink.Example : $self->type('protein')Returns : value of typeArgs : newvalue (optional)
Methods for Bio::IdentifiableI compliance
object_id
Title : object_idUsage : $string = $obj->object_id()Function: a string which represents the stable primary identifierin this namespace of this object. For DNA sequences thisis its accession_number, similarly for protein sequencesThis is aliased to primary_id().Returns : A scalar
version
Title : versionUsage : $version = $obj->version()Function: a number which differentiates between versions ofthe same object. Higher numbers are considered to belater and more relevant, but a single object describedthe same identifier should represent the same conceptReturns : A number
url
Title : urlUsage : $url = $obj->url()Function: URL which is associated with this DB linkReturns : string, full URL descriptor
authority
Title : authorityUsage : $authority = $obj->authority()Function: a string which represents the organisation whichgranted the namespace, written as the DNS name fororganisation (eg, wormbase.org)Returns : A scalar
namespace
Title : namespaceUsage : $string = $obj->namespace()Function: A string representing the name space this identifieris valid in, often the database name or the namedescribing the collectionFor DBLink this is the same as database().Returns : A scalar