Bio::A...:DBLink(3pm)
π Bio::Annotation::DBLink β untyped links between databases π
okay bestie, gather round, because we're talking about Bio::A...:DBLink(3pm) β yes that's the manual name, she's from the User Contributed Perl Documentation collection and she is lowkey iconic. this page is your group chat briefing on Bio::Annotation::DBLink, a lil object that points at stuff in other databases without ever being nosy about what's in there. no cap.
β¨ 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);
see how easy that was?? two whole ways to make one. pick your fighter π
π DESCRIPTION π
so what is this thing. it provides an object which represents a link from one object to something in another database β and it does not prescribe what is in the other database. it's giving "i know a guy" energy. no assumptions, just vibes.
aside from Bio::AnnotationI, this class also implements Bio::IdentifiableI. double interface, double slay. β¨
π AUTHOR - Ewan Birney π
Ewan Birney β birney@ebi.ac.uk
π APPENDIX π
the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ (iykyk, that underscore means stay out of the kitchen unless you're cooking).
π new π
- Title β
new - Usage β
$dblink = Bio::Annotation::DBLink->new(-database =>"GenBank", -primary_id => "M123456"); - Function β Creates a new instance of this class.
- Example β (none given, bestie)
- Returns β A new instance of
Bio::Annotation::DBLink. - Args β Named parameters. At present, the following parameters are recognized.
-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 entry is known in the same database-commentβ comment text for the dbxref-tagnameβ the name of the tag under which to add this instance 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 theBio::IdentifiableIinterface-urlβ attribute of theBio::IdentifiableIinterface
π§ AnnotationI implementing functions π§
π as_text
- Title β
as_text - Usage β (blank)
- Function β (blank)
- Example β (blank)
- Returns β (blank)
- Args β (blank)
not me leaving the whole thing blank but that's literally what the docs say π
π display_text
- Title β
display_text - Usage β
my $str = $ann->display_text(); - Function β returns a string. Unlike
as_text(), this method returns a string formatted as would be expected for te specific implementation.
One can pass a callback as an argument which allows custom text generation; the callback is passed the current instance and any text returned
- Example β (blank)
- Returns β a string
- Args β [optional] callback
π hash_tree
- Title β
hash_tree - Usage β (blank)
- Function β (blank)
- Example β (blank)
- Returns β (blank)
- Args β (blank)
π tagname
- 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 β (blank)
- Returns β value of tagname (a scalar)
- Args β new value (a scalar, optional)
π Specific accessors for DBLinks π
π database
- Title β
database - Usage β
$self->database($newval) - Function β set/get on the database string. Databases are just a string here which can then be interpreted elsewhere
- Example β (blank)
- Returns β value of database
- Args β newvalue (optional)
π primary_id
- 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 β (blank)
- Returns β value of
primary_id - Args β newvalue (optional)
π optional_id
- 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 β (blank)
- Returns β value of
optional_id - Args β newvalue (optional)
π comment
- 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 β (blank)
- Returns β value of comment (
Bio::Annotation::Comment) - Args β newvalue (optional)
π type
- Title β
type - Usage β
$self->type($newval) - Function β get/set of type. Sets or gets the type of this dblink.
- Example β
$self->type('protein') - Returns β value of type
- Args β newvalue (optional)
β Methods for Bio::IdentifiableI compliance β
π object_id
- 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
π version
- 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
π url
- Title β
url - Usage β
$url = $obj->url() - Function β URL which is associated with this DB link
- Returns β string, full URL descriptor
π authority
- 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
π namespace
- 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
and that's the whole page, bestie!! π this was written by Ewan Birney, it's part of perl v5.32.1, dated 2021-08-15, and it ships with the User Contributed Perl Documentation. go forth and link your databases, untyped and unbothered π¦β¨π
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms