.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Annotation::Collection 3pm" .TH Bio::Annotation::Collection 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Annotation::Collection \- Default Perl implementation of AnnotationCollectionI .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # 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,"\en"; \& \& # also defined hash_tree method, which allows data orientated \& # access into this object \& $hash = $value\->hash_tree(); \& } \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Bioperl implementation for Bio::AnnotationCollectionI .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Ewan Birney" .IX Header "AUTHOR - Ewan Birney" Email birney@ebi.ac.uk .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 5 \& Title : new \& Usage : $coll = Bio::Annotation::Collection\->new() \& Function: Makes a new Annotation::Collection object. \& Returns : Bio::Annotation::Collection \& Args : none .Ve .SH "Bio::AnnotationCollectionI implementing methods" .IX Header "Bio::AnnotationCollectionI implementing methods" .SS "get_all_annotation_keys" .IX Subsection "get_all_annotation_keys" .Vb 5 \& Title : get_all_annotation_keys \& Usage : $ac\->get_all_annotation_keys() \& Function: gives back a list of annotation keys, which are simple text strings \& Returns : list of strings \& Args : none .Ve .SS "get_Annotations" .IX Subsection "get_Annotations" .Vb 4 \& Title : get_Annotations \& Usage : my @annotations = $collection\->get_Annotations(\*(Aqkey\*(Aq) \& 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) .Ve .SS "get_nested_Annotations" .IX Subsection "get_nested_Annotations" .Vb 8 \& Title : get_nested_Annotations \& Usage : my @annotations = $collection\->get_nested_Annotations( \& \*(Aq\-key\*(Aq => \e@keys, \& \*(Aq\-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. .Ve .SS "get_all_Annotations" .IX Subsection "get_all_Annotations" .Vb 5 \& Title : get_all_Annotations \& Usage : \& Function: Similar to get_Annotations, but traverses and flattens nested \& annotation collections. This means that collections in the \& tree will be replaced by their components. \& \& 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 : \& Returns : an array of L compliant objects \& Args : keys (list of strings) for annotations (optional) .Ve .SS "get_num_of_annotations" .IX Subsection "get_num_of_annotations" .Vb 5 \& Title : get_num_of_annotations \& Usage : my $count = $collection\->get_num_of_annotations() \& Function: Returns the count of all annotations stored in this collection \& Returns : integer \& Args : none .Ve .SH "Implementation specific functions \- mainly for adding" .IX Header "Implementation specific functions - mainly for adding" .SS "add_Annotation" .IX Subsection "add_Annotation" .Vb 6 \& Title : add_Annotation \& Usage : $self\->add_Annotation(\*(Aqreference\*(Aq,$object); \& $self\->add_Annotation($object,\*(AqBio::MyInterface::DiseaseI\*(Aq); \& $self\->add_Annotation($object); \& $self\->add_Annotation(\*(Aqdisease\*(Aq,$object,\*(AqBio::MyInterface::DiseaseI\*(Aq); \& 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 (\*(Aqdisease\*(Aq, \*(Aqdblink\*(Aq, ...) \& object to store (must be Bio::AnnotationI compliant) \& [optional] object archetype to map future storage of object \& of these types to .Ve .SS "remove_Annotations" .IX Subsection "remove_Annotations" .Vb 9 \& Title : remove_Annotations \& Usage : \& Function: Remove the annotations for the specified key from this collection. \& Example : \& 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) .Ve .SS "flatten_Annotations" .IX Subsection "flatten_Annotations" .Vb 3 \& Title : flatten_Annotations \& Usage : \& 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 : \& 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 .Ve .SH "Bio::AnnotationI methods implementations" .IX Header "Bio::AnnotationI methods implementations" .Vb 2 \& This is to allow nested annotation: you can use a collection as an \& annotation object for an annotation collection. .Ve .SS "as_text" .IX Subsection "as_text" .Vb 6 \& Title : as_text \& Usage : \& Function: See L \& Example : \& Returns : a string \& Args : none .Ve .SS "display_text" .IX Subsection "display_text" .Vb 4 \& 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 .Ve .SS "hash_tree" .IX Subsection "hash_tree" .Vb 6 \& Title : hash_tree \& Usage : \& Function: See L \& Example : \& Returns : a hash reference \& Args : none .Ve .SS "tagname" .IX Subsection "tagname" .Vb 3 \& 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) .Ve .SH "Backward compatible functions" .IX Header "Backward compatible functions" Functions put in for backward compatibility with old Bio::Annotation.pm stuff .SS "description" .IX Subsection "description" .Vb 6 \& Title : description \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "add_gene_name" .IX Subsection "add_gene_name" .Vb 6 \& Title : add_gene_name \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "each_gene_name" .IX Subsection "each_gene_name" .Vb 6 \& Title : each_gene_name \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "add_Reference" .IX Subsection "add_Reference" .Vb 6 \& Title : add_Reference \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "each_Reference" .IX Subsection "each_Reference" .Vb 6 \& Title : each_Reference \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "add_Comment" .IX Subsection "add_Comment" .Vb 6 \& Title : add_Comment \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "each_Comment" .IX Subsection "each_Comment" .Vb 6 \& Title : each_Comment \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "add_DBLink" .IX Subsection "add_DBLink" .Vb 6 \& Title : add_DBLink \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "each_DBLink" .IX Subsection "each_DBLink" .Vb 6 \& Title : each_DBLink \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SH "Implementation management functions" .IX Header "Implementation management functions" .SS "_typemap" .IX Subsection "_typemap" .Vb 6 \& Title : _typemap \& Usage : $obj\->_typemap($newval) \& Function: \& Example : \& Returns : value of _typemap \& Args : newvalue (optional) .Ve