Skip to content

Commit

Permalink
hyper isn't working for now, subbing in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cjfields committed Aug 16, 2015
1 parent 776ce39 commit e5b5268
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/Bio/Role/Range.pm6
Expand Up @@ -87,13 +87,16 @@ role Bio::Role::Range {
method union (*@ranges, RangeTest :$test = 'ignore') {
my $union_strand = self.strand; # Strand for the union range object.

# beware the hyperoperator!
$union_strand = 0 if any(@ranges».strand) != $union_strand;

@ranges.unshift(self);

my $max = @ranges.max: { $^a.end <=> $^b.end };
my $min = @ranges.min: { $^a.start <=> $^b.start };
#$union_strand = 0 if any(@ranges».strand) != $union_strand;
for @ranges -> $range {
if $range.strand != $union_strand {
$union_strand = 0;
last;
}
}

my $max = (@ranges, self).flat.max: { $^a.end <=> $^b.end };
my $min = (@ranges, self).flat.min: { $^a.start <=> $^b.start };

# what if the end is undef...
return self.new(start => $min.start,
Expand Down

0 comments on commit e5b5268

Please sign in to comment.