Bio LocatableSeq
Other packages in the module: Bio::Search::Tiling::MapTileUtils Bio::Search::HSP::HSPI
Package variablesGeneral documentationMethods
Toolbar
WebCvs
Package variables
No package variables defined.
Synopsis
No synopsis!
Description
No description!
Methods
get_SeqFeaturesDescriptionCode
feature_countDescriptionCode
add_SeqFeatureDescriptionCode
remove_SeqFeaturesDescriptionCode
Methods description
get_SeqFeaturescode    nextTop
 Title   : get_SeqFeatures
Usage :
Function: Get the feature objects held by this feature holder.
Features which are not top-level are subfeatures of one or more of the returned feature objects, which means that you must traverse the subfeature arrays of each top-level feature object in order to traverse all features associated with this sequence. Top-level features can be obtained by tag, specified in the argument. Use get_all_SeqFeatures() if you want the feature tree flattened into one single array. Example : Returns : an array of Bio::SeqFeatureI implementing objects Args : [optional] scalar string (feature tag)
feature_countcodeprevnextTop
 Title   : feature_count
Usage : $seq->feature_count()
Function: Return the number of SeqFeatures attached to a sequence
Returns : integer representing the number of SeqFeatures
Args : None
add_SeqFeaturecodeprevnextTop
 Title   : add_SeqFeature
Usage : $seq->add_SeqFeature($feat);
$seq->add_SeqFeature(@feat);
Function: Adds the given feature object (or each of an array of feature
objects to the feature array of this
sequence. The object passed is required to implement the
Bio::SeqFeatureI interface.
Returns : 1 on success
Args : A Bio::SeqFeatureI implementing object, or an array of such objects.
remove_SeqFeaturescodeprevnextTop
 Title   : remove_SeqFeatures
Usage : $seq->remove_SeqFeatures();
Function: Flushes all attached SeqFeatureI objects.
To remove individual feature objects, delete those from the returned array and re-add the rest. Example : Returns : The array of Bio::SeqFeatureI objects removed from this seq. Args : None
Methods code
get_SeqFeaturesdescriptionprevnextTop
sub get_SeqFeatures {
   my $self = shift;
   my $tag = shift;

   if( !defined $self->{'_as_feat'} ) {
       $self->{'_as_feat'} = [];
   }
   if ($tag) {
       return map { $_->primary_tag eq $tag ? $_ : () } @{$self->{'_as_feat'}};
   }
   else {
       return @{$self->{'_as_feat'}};
   }
}
feature_countdescriptionprevnextTop
sub feature_count {
    my ($self) = @_;
    if (defined($self->{'_as_feat'})) {
	return ($#{$self->{'_as_feat'}} + 1);
    } else {
	return 0;
    }
}
add_SeqFeaturedescriptionprevnextTop
sub add_SeqFeature {
   my ($self,@feat) = @_;
   $self->{'_as_feat'} = [] unless $self->{'_as_feat'};
   foreach my $feat ( @feat ) {
       if( !$feat->isa("Bio::SeqFeatureI") ) {
	   $self->throw("$feat is not a SeqFeatureI and that's what we expect...");
       }
       $feat->attach_seq($self);
       push(@{$self->{'_as_feat'}},$feat);
   }
   return 1;
}
remove_SeqFeaturesdescriptionprevnextTop
sub remove_SeqFeatures {
    my $self = shift;

    return () unless $self->{'_as_feat'};
    my @feats = @{$self->{'_as_feat'}};
    $self->{'_as_feat'} = [];
    return @feats;
}

1;
}
General documentation
No general documentation available.