.\" 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::SeqFeatureI 3pm" .TH Bio::SeqFeatureI 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::SeqFeatureI \- Abstract interface of a Sequence Feature .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # get a seqfeature somehow, eg, from a Sequence with Features attached \& \& foreach $feat ( $seq\->get_SeqFeatures() ) { \& print "Feature from ", $feat\->start, "to ", \& $feat\->end, " Primary tag ", $feat\->primary_tag, \& ", produced by ", $feat\->source_tag(), "\en"; \& \& if ( $feat\->strand == 0 ) { \& print "Feature applicable to either strand\en"; \& } \& else { \& print "Feature on strand ", $feat\->strand,"\en"; # \-1,1 \& } \& \& print "feature location is ",$feat\->start, "..", \& $feat\->end, " on strand ", $feat\->strand, "\en"; \& print "easy utility to print locations in GenBank/EMBL way ", \& $feat\->location\->to_FTstring(), "\en"; \& \& foreach $tag ( $feat\->get_all_tags() ) { \& print "Feature has tag ", $tag, " with values, ", \& join(\*(Aq \*(Aq,$feat\->get_tag_values($tag)), "\en"; \& } \& print "new feature\en" if $feat\->has_tag(\*(Aqnew\*(Aq); \& # features can have sub features \& my @subfeat = $feat\->get_SeqFeatures(); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This interface is the functions one can expect for any Sequence Feature, whatever its implementation or whether it is a more complex type (eg, a Gene). This object does not actually provide any implementation, it just provides the definitions of what methods one can call. See Bio::SeqFeature::Generic for a good standard implementation of this object .SH "FEEDBACK" .IX Header "FEEDBACK" 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 "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SH "Bio::SeqFeatureI specific methods" .IX Header "Bio::SeqFeatureI specific methods" New method interfaces. .SS "get_SeqFeatures" .IX Subsection "get_SeqFeatures" .Vb 5 \& Title : get_SeqFeatures \& Usage : @feats = $feat\->get_SeqFeatures(); \& Function: Returns an array of sub Sequence Features \& Returns : An array \& Args : none .Ve .SS "display_name" .IX Subsection "display_name" .Vb 5 \& Title : display_name \& Usage : $name = $feat\->display_name() \& Function: Returns the human\-readable name of the feature for displays. \& Returns : a string \& Args : none .Ve .SS "primary_tag" .IX Subsection "primary_tag" .Vb 6 \& Title : primary_tag \& Usage : $tag = $feat\->primary_tag() \& Function: Returns the primary tag for a feature, \& eg \*(Aqexon\*(Aq \& Returns : a string \& Args : none .Ve .SS "source_tag" .IX Subsection "source_tag" .Vb 6 \& Title : source_tag \& Usage : $tag = $feat\->source_tag() \& Function: Returns the source tag for a feature, \& eg, \*(Aqgenscan\*(Aq \& Returns : a string \& Args : none .Ve .SS "has_tag" .IX Subsection "has_tag" .Vb 5 \& Title : has_tag \& Usage : $tag_exists = $self\->has_tag(\*(Aqsome_tag\*(Aq) \& Function: \& Returns : TRUE if the specified tag exists, and FALSE otherwise \& Args : .Ve .SS "get_tag_values" .IX Subsection "get_tag_values" .Vb 5 \& Title : get_tag_values \& Usage : @values = $self\->get_tag_values(\*(Aqsome_tag\*(Aq) \& Function: \& Returns : An array comprising the values of the specified tag. \& Args : a string .Ve .PP throws an exception if there is no such tag .SS "get_tagset_values" .IX Subsection "get_tagset_values" .Vb 5 \& Title : get_tagset_values \& Usage : @values = $self\->get_tagset_values(qw(label transcript_id product)) \& Function: \& Returns : An array comprising the values of the specified tags, in order of tags \& Args : An array of strings .Ve .PP does \s-1NOT\s0 throw an exception if none of the tags are not present .PP this method is useful for getting a human-readable label for a SeqFeatureI; not all tags can be assumed to be present, so a list of possible tags in preferential order is provided .SS "get_all_tags" .IX Subsection "get_all_tags" .Vb 5 \& Title : get_all_tags \& Usage : @tags = $feat\->get_all_tags() \& Function: gives all tags for this feature \& Returns : an array of strings \& Args : none .Ve .SS "attach_seq" .IX Subsection "attach_seq" .Vb 5 \& Title : attach_seq \& Usage : $sf\->attach_seq($seq) \& Function: Attaches a Bio::Seq object to this feature. This \& Bio::Seq object is for the *entire* sequence: ie \& from 1 to 10000 \& \& Note that it is not guaranteed that if you obtain a feature from \& an object in bioperl, it will have a sequence attached. Also, \& implementors of this interface can choose to provide an empty \& implementation of this method. I.e., there is also no guarantee \& that if you do attach a sequence, seq() or entire_seq() will not \& return undef. \& \& The reason that this method is here on the interface is to enable \& you to call it on every SeqFeatureI compliant object, and \& that it will be implemented in a useful way and set to a useful \& value for the great majority of use cases. Implementors who choose \& to ignore the call are encouraged to specifically state this in \& their documentation. \& \& Example : \& Returns : TRUE on success \& Args : a Bio::PrimarySeqI compliant object .Ve .SS "seq" .IX Subsection "seq" .Vb 10 \& Title : seq \& Usage : $tseq = $sf\->seq() \& Function: returns the truncated sequence (if there is a sequence attached) \& for this feature \& Example : \& Returns : sub seq (a Bio::PrimarySeqI compliant object) on attached sequence \& bounded by start & end, or undef if there is no sequence attached. \& If the strand is defined and set to \-1, the returned sequence is \& the reverse\-complement of the region \& Args : none .Ve .SS "entire_seq" .IX Subsection "entire_seq" .Vb 7 \& Title : entire_seq \& Usage : $whole_seq = $sf\->entire_seq() \& Function: gives the entire sequence that this seqfeature is attached to \& Example : \& Returns : a Bio::PrimarySeqI compliant object, or undef if there is no \& sequence attached \& Args : none .Ve .SS "seq_id" .IX Subsection "seq_id" .Vb 6 \& Title : seq_id \& Usage : $obj\->seq_id($newval) \& Function: There are many cases when you make a feature that you \& do know the sequence name, but do not know its actual \& sequence. This is an attribute such that you can store \& the ID (e.g., display_id) of the sequence. \& \& This attribute should *not* be used in GFF dumping, as \& that should come from the collection in which the seq \& feature was found. \& Returns : value of seq_id \& Args : newvalue (optional) .Ve .SS "gff_string" .IX Subsection "gff_string" .Vb 4 \& Title : gff_string \& Usage : $str = $feat\->gff_string; \& $str = $feat\->gff_string($gff_formatter); \& Function: Provides the feature information in GFF format. \& \& The implementation provided here returns GFF2 by default. If you \& want a different version, supply an object implementing a method \& gff_string() accepting a SeqFeatureI object as argument. E.g., to \& obtain GFF1 format, do the following: \& \& my $gffio = Bio::Tools::GFF\->new(\-gff_version => 1); \& $gff1str = $feat\->gff_string($gff1io); \& \& Returns : A string \& Args : Optionally, an object implementing gff_string(). .Ve .SS "_static_gff_formatter" .IX Subsection "_static_gff_formatter" .Vb 6 \& Title : _static_gff_formatter \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SH "Decorating methods" .IX Header "Decorating methods" These methods have an implementation provided by Bio::SeqFeatureI, but can be validly overwritten by subclasses .SS "spliced_seq" .IX Subsection "spliced_seq" .Vb 1 \& Title : spliced_seq \& \& Usage : $seq = $feature\->spliced_seq() \& $seq = $feature_with_remote_locations\->spliced_seq($db_for_seqs) \& \& Function: Provides a sequence of the feature which is the most \& semantically "relevant" feature for this sequence. A default \& implementation is provided which for simple cases returns just \& the sequence, but for split cases, loops over the split location \& to return the sequence. In the case of split locations with \& remote locations, eg \& \& join(AB000123:5567\-5589,80..1144) \& \& in the case when a database object is passed in, it will attempt \& to retrieve the sequence from the database object, and "Do the right thing", \& however if no database object is provided, it will generate the correct \& number of N\*(Aqs (DNA) or X\*(Aqs (protein, though this is unlikely). \& \& This function is deliberately "magical" attempting to second guess \& what a user wants as "the" sequence for this feature. \& \& Implementing classes are free to override this method with their \& own magic if they have a better idea what the user wants. \& \& Args : [optional] \& \-db A L compliant object if \& one needs to retrieve remote seqs. \& \-nosort boolean if the locations should not be sorted \& by start location. This may occur, for instance, \& in a circular sequence where a gene span starts \& before the end of the sequence and ends after the \& sequence start. Example : join(15685..16260,1..207) \& (default = if sequence is_circular(), 1, otherwise 0) \& \-phase truncates the returned sequence based on the \& intron phase (0,1,2). \& \& Returns : A L object .Ve .SS "location" .IX Subsection "location" .Vb 6 \& Title : location \& Usage : my $location = $seqfeature\->location() \& Function: returns a location object suitable for identifying location \& of feature on sequence or parent feature \& Returns : Bio::LocationI object \& Args : none .Ve .SS "primary_id" .IX Subsection "primary_id" .Vb 6 \& Title : primary_id \& Usage : $obj\->primary_id($newval) \& Function: \& Example : \& Returns : value of primary_id (a scalar) \& Args : on set, new value (a scalar or undef, optional) .Ve .PP Primary \s-1ID\s0 is a synonym for the tag '\s-1ID\s0' .SS "phase" .IX Subsection "phase" .Vb 7 \& Title : phase \& Usage : $obj\->phase($newval) \& Function: get/set this feature\*(Aqs phase. \& Example : \& Returns : undef if no phase is set, \& otherwise 0, 1, or 2 (the only valid values for phase) \& Args : on set, the new value .Ve .PP Most features do not have or need a defined phase. .PP For features representing a \s-1CDS,\s0 the phase indicates where the feature begins with reference to the reading frame. The phase is one of the integers 0, 1, or 2, indicating the number of bases that should be removed from the beginning of this feature to reach the first base of the next codon. In other words, a phase of \*(L"0\*(R" indicates that the next codon begins at the first base of the region described by the current line, a phase of \*(L"1\*(R" indicates that the next codon begins at the second base of this region, and a phase of \*(L"2\*(R" indicates that the codon begins at the third base of this region. This is \s-1NOT\s0 to be confused with the frame, which is simply start modulo 3. .PP For forward strand features, phase is counted from the start field. For reverse strand features, phase is counted from the end field. .SH "Bio::RangeI methods" .IX Header "Bio::RangeI methods" These methods are inherited from RangeI and can be used directly from a SeqFeatureI interface. Remember that a SeqFeature is-a RangeI, and so wherever you see RangeI you can use a feature ($r in the below documentation). .SS "\fBstart()\fP" .IX Subsection "start()" .Vb 1 \& See L .Ve .SS "\fBend()\fP" .IX Subsection "end()" .Vb 1 \& See L .Ve .SS "\fBstrand()\fP" .IX Subsection "strand()" .Vb 1 \& See L .Ve .SS "\fBoverlaps()\fP" .IX Subsection "overlaps()" .Vb 1 \& See L .Ve .SS "\fBcontains()\fP" .IX Subsection "contains()" .Vb 1 \& See L .Ve .SS "\fBequals()\fP" .IX Subsection "equals()" .Vb 1 \& See L .Ve .SS "\fBintersection()\fP" .IX Subsection "intersection()" .Vb 1 \& See L .Ve .SS "\fBunion()\fP" .IX Subsection "union()" .Vb 1 \& See L .Ve