def load_node_single(node_dict):
     contained = node_dict.get("contained", [])
     contained = load_contained(contained)
     node = IntervalTreeNode(
         node_dict['center'], left=None, contained=contained,
         right=None)
     node.start = node_dict['start']
     node.end = node_dict['end']
     return node
Esempio n. 2
0
def make_rt_tree(intervals):
    temp = []
    for interval in intervals:
        mz, rt = interval
        rt.members.append(mz)
        temp.append(rt)
    tree = IntervalTreeNode.build(temp)
    return tree
def make_rt_tree(intervals):
    temp = []
    for interval in intervals:
        mz, rt = interval
        rt.members.append(mz)
        temp.append(rt)
    tree = IntervalTreeNode.build(temp)
    return tree
Esempio n. 4
0
 def to_deconvoluted_peak_set(self, time_bound=None):
     if self.deconvoluted_features is None:
         raise ValueError(
             "Must first deconvolute IMS features before converting to a time-binned peak set!"
         )
     if time_bound is not None:
         cft = IntervalTreeNode.build([
             Interval(f.start_time, f.end_time, [f])
             for f in self.deconvoluted_features
         ])
         features = chain.from_iterable(cft.overlaps(*time_bound))
     else:
         features = self.deconvoluted_features
     return features_to_peak_set(features)
Esempio n. 5
0
def make_rt_tree(intervals):
    nested = nest_2d_intervals(intervals)
    tree = IntervalTreeNode.build(nested)
    return tree
def make_rt_tree(intervals):
    nested = nest_2d_intervals(intervals)
    tree = IntervalTreeNode.build(nested)
    return tree