Bio-EnsEMBL
view release on metacpan or search on metacpan
lib/Bio/EnsEMBL/Utils/Tree/Interval/Immutable.pm view on Meta::CPAN
# since x > x_center, we also consider the rightmost set of intervals
return $self->_query_point($node->right, $point, $result);
}
return sort_by_begin(uniq($result));
}
# This corresponds to the left branch of the range search, once we find a node, whose
# midpoint is contained in the query interval. All intervals in the left subtree of that node
# are guaranteed to intersect with the query, if they have an endpoint greater or equal than
# the start of the query interval. Basically, this means that every time we branch to the left
# in the binary search, we need to add the whole right subtree to the result set.
sub _range_query_left {
my ($self, $node, $interval, $result) = @_;
while ($node) {
if ($interval->contains($node->x_center)) {
push @{$result}, @{$node->s_center_beg};
if ($node->right) {
lib/Bio/EnsEMBL/Utils/Tree/Interval/Immutable.pm view on Meta::CPAN
last if $seg_end->is_left_of($interval);
push @{$result}, $seg_end;
}
$node = $node->right;
}
}
}
# This corresponds to the right branch of the range search, once we find a node, whose
# midpoint is contained in the query interval. All intervals in the right subtree of that node
# are guaranteed to intersect with the query, if they have an endpoint smaller or equal than
# the end of the query interval. Basically, this means that every time we branch to the right
# in the binary search, we need to add the whole left subtree to the result set.
sub _range_query_right {
my ($self, $node, $interval, $result) = @_;
while ($node) {
if ($interval->contains($node->x_center)) {
push @{$result}, @{$node->s_center_beg};
if ($node->left) {
( run in 0.586 second using v1.01-cache-2.11-cpan-b61123c0432 )