Sv_group.py 732 Bytes
Newer Older
1
2
3
4
5
class SV_Group(object):
    def __init__(self, variant, iD):
        self.variants_list = [variant]
        self.ambiguous = False
        self.id = iD
6
        self.start = None #TODO doc
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
        self.end = None
        variant.group.append(self)

    def contribute(self, candidate):
        self.variants_list.append(candidate)
        candidate.group.append(self)

    def new_coord(self):
        min_start = 0
        max_end = 0
        for ind in self.variants_list:
            if min_start == 0:
                min_start = ind.start
            min_start = min(min_start, ind.start)
            max_end = max(max_end, ind.end)
        self.start = min_start
        self.end = max_end
        return (self.start, self.end)