def step(n, g, names, complete_multiedges, cfg_file, path_to_mgra): for _ in range(0, n): for i in range(0, len(g)): breakage(i, g, complete_multiedges) io_utils.write_genomes("blocks.txt", g, names) run(path_to_mgra + " -c " + cfg_file + " -g blocks.txt -o out") cc_count = io_utils.read_count_of_cc("out/stats.txt") return int(cc_count)
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