Beispiel #1
0
def matrix_gen_test(func1,func2,distance):
    matrix = []
    block_index = []
    block_column = []
    print func1.getseq()
    engine_x = st.resort_block(func1.getseq(),func1)
    engine_y = st.resort_block(func2.getseq(),func2)
    print engine_x

    for block1 in func1.getblocks():
        block_index.append(block1.get_label())

    for block2 in func2.getblocks():
        block_column.append(block2.get_label())

    for block1 in engine_x:
        line = []
        for block2 in engine_y:
            line.append(distance(block1,block2))
        matrix.append(line)

    #print_matrix(matrix)


    #al.build_matrix_df(matrix,block_index,block_column)
    simi_mat = ex.public_sequence(matrix,func1.getseq(),func2.getseq(),cf.min_seq_length,cf.threshhold,cf.max_gap_length)

    li = []
    for item in matrix:
        li.append(max(item))

    i = len(matrix)
    j = len(matrix[0])

    visual.draw_matrix(matrix,i,j,max(li),simi_mat)
Beispiel #2
0
def dump_matrix(func1,func2,distance,members1,members2):
    matrix = []
    block_index = []
    block_column = []
    #print func1.getseq()
    engine_x = st.resort_block(func1.getseq(),func1)
    engine_y = st.resort_block(func2.getseq(),func2)
    #print engine_x

    for block1 in func1.getblocks():
        block_index.append(block1.get_label())

    for block2 in func2.getblocks():
        block_column.append(block2.get_label())

    for block1 in engine_x:
        line = []
        for block2 in engine_y:
            line.append(distance(block1,block2))
        matrix.append(line)

    #print_matrix(matrix)


    #al.build_matrix_df(matrix,block_index,block_column)

    simi_mat = ex.public_sequence(matrix,func1.getseq(),func2.getseq(),4,0.33,1)

    li = []
    for item in matrix:
        li.append(max(item))

    i = len(matrix)
    j = len(matrix[0])

    visual.dump_matrix(matrix,i,j,max(li),simi_mat,members1,members2)