.\" 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::AnnotationI 3pm" .TH Bio::AnnotationI 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::AnnotationI \- Annotation interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # generally you get AnnotationI\*(Aqs from AnnotationCollectionI\*(Aqs \& \& 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"; \& # you can also use a generic hash_tree method for getting \& # stuff out say into XML format \& $hash_tree = $value\->hash_tree(); \& } \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Interface all annotations must support. There are two things that each annotation has to support. .PP .Vb 1 \& $annotation\->as_text() .Ve .PP Annotations have to support an \*(L"as_text\*(R" method. This should be a single text string, without newlines representing the annotation, mainly for human readability. It is not aimed at being able to store/represent the annotation. .PP The second method allows annotations to at least attempt to represent themselves as pure data for storage/display/whatever. The method hash_tree should return an anonymous hash with \*(L"XML-like\*(R" formatting: .PP .Vb 1 \& $hash = $annotation\->hash_tree(); .Ve .PP The formatting is as follows. .PP .Vb 1 \& (1) For each key in the hash, if the value is a reference\*(Aqd array \- \& \& (2) For each element of the array if the value is a object \- \& Assume the object has the method "hash_tree"; \& (3) else if the value is a reference to a hash \& Recurse again from point (1) \& (4) else \& Assume the value is a scalar, and handle it directly as text \& (5) else (if not an array) apply rules 2,3 and 4 to value .Ve .PP The \s-1XML\s0 path in tags is represented by the keys taken in the hashes. When arrays are encountered they are all present in the path level of this tag .PP This is a pretty \*(L"natural\*(R" representation of an object tree in an \s-1XML\s0 style, without forcing everything to inherit off some super-generic interface for representing things in the hash. .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 1 \& bioperl\-l@bioperl.org .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 "as_text" .IX Subsection "as_text" .Vb 8 \& Title : as_text \& Usage : \& Function: single text string, without newlines representing the \& annotation, mainly for human readability. It is not aimed \& at being able to store/represent the annotation. \& 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 the specific implementation. \& \& Implementations should allow passing a callback as an argument which \& allows custom text generation; the callback will be passed the \& current implementation. \& \& Note that this is meant to be used as a simple representation \& of the annotation data but probably shouldn\*(Aqt be used in cases \& where more complex comparisons are needed or where data is \& stored. \& Example : \& Returns : a string \& Args : [optional] callback .Ve .SS "hash_tree" .IX Subsection "hash_tree" .Vb 6 \& Title : hash_tree \& Usage : \& Function: should return an anonymous hash with "XML\-like" formatting \& 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