Ejemplo n.º 1
0
def iteration(blocks_file, cfg_file, complete_multiedges, path_to_mgra):
    g, names, y = [], [], []
    io_utils.read_genomes(blocks_file, g, names)
    y.append(step(0, g, names, complete_multiedges, cfg_file, path_to_mgra))
    for _ in range(0, count_of_steps):
        y.append(step(count_of_breakages_by_step, g, names, complete_multiedges, cfg_file, path_to_mgra))
    return y
Ejemplo n.º 2
0
def subset_processing(blocks_file, cfg_file, path_to_mgra):
    seed(5)
    g, names = [], []
    io_utils.read_genomes(blocks_file, g, names)
    io_utils.write_genomes("blocks.txt", g, names)
    #prepare stats.txt to get complete multiedges
    run(path_to_mgra + " -c " + cfg_file + " -g blocks.txt -o out")

    complete_multiedges = {}
    io_utils.read_complete_multiedges("out/stats.txt", complete_multiedges)

    ys = []
    for i in range(0, count_of_iterations):
        #print(i)
        ys.append(iteration(blocks_file, cfg_file, complete_multiedges, path_to_mgra))

    mean = list(map(lambda x: float(sum(x))/count_of_iterations, list(zip(*ys))))

    return mean