LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

CONTACT

Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.

NAME

Bio::EnsEMBL::SeqFeature - Ensembl specific sequence feature.

DESCRIPTION

Do not use this module if you can avoid it. It has been replaced by Bio::EnsEMBL::Feature. This module has a long history of usage but has become very bloated, and quite unweildy. It was decided to replace it completely with a smaller, light-weight feature class rather than attempting to refactor this class, and maintain strict backwards compatibility.

Part of the complexity of this class was in its extensive inheritance. As an example the following is a simplified inheritance heirarchy that was present for Bio::EnsEMBL::DnaAlignFeature:

Bio::EnsEMBL::DnaAlignFeature
Bio::EnsEMBL::BaseAlignFeature
Bio::EnsEMBL::FeaturePair
Bio::EnsEMBL::SeqFeature
Bio::SeqFeatureI
Bio::RangeI
Bio::Root::RootI

The new Bio::EnsEMBL::Feature class is much shorter, and hopefully much easier to understand and maintain.

METHODS

start

Title   : start
Usage   : $start = $feat->start
          $feat->start(20)
Function: Get/set on the start coordinate of the feature
Returns : integer
Args    : none

end

Title   : end
Usage   : $end = $feat->end
          $feat->end($end)
Function: get/set on the end coordinate of the feature
Returns : integer
Args    : none

length

Title   : length
Usage   :
Function:
Example :
Returns :
Args    :

strand

Title   : strand
Usage   : $strand = $feat->strand()
          $feat->strand($strand)
Function: get/set on strand information, being 1,-1 or 0
Returns : -1,1 or 0
Args    : none

move

Arg [1]    : int $start
Arg [2]    : int $end
Arg [3]    : (optional) int $strand 
Example    : $feature->move(100, 200, -1);
Description: Moves a feature to a different location.  This is faster
             then calling 3 seperate accesors in a large loop.
Returntype : none
Exceptions : none
Caller     : BaseFeatureAdaptor

score

Title   : score
Usage   : $score = $feat->score()
          $feat->score($score)
Function: get/set on score information
Returns : float
Args    : none if get, the new value if set

frame

Title   : frame
Usage   : $frame = $feat->frame()
          $feat->frame($frame)
Function: get/set on frame information
Returns : 0,1,2
Args    : none if get, the new value if set

primary_tag

Title   : primary_tag
Usage   : $tag = $feat->primary_tag()
          $feat->primary_tag('exon')
Function: get/set on the primary tag for a feature,
          eg 'exon'
Returns : a string
Args    : none

source_tag

Title   : source_tag
Usage   : $tag = $feat->source_tag()
          $feat->source_tag('genscan');
Function: Returns the source tag for a feature,
          eg, 'genscan'
Returns : a string
Args    : none

analysis

Title   : analysis
Usage   : $sf->analysis();
Function: Store details of the program/database
          and versions used to create this feature.

Example :
Returns :
Args    :

validate

Title   : validate
Usage   : $sf->validate;
Function: Checks whether all the data is present in the
          object.
Example :
Returns :
Args    :

validate_prot_feature

Title   : validate_prot_feature
Usage   :
Function:
Example :
Returns :
Args    :

has_tag

Title   : has_tag
Usage   : $value = $self->has_tag('some_tag')
Function: Returns the value of the tag (undef if
          none)
Returns :
Args    :

add_tag_value

Title   : add_tag_value
Usage   : $self->add_tag_value('note',"this is a note");
Returns : nothing
Args    : tag (string) and value (any scalar)

each_tag_value

Title   : each_tag_value
Usage   :
Function:
Example :
Returns :
Args    :

all_tags

Title   : all_tags
Usage   : @tags = $feat->all_tags()
Function: gives all tags for this feature
Returns : an array of strings
Args    : none

seqname

Arg [1]    : string $seqname
Example    : $seqname = $self->seqname();
Description: Obtains the seqname of this features sequence.  This is set
             automatically when a sequence with a name is attached, or may
             be set manually.
Returntype : string
Exceptions : none
Caller     : general, attach_seq

attach_seq

Title   : attach_seq
Usage   : $sf->attach_seq($seq)
Function: Attaches a Bio::PrimarySeqI object to this feature. This
          Bio::PrimarySeqI object is for the *entire* sequence: ie
          from 1 to 10000
Example :
Returns :
Args    :

seq

Example : $tseq = $sf->seq()
Function: returns the sequence (if any ) for this feature truncated to the range spanning the feature
Returns : a Bio::PrimarySeq object (I reckon)

entire_seq

Title   : entire_seq
Usage   : $whole_seq = $sf->entire_seq()
Function: gives the entire sequence that this seqfeature is attached to
Example :
Returns :
Args    :

sub_SeqFeature

Title   : sub_SeqFeature
Usage   : @feats = $feat->sub_SeqFeature();
Function: Returns an array of sub Sequence Features
Returns : An array
Args    : none

add_sub_SeqFeature

Title   : add_sub_SeqFeature
Usage   : $feat->add_sub_SeqFeature($subfeat);
          $feat->add_sub_SeqFeature($subfeat,'EXPAND')
Function: adds a SeqFeature into the subSeqFeature array.
          with no 'EXPAND' qualifer, subfeat will be tested
          as to whether it lies inside the parent, and throw
          an exception if not.

          If EXPAND is used, the parents start/end/strand will
          be adjusted so that it grows to accommodate the new
          subFeature
Returns : nothing
Args    : An object which has the SeqFeatureI interface

flush_sub_SeqFeature

Title   : flush_sub_SeqFeature
Usage   : $sf->flush_sub_SeqFeature
Function: Removes all sub SeqFeature
          (if you want to remove only a subset, take
           an array of them all, flush them, and add
           back only the guys you want)
Example :
Returns : none
Args    : none

percent_id

Title   : percent_id
Usage   : $pid = $feat->percent_id()
          $feat->percent_id($pid)
Function: get/set on percentage identity information
Returns : float
Args    : none if get, the new value if set

p_value

Title   : p_value
Usage   : $p_val = $feat->p_value()
          $feat->p_value($p_val)
Function: get/set on p value information
Returns : float
Args    : none if get, the new value if set

phase

Title   : phase
Usage   : $phase = $feat->phase()
          $feat->phase($phase)
Function: get/set on start phase of predicted exon feature
Returns : [0,1,2]
Args    : none if get, 0,1 or 2 if set.

end_phase

Title   : end_phase
Usage   : $end_phase = $feat->end_phase()
          $feat->end_phase($end_phase)
Function: returns end_phase based on phase and length of feature
Returns : [0,1,2]
Args    : none if get, 0,1 or 2 if set.

external_db

Title   : external_db
Usage   : $pid = $feat->external_db()
          $feat->external_db($dbid)
Function: get/set for an external db accession number (e.g.: Interpro)
Returns :
Args    : none if get, the new value if set

contig

Arg [1]    : Bio::PrimarySeqI $seq
Example    : $seq = $self->contig;
Description: Accessor to attach/retrieve a sequence to/from a feature
Returntype : Bio::PrimarySeqI
Exceptions : none
Caller     : general