Bio::Gonzales::Feat - a sequence feature


        seq_id => 'chr01',
        source => 'glimmerhmm',
        type   => 'exon',
        start  => 324,
        end    => 6342,
        strand => -1,
        attributes => { ID => [ 'exon01' ], Parent => [ 'gene01', 'gene02' ] },


Represents a sequence feature. The field attributes is not required to create an object of class Bio::Gonzales::Feat. This class is based on the Sequence Ontology GFF3 specification


\%attributes = $f->attr
\%attributes = $f->attributes
$sequence_id = $f->seq_id
$souce = $f->source

Gets and sets the source attribute of the feature.

$type = $f->type

Gets and sets the type attribute of the feature.

$start_coord = $f->start
$start_coord = $f->begin

Get or set the start coord of the feature.


The same syntax as $f-start>, only for the end coordianate.

$strand = $f->strand

Set or get the strand. The strand can be -1 (minus strand), 0 (strand unknown) or 1 (plus strand).

$phase = $f->phase

Gets or sets the phase.

$score = $f->score

Gets or sets the score.


Get or set the attributes of the feature. Structure:

        ID => [ 'id01' ],
        Parent => [ 'parent1', 'parent2', ... ]

Gives access to a general container for subfeature objects. Makes grouping easier, e.g. for BED output format. An example would be an 'mRNA'-object that has several exons as subfeatures.


The same as $f-subfeats>, only with parent relation. This function is completely unrelated to the $f-parent_id> function. $f-parent_id> only accesses the attributes, not the parentfeature container.


This is a synonym for $f-seq_id>.

$first_value = $f->attr_first($attribute_key)
$first_value = $f->first_attr($attribute_key)

The functions attr_first and first_attr retrieve the value of the first element of the given attribute. An example would be

  my $id = $f->attr_first("ID");

  # in case of multiple parents only the first entry/parent will be returned.
  my $parent = $f->attr_first("Parent");
$id = $f->id

Retrieve the value of the "ID" attribute. If a feature has multiple ids, a warning will be printed. Effectively a shortcut for $f-attributes->{ID}[0]>.

@ids = $f->ids
\@ids = $f->ids

A shortcut for $f-attributes->{ID}>. Returns a list of IDs in list context, a reference to the ID list in scalar context.

@parent_ids = $f->parent_ids
\@parent_ids = $f->parent_ids

A shortcut for $f-attributes->{Parent}>. Returns a list of parent IDs in list context, a reference to the parent ID list in scalar context.

$parent_id = $f->parent_id

A shortcut for $f-attributes->{Parent}[0]>. Gives a warning if multiple parent ids are present.


To add an attribute, call add_attr with either a hash of the form

  %attributes = (
    ID => "mrna_01",
    Parent => "gene_01"


  %attributes = (
    ID => "exon_01",
    Parent => [ "gene_01", "gene_02" ],
\@deleted_attributes = $f->del_attr(@attribute_names)
$deleted_attribute = $f->del_attr($attribute_name)

Deletes all attributes in @attribute_names.


Convert between numeric and character strand respresentation.

$cloned_f = $f->clone

Clone the feature, deeply (incl. subfeatures and parentfeatures).

$length = $f->length

The length (end -start +1)



jw bargsten, <joachim.bargsten at>