/
FeatureCollection.pm6
47 lines (37 loc) · 1.38 KB
/
FeatureCollection.pm6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
role Bio::Role::FeatureCollection {
# this role describes methods for accessing Features for a specific instance.
# implementing classes are considered to contain Bio::Role::Features of some
# type.
# Wondering if this and FeatureHolder should be combined for
# consistency. For instance, it would be nice to have binning available for
# grabbing features by location. May be redundant for subfeatures...
# Would be nice to have iterative methods. Built-in support for Iterators and
# laziness are planned for perl6 (Iterators are to be a built-in Role):
# http://design.perl6.org/S07.html
# Also note that having Grammars that we can attach various Actions to may
# help this quite a bit. We'll see as the spec develops...
has Int $.min_bin;
has Int $.max_bin;
our Array of Bio::Role::Feature method get_Features
(
:$range? of any(Range | Bio::Role::Range), # for grabbing features in a range
Int :$start?,
Int :$end?,
Int :$strand?,
Bool :$contains?,
Str :$strand_test?,
)
{...}
our Bool method add_Features (:@features of Bio::Role::Feature)
{...}
our Array of Bio::Role::Features remove_Features
(
:@features? of Bio::Role::Feature,
:$range? of any(Range | Bio::Role::Range)
)
{...}
our Int method feature_count
{...}
our Array of Bio::Role::Feature method get_all_Features
{...}
}