Bio SeqI
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
Bio::SeqI - Abstract Interface of Sequence (with features)
Package variables
No package variables defined.
Included modules
Bio::PrimarySeqI
Carp
Inherit
Bio::PrimarySeqI
Synopsis
    # get a Bio::SeqI somehow, eg, via SeqIO. See SeqIO info
    # for more information

    $seqio  = Bio::SeqIO->new ( '-format' => 'Fasta' , -file => 'myfile.fasta');
    $seqobj = $seqio->next_seq();

    # features must implement Bio::SeqFeatureI

    @features = $seqobj->top_SeqFeatures(); # just top level
    @features = $seqobj->all_SeqFeatures(); # descend into sub features

    $seq      = $seqobj->seq(); # actual sequence as a string
    $seqstr   = $seqobj->subseq(10,50);    
    $ann      = $seqobj->annotation(); # annotation object
Description
SeqI is the abstract interface of annotated Sequence. These methods
are those which you can be guarenteed to get for any annseq. There aren't
many here, because too many complicated functions here prevent implementations
which are just wrappers around a database or similar delayed mechanisms.
Most of the clever stuff happens inside the SeqFeatureI system.
A good reference implementation is Bio::Seq which is a pure perl
implementation of this class with alot of extra pieces for extra
manipulation. However, if you want to be able to use any sequence
object in your analysis, if you can do it just using these methods,
then you know you will be future proof and compatible with other
implementations of Seq.
Methods
top_SeqFeaturesDescriptionCode
all_SeqFeaturesDescriptionCode
seqDescriptionCode
write_GFFDescriptionCode
annotationDescriptionCode
feature_countDescriptionCode
speciesDescriptionCode
primary_seqDescriptionCode
Methods description
top_SeqFeaturescode    nextTop
 Title   : top_SeqFeatures
 Usage   : my @features = $seq->top_SeqFeatures();
 Function: (may be deprecated in the future)
 Returns : An array of top level sequence features, 
           features which contain features are NOT flattened
 Args    : none
all_SeqFeaturescodeprevnextTop
 Title   : all_SeqFeatures
 Usage   : @features = $annseq->all_SeqFeatures()
 Function: returns all SeqFeatures, included sub SeqFeatures
 Returns : an array
 Args    : none
seqcodeprevnextTop
 Title   : seq
 Usage   : my $sequence  = $seq->seq();
 Function: Get/Set the sequence as a string
 Returns : string
 Args    : (optional) sequence string to set 
           (if permitted by the implementation)
write_GFFcodeprevnextTop
 Title   : write_GFF
 Usage   : $seq->write_GFF(\*OUTPUTHANDLE);
 Function: Utility methods which creates GFF output
 Returns : none
 Args    : (optional) filehandle to write to (default is STDOUT)
annotationcodeprevnextTop
 Title   : annotation
 Usage   : $obj->annotation($seq_obj)
 Function: Get/Set Annotation object associated with the sequence.  
           This is where features with no explicit location are aggregated. 
 Returns : Bio::AnnotationCollectionI object
 Args    : None or Bio::Annotation object
See Bio::AnnotationCollectionI and Bio::Annotation::Collection
for more information
feature_countcodeprevnextTop
 Title   : feature_count
 Usage   : $seq->feature_count()
 Function: Return the number of SeqFeatures attached to a sequence
 Returns : number of SeqFeatures
 Args    : none
speciescodeprevnextTop
 Title   : species
 Usage   : $species = $self->species();
 Function: Gets or sets the species
 Returns : Bio::Species object
 Args    : Bio::Species object or none;
primary_seqcodeprevnextTop
 Title   : primary_seq
 Usage   : $obj->primary_seq($newval)
 Function: Get/Set the underlying primary sequence for a SeqI.
           This cannot always be assumed some implementations
           may not provide a primary sequence underneath.
 Returns : value of primary_seq
 Args    : newvalue (optional)
Methods code
top_SeqFeaturesdescriptionprevnextTop
sub top_SeqFeatures {
   my ($self) = @_;
   $self->throw_not_implemented;
}
all_SeqFeaturesdescriptionprevnextTop
sub all_SeqFeatures {
   my ($self) = @_;
   $self->throw_not_implemented();
}
seqdescriptionprevnextTop
sub seq {
   my ($self) = @_;
   $self->throw_not_implemented();
}
write_GFFdescriptionprevnextTop
sub write_GFF {
   my ($self,$fh) = @_;

   $fh || do { $fh =\* STDOUT; };

   foreach my $sf ( $self->all_SeqFeatures() ) {
       print $fh $sf->gff_string, "\n";
   }
}
annotationdescriptionprevnextTop
sub annotation {
   my ($obj) = @_;
   $obj->throw_not_implemented();
}
feature_countdescriptionprevnextTop
sub feature_count {
    my ($obj) = @_;
    $obj->throw_not_implemented();
}
speciesdescriptionprevnextTop
sub species {
    my ($self) = @_;
    $self->throw_not_implemented();
}
primary_seqdescriptionprevnextTop
sub primary_seq {
    my ($self) = @_;
    $self->throw_not_implemented;
}
General documentation
FEEDBACKTop
Mailing ListsTop
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/
AUTHOR - Ewan BirneyTop
Email birney@sanger.ac.uk
APPENDIXTop
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _