Bio::A...:DBLink(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

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 the Bio::IdentifiableI interface
    • -url β€” attribute of the Bio::IdentifiableI interface

🧚 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)

πŸ’… 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