Beispiel #1
0
def get_mapping(tree1, tree2, pos, times):
    recomb, coal = arghmm.find_recomb_coal(tree2, tree1, pos=pos)
    states1 = list(arghmm.iter_coal_states(tree1, times))
    states2 = list(arghmm.iter_coal_states(tree2, times))

    for i, (node1, time1) in enumerate(states1):
        j = arghmm.get_deterministic_transition(
            (node1, time1), states2, times, tree2, tree1, recomb[0],
            times.index(recomb[1]), coal[0], times.index(coal[1]))
        node2, time2 = states2[j]
        yield (node1, time1), (node2, time2)
Beispiel #2
0
def get_mapping(tree1, tree2, pos, times):
    recomb, coal = arghmm.find_recomb_coal(tree2, tree1, pos=pos)
    states1 = list(arghmm.iter_coal_states(tree1, times))
    states2 = list(arghmm.iter_coal_states(tree2, times))
    
    for i, (node1, time1) in enumerate(states1):
        j = arghmm.get_deterministic_transition(
            (node1, time1), states2, times, tree2, tree1,
            recomb[0], times.index(recomb[1]),
            coal[0], times.index(coal[1]))
        node2, time2 = states2[j]
        yield (node1, time1), (node2, time2)
Beispiel #3
0
    
    win.add_group(argvis.draw_arg(tree, layout2))

    recomb = tree[r[0]]
    x, y = layout2[recomb]
    win.add_group(argvis.draw_mark(x, y, col=(0, 0, 1)))

    coal = last_tree[c[0]]
    x, y = layout[coal]
    win.add_group(argvis.draw_mark(x, y, col=(0, 1, 0)))


    mapping = {}
    for i, (node1, time1) in enumerate(model.states[pos-1]):
        j = arghmm.get_deterministic_transition(
            (node1, time1), model.states[pos], model.times, tree, last_tree,
            r[0], times.index(r[1]),
            c[0], times.index(c[1]))
        node2, time2 = model.states[pos][j]
        mapping[(node1, time1)] = (node2, time2)

        x1 = layout[last_tree[node1]][0]
        x2 = layout2[tree[node2]][0]
        y1 = model.times[time1]
        y2 = model.times[time2]
            
        win.add_group(group(line_strip(color(0,1,0,.5),
                                       x1, y1,
                                       (x1+x2)/2.0, 100+(y1+y2)/2.0,
                                       x2, y2)))

    win.home("exact")
Beispiel #4
0
        layout2[node] = (x + 20, y)

    win.add_group(argvis.draw_arg(tree, layout2))

    recomb = tree[r[0]]
    x, y = layout2[recomb]
    win.add_group(argvis.draw_mark(x, y, col=(0, 0, 1)))

    coal = last_tree[c[0]]
    x, y = layout[coal]
    win.add_group(argvis.draw_mark(x, y, col=(0, 1, 0)))

    mapping = {}
    for i, (node1, time1) in enumerate(model.states[pos - 1]):
        j = arghmm.get_deterministic_transition(
            (node1, time1), model.states[pos], model.times, tree, last_tree,
            r[0], times.index(r[1]), c[0], times.index(c[1]))
        node2, time2 = model.states[pos][j]
        mapping[(node1, time1)] = (node2, time2)

        x1 = layout[last_tree[node1]][0]
        x2 = layout2[tree[node2]][0]
        y1 = model.times[time1]
        y2 = model.times[time2]

        win.add_group(
            group(
                line_strip(color(0, 1, 0, .5), x1, y1, (x1 + x2) / 2.0,
                           100 + (y1 + y2) / 2.0, x2, y2)))

    win.home("exact")