.\" 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::SeqFeature::AnnotationAdaptor 3pm" .TH Bio::SeqFeature::AnnotationAdaptor 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::SeqFeature::AnnotationAdaptor \- integrates SeqFeatureIs annotation .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Bio::SeqFeature::Generic; \& use Bio::SeqFeature::AnnotationAdaptor; \& \& # obtain a SeqFeatureI implementing object somehow \& my $feat = Bio::SeqFeature::Generic\->new(\-start => 10, \-end => 20); \& \& # add tag/value annotation \& $feat\->add_tag_value("mytag", "value of tag mytag"); \& $feat\->add_tag_value("mytag", "another value of tag mytag"); \& \& # Bio::SeqFeature::Generic also provides annotation(), which returns a \& # Bio::AnnotationCollectionI compliant object \& $feat\->annotation\->add_Annotation("dbxref", $dblink); \& \& # to integrate tag/value annotation with AnnotationCollectionI \& # annotation, use this adaptor, which also implements \& # Bio::AnnotationCollectionI \& my $anncoll = Bio::SeqFeature::AnnotationAdaptor\->new(\-feature => $feat); \& \& # this will now return tag/value pairs as \& # Bio::Annotation::SimpleValue objects \& my @anns = $anncoll\->get_Annotations("mytag"); \& # other added before annotation is available too \& my @dblinks = $anncoll\->get_Annotations("dbxref"); \& \& # also supports transparent adding of tag/value pairs in \& # Bio::AnnotationI flavor \& my $tagval = Bio::Annotation::SimpleValue\->new(\-value => "some value", \& \-tagname => "some tag"); \& $anncoll\->add_Annotation($tagval); \& # this is now also available from the feature\*(Aqs tag/value system \& my @vals = $feat\->get_tag_values("some tag"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Bio::SeqFeatureI defines light-weight annotation of features through tag/value pairs. Conversely, Bio::AnnotationCollectionI together with Bio::AnnotationI defines an annotation bag, which is better typed, but more heavy-weight because it contains every single piece of annotation as objects. The frequently used base implementation of Bio::SeqFeatureI, Bio::SeqFeature::Generic, defines an additional slot for AnnotationCollectionI-compliant annotation. .PP This adaptor provides a Bio::AnnotationCollectionI compliant, unified, and integrated view on the annotation of Bio::SeqFeatureI objects, including tag/value pairs, and annotation through the \&\fBannotation()\fR method, if the object supports it. Code using this adaptor does not need to worry about the different ways of possibly annotating a SeqFeatureI object, but can instead assume that it strictly follows the AnnotationCollectionI scheme. The price to pay is that retrieving and adding annotation will always use objects instead of light-weight tag/value pairs. .PP In other words, this adaptor allows us to keep the best of both worlds. If you create tens of thousands of feature objects, and your only annotation is tag/value pairs, you are best off using the features' native tag/value system. If you create a smaller number of features, but with rich and typed annotation mixed with tag/value pairs, this adaptor may be for you. Since its implementation is by double-composition, you only need to create one instance of the adaptor. In order to transparently annotate a feature object, set the feature using the \fBfeature()\fR method. Every annotation you add will be added to the feature object, and hence will not be lost when you set \&\fBfeature()\fR to the next object. .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 the Bioperl mailing list. 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 of 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 \- Hilmar Lapp" .IX Header "AUTHOR - Hilmar Lapp" Email hlapp at gmx.net .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 10 \& Title : new \& Usage : my $obj = Bio::SeqFeature::AnnotationAdaptor\->new(); \& Function: Builds a new Bio::SeqFeature::AnnotationAdaptor object \& Returns : an instance of Bio::SeqFeature::AnnotationAdaptor \& Args : Named parameters \& \-feature the Bio::SeqFeatureI implementing object to adapt \& (mandatory to be passed here, or set via feature() \& before calling other methods) \& \-annotation the Bio::AnnotationCollectionI implementing object \& for storing richer annotation (this will default to \& the $feature\->annotation() if it supports it) \& \-tagvalue_factory the object factory to use for creating tag/value \& pair representing objects .Ve .SS "feature" .IX Subsection "feature" .Vb 7 \& Title : feature \& Usage : $obj\->feature($newval) \& Function: Get/set the feature that this object adapts to an \& AnnotationCollectionI. \& Example : \& Returns : value of feature (a Bio::SeqFeatureI compliant object) \& Args : new value (a Bio::SeqFeatureI compliant object, optional) .Ve .SS "annotation" .IX Subsection "annotation" .Vb 5 \& Title : annotation \& Usage : $obj\->annotation($newval) \& Function: Get/set the AnnotationCollectionI implementing object used by \& this adaptor to store additional annotation that cannot be stored \& by the SeqFeatureI itself. \& \& If requested before having been set, the value will default to the \& annotation object of the feature if it has one. \& Example : \& Returns : value of annotation (a Bio::AnnotationCollectionI compliant object) \& Args : new value (a Bio::AnnotationCollectionI compliant object, optional) .Ve .SH "AnnotationCollectionI implementing methods" .IX Header "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 5 \& Title : get_Annotations \& Usage : my @annotations = $collection\->get_Annotations(\*(Aqkey\*(Aq) \& Function: Retrieves all the Bio::AnnotationI objects for a specific key \& Returns : list of Bio::AnnotationI \- empty if no objects stored for a key \& Args : string which is key for annotations .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 \- to allow adding" .IX Header "Implementation specific functions - to allow 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. \& \& This implementation will add all Bio::Annotation::SimpleValue \& objects to the adapted features as tag/value pairs. Caveat: this \& may potentially result in information loss if a derived object \& is supplied. \& \& 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 4 \& Title : remove_Annotations \& Usage : \& Function: Remove the annotations for the specified key from this \& collection. \& \& If the key happens to be a tag, then the tag is removed \& from the feature. \& \& 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 .SH "Additional methods" .IX Header "Additional methods" .SS "tagvalue_object_factory" .IX Subsection "tagvalue_object_factory" .Vb 5 \& Title : tagvalue_object_factory \& Usage : $obj\->tagval_object_factory($newval) \& Function: Get/set the object factory to use for creating objects that \& represent tag/value pairs (e.g., \& Bio::Annotation::SimpleValue). \& \& The object to be created is expected to follow \& Bio::Annotation::SimpleValue in terms of supported \& arguments at creation time, and the methods. \& \& Example : \& Returns : A Bio::Factory::ObjectFactoryI compliant object \& Args : new value (a Bio::Factory::ObjectFactoryI compliant object, \& optional) .Ve