logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Bio::Annotation::DBLink - untyped links between databases

Annotationi Implementing Functions

as_text
        Title   : as_text
        Usage   :
        Function:
        Example :
        Returns :
        Args    :

   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 :
        Returns : a string
        Args    : [optional] callback

   hash_tree
        Title   : hash_tree
        Usage   :
        Function:
        Example :
        Returns :
        Args    :

   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 :
        Returns : value of tagname (a scalar)
        Args    : new value (a scalar, optional)

Appendix

       The rest of the documentation details each of the object methods. Internal methods are usually preceded
       with a _

   new
        Title   : new
        Usage   : $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 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

Author - Ewan Birney

       Ewan Birney - birney@ebi.ac.uk

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.

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

perl v5.32.1                                       2021-08-15                       Bio::Annotation::DBLink(3pm)

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 Also