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

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

πŸ’– NAME πŸ’–

okay so bestie, the man page header calls this one Bio::A...lection(3pm) β€” that's just User Contributed Perl Documentation doing its little truncation thing πŸ’… β€” and what it's actually about is:

Bio::Annotation::Collection β€” the default Perl implementation of AnnotationCollectionI. Periodt. ✨


🌈 SYNOPSIS 🌈

# get an AnnotationCollectionI somehow, eg

$ac = $seq->annotation();

foreach $key ( $ac->get_all_annotation_keys() ) {
    @values = $ac->get_Annotations($key);
    foreach $value ( @values ) {
       # value is an Bio::AnnotationI, and defines a "as_text" method
       print "Annotation ",$key," stringified value ",$value->as_text,"\n";

       # also defined hash_tree method, which allows data orientated
       # access into this object
       $hash = $value->hash_tree();
    }
}

πŸ¦‹ DESCRIPTION πŸ¦‹

It's the Bioperl implementation for Bio::AnnotationCollectionI. That's the whole vibe. 🫢


πŸ“¬ FEEDBACK πŸ“¬

πŸ’Œ Mailing Lists πŸ’Œ

User feedback is, like, an integral part of the evolution of this and every other Bioperl module β€” no cap. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is so appreciated. πŸ₯Ή

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

πŸ«‚ Support πŸ«‚

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than sliding into the module maintainer's DMs directly, bestie. There are tons of experienced and responsive experts on that list who will look at the problem and address it quickly. If it's at all possible, please include a thorough description of the problem with code and data examples β€” the more deets the better. πŸ’…

πŸ› Reporting Bugs πŸ›

Report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolutions. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR - Ewan Birney πŸ‘‘

Email birney@ebi.ac.uk πŸ’œ


πŸ“– APPENDIX πŸ“–

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk πŸ”).

🌱 new 🌱

  • Title: new
  • Usage: $coll = Bio::Annotation::Collection->new()
  • Function: Makes a new Annotation::Collection object. brand new, fresh out the box πŸŽ€
  • Returns: Bio::Annotation::Collection
  • Args: none

🧬 Bio::AnnotationCollectionI implementing methods 🧬

πŸ”‘ get_all_annotation_keys πŸ”‘

  • Title: get_all_annotation_keys
  • Usage: $ac->get_all_annotation_keys()
  • Function: gives back a list of annotation keys, which are simple text strings β€” literally just strings, nothing fancy ✨
  • Returns: list of strings
  • Args: none

πŸ“₯ get_Annotations πŸ“₯

  • Title: get_Annotations
  • Usage: my @annotations = $collection->get_Annotations('key')
  • Function: Retrieves all the Bio::AnnotationI objects for one or more specific key(s).

If no key is given, returns all annotation objects.

The returned objects will have their tagname() attribute set to the key under which they were attached, unless the tagname was already set.

  • Returns: list of Bio::AnnotationI β€” empty if no objects stored for a key
  • Args: keys (list of strings) for annotations (optional)

πŸͺ† get_nested_Annotations πŸͺ†

  • Title: get_nested_Annotations
  • Usage:
my @annotations = $collection->get_nested_Annotations(
                             '-key' => \@keys,
                             '-recursive => 1);
  • Function: Retrieves all the Bio::AnnotationI objects for one or more specific key(s). If -recursive is set to true, traverses the nested annotation collections recursively and returns all annotations matching the key(s).

If no key is given, returns all annotation objects.

The returned objects will have their tagname() attribute set to the key under which they were attached, unless the tagname was already set.

  • Returns: list of Bio::AnnotationI β€” empty if no objects stored for a key
  • Args:
-keys      => arrayref of keys to search for (optional)
-recursive => boolean, whether or not to recursively traverse the
 nested annotations and return annotations with matching keys.

πŸ—‚οΈ get_all_Annotations πŸ—‚οΈ

  • Title: get_all_Annotations
  • Usage: (blank in the original, bestie β€” not making anything up πŸ™ˆ)
  • Function: Similar to get_Annotations, but it traverses and flattens nested annotation collections. Which means collections in the tree get replaced by their components. iconic behavior tbh.

Keys will not be passed on to nested collections. I.e., if the tag name of a nested collection matches the key, it will be flattened in its entirety.

Hence, for un-nested annotation collections this will be identical to get_Annotations.

  • Example: (blank)
  • Returns: an array of Bio::AnnotationI compliant objects
  • Args: keys (list of strings) for annotations (optional)

πŸ”’ get_num_of_annotations πŸ”’

  • Title: get_num_of_annotations
  • Usage: my $count = $collection->get_num_of_annotations()
  • Function: Returns the count of all annotations stored in this collection β€” the little census of your annotations πŸ“Š
  • Returns: integer
  • Args: none

πŸ› οΈ Implementation specific functions - mainly for adding πŸ› οΈ

βž• add_Annotation βž•

  • Title: add_Annotation
  • Usage:
$self->add_Annotation('reference',$object);
$self->add_Annotation($object,'Bio::MyInterface::DiseaseI');
$self->add_Annotation($object);
$self->add_Annotation('disease',$object,'Bio::MyInterface::DiseaseI');
  • Function: Adds an annotation for a specific key.

If the key is omitted, the object to be added must provide a value via its tagname().

If the archetype is provided, this and future objects added under that tag have to comply with the archetype and will be rejected otherwise.

  • Returns: none
  • Args:
annotation key ('disease', 'dblink', ...)
object to store (must be Bio::AnnotationI compliant)
[optional] object archetype to map future storage of object
           of these types to

πŸ—‘οΈ remove_Annotations πŸ—‘οΈ

  • Title: remove_Annotations
  • Usage: (blank)
  • Function: Remove the annotations for the specified key from this collection.
  • Example: (blank)
  • Returns: an array Bio::AnnotationI compliant objects which were stored under the given key(s)
  • Args: the key(s) (tag name(s), one or more strings) for which to remove annotations (optional; if none given, flushes all annotations πŸ’€)

πŸ«“ flatten_Annotations πŸ«“

  • Title: flatten_Annotations
  • Usage: (blank)
  • Function: Flattens part or all of the annotations in this collection.

This is a convenience method for getting the flattened annotation for the given keys, removing the annotation for those keys, and adding back the flattened array.

This should not change anything for un-nested collections.

  • Example: (blank)
  • Returns: an array Bio::AnnotationI compliant objects which were stored under the given key(s)
  • Args: list of keys (strings) the annotation for which to flatten, defaults to all keys if not given

🌸 Bio::AnnotationI methods implementations 🌸

This is to allow nested annotation: you can use a collection as an annotation object for an annotation collection. πŸͺ†βœ¨

πŸ“ as_text πŸ“

  • Title: as_text
  • Usage: (blank)
  • Function: See Bio::AnnotationI
  • Example: (blank)
  • Returns: a string
  • Args: none

πŸ–¨οΈ 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 the 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: See Bio::AnnotationI
  • Example: (blank)
  • Returns: a hash reference
  • Args: none

🏷️ 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)

πŸ•°οΈ Backward compatible functions πŸ•°οΈ

Functions put in for backward compatibility with old Bio::Annotation.pm stuff. 🫢

okay bestie, fair warning: for every single one of these, the original doc leaves Function, Example, Returns and Args completely blank. I'm not out here inventing behavior, so they stay blank. πŸ™ˆ

description

  • Title: description
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

add_gene_name

  • Title: add_gene_name
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

each_gene_name

  • Title: each_gene_name
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

add_Reference

  • Title: add_Reference
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

each_Reference

  • Title: each_Reference
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

add_Comment

  • Title: add_Comment
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

each_Comment

  • Title: each_Comment
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:
  • Title: add_DBLink
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:
  • Title: each_DBLink
  • Usage:
  • Function:
  • Example:
  • Returns:
  • Args:

🧚 Implementation management functions 🧚

πŸ—ΊοΈ _typemap πŸ—ΊοΈ

  • Title: _typemap
  • Usage: $obj->_typemap($newval)
  • Function: (blank)
  • Example: (blank)
  • Returns: value of _typemap
  • Args: newvalue (optional)

and that's the whole page, bestie!! πŸ’– this one's from perl v5.32.1, dated 2021-08-15 β€” go forth and annotate responsibly, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from