interval-tree

Using Interval tree to find overlapping regions

北城以北 提交于 2019-12-08 14:28:18
问题 I have two files File 1 chr1:4847593-4847993 TGCCGGAGGGGTTTCGATGGAACTCGTAGCA File 2 Pbsn|X|75083240|75098962| TTTACTACTTAGTAACACAGTAAGCTAAACAACCAGTGCCATGGTAGGCTTGAGTCAGCT CTTTCAGGTTCATGTCCATCAAAGATCTACATCTCTCCCCTGGTAGCTTAAGAGAAGCCA TGGTGGTTGGTATTTCCTACTGCCAGACAGCTGGTTGTTAAGTGAATATTTTGAAGTCC File 1 has approximately 8000 more lines with different header and sequence below it. I would first like to match the start and end co ordinates from file1 to file 2 or see if its close to each other let

Interval intersection in pandas

那年仲夏 提交于 2019-12-07 17:22:09
问题 Update 5: This feature has been released as part of pandas 20.1 (on my birthday :] ) Update 4: PR has been merged! Update 3: The PR has moved here Update 2: It seems like this question may have contributed to re-opening the PR for IntervalIndex in pandas. Update: I no longer have this problem, since I'm actually now querying for overlapping ranges from A and B , not points from B which fall within ranges in A , which is a full interval tree problem. I won't delete the question though, because

IntervalTree DeleteNode Java Implementation

非 Y 不嫁゛ 提交于 2019-12-03 14:00:05
问题 I need an IntervalTree or RangeTree implementation in Java, and am having trouble finding one with working deletion support. There's a built-in one at sun.jvm.hotspot.utilities.IntervalTree, but the deleteNode method in the RBTree superclass states: /** * FIXME: this does not work properly yet for augmented red-black * trees since it doesn't update nodes. Need to figure out exactly * from which points we need to propagate updates upwards. */ Trying to delete nodes from a tree ends up throwing

Interval tree with added dimension of subset matching?

喜你入骨 提交于 2019-12-03 09:48:17
This is an algorithmic question about a somewhat complex problem. The foundation is this: A scheduling system based on available slots and reserved slots . Slots have certain criteria, let's call them tags . A reservation is matched to an available slot by those tags, if the available slot's tag set is a superset of the reserved slot. As a concrete example, take this scenario: 11:00 12:00 13:00 +--------+ | A, B | +--------+ +--------+ | C, D | +--------+ Between the times of 11:00 to 12:30 reservations for the tags A and B can be made, from 12:00 to 13:30 C and D is available, and there's an

Interval tree algorithm that supports merging of intervals with no overlap

好久不见. 提交于 2019-12-03 07:13:55
问题 I'm looking for an interval tree algorithm similar to the red-black interval tree in CLR but that supports merging of intervals by default so that there are never any overlapping intervals. In other words if you had a tree containing two intervals [2,3] and [5,6] and you added the interval [4,4], the result would be a tree containing just one interval [2,6]. Thanks Update: the use case I'm considering is calculating transitive closure. Interval sets are used to store the successor sets

IntervalTree DeleteNode Java Implementation

余生长醉 提交于 2019-12-03 03:22:52
I need an IntervalTree or RangeTree implementation in Java, and am having trouble finding one with working deletion support. There's a built-in one at sun.jvm.hotspot.utilities.IntervalTree , but the deleteNode method in the RBTree superclass states: /** * FIXME: this does not work properly yet for augmented red-black * trees since it doesn't update nodes. Need to figure out exactly * from which points we need to propagate updates upwards. */ Trying to delete nodes from a tree ends up throwing the exception: Node's max endpoint was not updated properly How difficult would it be to properly

Interval tree algorithm that supports merging of intervals with no overlap

拈花ヽ惹草 提交于 2019-12-02 21:59:12
I'm looking for an interval tree algorithm similar to the red-black interval tree in CLR but that supports merging of intervals by default so that there are never any overlapping intervals. In other words if you had a tree containing two intervals [2,3] and [5,6] and you added the interval [4,4], the result would be a tree containing just one interval [2,6]. Thanks Update: the use case I'm considering is calculating transitive closure. Interval sets are used to store the successor sets because they have been found to be quite compact . But if you represent interval sets just as a linked list I

R-Tree Implementation Java

你说的曾经没有我的故事 提交于 2019-11-30 17:33:35
I was searching the last few days for a stable implementation of the R-Tree with support of unlimited dimensions (20 or so would be enough). I only found this http://sourceforge.net/projects/jsi/ but they only support 2 dimensions. Another Option would be a multidimensional implementation of an interval-tree. Maybe I'm completly wrong with the idea of using an R-Tree or Intervall-Tree for my Problem so i state the Problem in short, that you can send me your thoughts about this. The Problem I need to solve is some kind of nearest-neighbour search. I have a set of Antennas and rooms and for each

Maximum non-overlapping intervals in a interval tree

笑着哭i 提交于 2019-11-30 06:45:24
Given a list of intervals of time, I need to find the set of maximum non-overlapping intervals. For example, if we have the following intervals: [0600, 0830], [0800, 0900], [0900, 1100], [0900, 1130], [1030, 1400], [1230, 1400] Also it is given that time have to be in the range [0000, 2400] . The maximum non-overlapping set of intervals is [0600, 0830], [0900, 1130], [1230, 1400] . I understand that maximum set packing is NP-Complete. I want to confirm if my problem (with intervals containing only start and end time) is also NP-Complete. And if so, is there a way to find an optimal solution in

R-Tree Implementation Java

北城余情 提交于 2019-11-30 01:16:28
问题 I was searching the last few days for a stable implementation of the R-Tree with support of unlimited dimensions (20 or so would be enough). I only found this http://sourceforge.net/projects/jsi/ but they only support 2 dimensions. Another Option would be a multidimensional implementation of an interval-tree. Maybe I'm completly wrong with the idea of using an R-Tree or Intervall-Tree for my Problem so i state the Problem in short, that you can send me your thoughts about this. The Problem I