The features() method returns annotations across the length of the
segment. Two forms of this method are recognized. In the first form, the
@filter argument contains a series of category names
to retrieve. Each category may be further qualified by a regular
expression which will be used to filter features by their type ID. Filters
have the format "category:typeID", where the category and type
are separated by a colon. The typeID and category names are treated as an
unanchored regular expression (but see the note below). As a special cse,
you may use a type of "transcript" to fetch composite transcript
model objects (the union of exons, introns and cds features).
Example 1: retrieve all the features in the
"similarity" and "experimental" categories:
@features = $segment->features('similarity','experimental');
Example 2: retrieve all the similarity features of type
EST_elegans and EST_GENOME:
@features = $segment->features('similarity:EST_elegans','similarity:EST_GENOME');
Example 3: retrieve all similarity features that have anything
to do with ESTs:
@features = $segment->features('similarity:EST');
Example 4: retrieve all the transcripts and experimental
data
@genes = $segment->features('transcript','experimental')
In the second form, the type and categories are given as named
arguments. You may use regular expressions for either typeID or
category. It is also possible to pass an array reference for either
argument, in which case the DAS server will return the union of the
features.
Example 5: retrieve all the features in the
"similarity" and "experimental" categories:
@features = $segment->features(-category=>['similarity','experimental']);
Example 6: retrieve all the similarity features of type
EST_elegans and EST_GENOME:
@features = $segment->features(-category=>'similarity',
-type =>/^EST_(elegans|GENOME)$/
);