Bio SeqFeatureI
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
Bio::SeqFeatureI - Abstract interface of a Sequence Feature
Package variables
Privates (from "my" definitions)
$static_gff_formatter = undef
Included modules
Bio::RangeI
Carp
Inherit
Bio::RangeI
Synopsis
    # get a seqfeature somehow, eg,

    foreach $feat ( $annseq->all_SeqFeatures() ) {
            print "Feature from ", $feat->start, "to ", 
	          $feat->end, " Primary tag  ", $feat->primary_tag, 
	          ", produced by ", $feat->source_tag(), "\n";

            if( $feat->strand == 0 ) {
		print "Feature applicable to either strand\n";
            } else {
                print "Feature on strand ", $feat->strand,"\n"; # -1,1
            }

            foreach $tag ( $feat->all_tags() ) {
		print "Feature has tag ", $tag, "with values, ",
		      join(' ',$feat->each_tag_value($tag)), "\n";
            }
	    print "new feature\n" if $feat->has_tag('new');
	    # features can have sub features
	    my @subfeat = $feat->sub_SeqFeature();
	}
Description
This interface is the functions one can expect for any Sequence
Feature, whatever its implemtation or whether it is a more complex
type (eg, a Gene). This object doesn\'t actually provide any
implemention, it just provides the definitions of what methods one can
call. See Bio::SeqFeature::Generic for a good standard implementation
of this object
Methods
sub_SeqFeatureDescriptionCode
primary_tagDescriptionCode
source_tagDescriptionCode
has_tagDescriptionCode
each_tag_valueDescriptionCode
all_tagsDescriptionCode
gff_stringDescriptionCode
_static_gff_formatterDescriptionCode
locationDescriptionCode
Methods description
sub_SeqFeaturecode    nextTop
 Title   : sub_SeqFeature
 Usage   : @feats = $feat->sub_SeqFeature();
 Function: Returns an array of sub Sequence Features
 Returns : An array
 Args    : none
primary_tagcodeprevnextTop
 Title   : primary_tag
 Usage   : $tag = $feat->primary_tag()
 Function: Returns the primary tag for a feature,
           eg 'exon'
 Returns : a string 
 Args    : none
source_tagcodeprevnextTop
 Title   : source_tag
 Usage   : $tag = $feat->source_tag()
 Function: Returns the source tag for a feature,
           eg, 'genscan' 
 Returns : a string 
 Args    : none
has_tagcodeprevnextTop
 Title   : has_tag
 Usage   : $tag_exists = $self->has_tag('some_tag')
 Function: 
 Returns : TRUE if the specified tag exists, and FALSE otherwise
 Args    :
each_tag_valuecodeprevnextTop
 Title   : each_tag_value
 Usage   : @values = $self->each_tag_value('some_tag')
 Function: 
 Returns : An array comprising the values of the specified tag.
 Args    :
all_tagscodeprevnextTop
 Title   : all_tags
 Usage   : @tags = $feat->all_tags()
 Function: gives all tags for this feature
 Returns : an array of strings
 Args    : none
gff_stringcodeprevnextTop
 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().
_static_gff_formattercodeprevnextTop
 Title   : _static_gff_formatter
 Usage   :
 Function:
 Example :
 Returns : 
 Args    :
locationcodeprevnextTop
 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
Methods code
sub_SeqFeaturedescriptionprevnextTop
sub sub_SeqFeature {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
primary_tagdescriptionprevnextTop
sub primary_tag {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
source_tagdescriptionprevnextTop
sub source_tag {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
has_tagdescriptionprevnextTop
sub has_tag {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
each_tag_valuedescriptionprevnextTop
sub each_tag_value {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
all_tagsdescriptionprevnextTop
sub all_tags {
   my ($self,@args) = @_;

   $self->throw_not_implemented();
}
gff_stringdescriptionprevnextTop
sub gff_string {
   my ($self,$formatter) = @_;

   $formatter = $self->_static_gff_formatter unless $formatter;
   return $formatter->gff_string($self);
}
_static_gff_formatterdescriptionprevnextTop
sub _static_gff_formatter {
   my ($self,@args) = @_;

   if( !defined $static_gff_formatter ) {
       $static_gff_formatter = Bio::Tools::GFF->new('-gff_version' => 2);
   }
   return $static_gff_formatter;
}
locationdescriptionprevnextTop
sub location {
   my ($self) = @_;

   $self->throw_not_implemented();
}
General documentation
FEEDBACKTop
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.
  bioperl-l@bioperl.org          - General discussion
  http://bio.perl.org/MailList.html             - About the mailing lists
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via email
or the web:
  bioperl-bugs@bio.perl.org
  http://bio.perl.org/bioperl-bugs/
APPENDIXTop
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _
Bio::RangeI methodsTop
List of interfaces inherited from Bio::RangeI.
startTop
 Title   : start
 Usage   : $start = $feat->start
 Function: Returns the start coordinate of the feature
 Returns : integer
 Args    : none
endTop
 Title   : end
 Usage   : $end = $feat->end
 Function: Returns the end coordinate of the feature
 Returns : integer
 Args    : none
strandTop
 Title   : strand
 Usage   : $strand = $feat->strand()
 Function: Returns strand information, being 1,-1 or 0
 Returns : -1,1 or 0
 Args    : none
SeqFeatureI specific methodsTop
New method interfaces.
RangeI methodsTop
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).
overlapsTop
  Title   : overlaps
  Usage   : if($feat->overlaps($r)) { do stuff }
            if($feat->overlaps(200)) { do stuff }
  Function: tests if $feat overlaps $r
  Args    : a RangeI to test for overlap with, or a point
  Returns : true if the Range overlaps with the feature, false otherwise
containsTop
  Title   : contains
  Usage   : if($feat->contains($r) { do stuff }
  Function: tests whether $feat totally contains $r
  Args    : a RangeI to test for being contained
  Returns : true if the argument is totaly contained within this range
equalsTop
  Title   : equals
  Usage   : if($feat->equals($r))
  Function: test whether $feat has the same start, end, strand as $r
  Args    : a RangeI to test for equality
  Returns : true if they are describing the same range
Geometrical methodsTop
These methods do things to the geometry of ranges, and return
triplets (start, stop, strand) from which new ranges could be built.
intersectionTop
  Title   : intersection
  Usage   : ($start, $stop, $strand) = $feat->intersection($r)
  Function: gives the range that is contained by both ranges
  Args    : a RangeI to compare this one to
  Returns : nothing if they do not overlap, or the range that they do overlap
unionTop
  Title   : union
  Usage   : ($start, $stop, $strand) = $feat->union($r);
          : ($start, $stop, $strand) = Bio::RangeI->union(@ranges);
  Function: finds the minimal range that contains all of the ranges
  Args    : a range or list of ranges to find the union of
  Returns : the range containing all of the ranges