NAME
Bio::WGS2NCBI::FeatureSet - container of sets of features
DESCRIPTION
Objects from this class maintain an internal set of all sequence features for a given sequence ID. Features can are added (or removed) from the set while Bio::WGS2NCBI is reading a sequence with its annotations. In addition, objects from this class maintain an (integer) offset by which all features are shifted, e.g. in the case where a scaffold starts with an assembly gap that needs to be removed. Lastly, objects from this class implement the logic for serializing all the annotations for a given sequence in feature table format.
METHODS
- new()
-
Returns a new Bio::WGS2NCBI::FeatureSet object. This constructor has one required, named argument: 'seqid', which is the identifier of the sequence for which this set holds the features. In addition, optionally, an array reference of 'features' and an 'offset' can be provided. For example:
my $set = Bio::WGS2NCBI::FeatureSet->new( seqid => 'scaffold1.1', features => [ $feat1, $feat2 ], offset => 33, );
- offset()
-
Gets/sets the offset by which all feature coordinates must be shifted.
- add()
-
Adds one or more features to the set.
- remove()
-
Removes one or more features from the set.
- to_string()
-
Writes the set out in feature table format.
- read_feature_set
- read_features
-
Reads and returns a FeatureSet. Arguments:
- the file handle to read from - a counter hash to generate IDs - the Config object - the focal Seq object - the offset at the start of the sequence (e.g. after leading NNNs) - the index of the last non-N residue in the sequence
- write_features
-
Writes the FeatureSet to the provided file handle.