The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::WGS2NCBI::Feature - base class for sequence features

DESCRIPTION

This is the base class for all sequence feature classes for which Bio::WGS2NCBI instantiates objects when reading a genome annotation. In particular, this class manages the coordinates (1-based inclusive start/stop) for the region(s) that the feature spans, the internal unique identifiers for all features, and the serialization logic.

The API for features is deliberately sparse as it is only intended to be used by Bio::WGS2NCBI and may change in future versions (e.g. in order to become compatible with BioPerl features so that other annotation file formats can be used as well).

METHODS

new()

Returns a new feature. This constructor is called with the 'type' argument to create any of the subclasses. For example:

 my $gene = Bio::WGS2NCBI::Feature->new( type => 'gene' );

In addition, the values for all methods except 'qualifiers', 'id' and 'to_string' can be set here by using the method name as the key name of a named argument. For example:

 my $gene = Bio::WGS2NCBI::Feature->new( type => 'gene', gene => 'CO1' );
seq

Getter/setter of sequence id

range()

Returns a list of ranges, specified as start/stop coordinates, that the feature spans. Optional argument ([ $start, $stop ]) grows the set of ranges by one additional range.

lies_within

Tests whether the invocant lies within the provided coordinates

id()

Returns a unique integer ID for the feature.

qualifiers()

Returns a list of qualifier names. This is an empty ("abstract") method that the subclasses need to override.

to_string()

Returns a string representation of the feature in NCBI's tbl format.