def RunQueries(Query, filename): start_time = time.time() query = Query(network, S, P) result = 0 for rpi in range(starting_rpi, ending_rpi): result += query(rpi) if (rpi - starting_rpi) % 10000 == 0: DSGRN.LogToSTDOUT("Processed from " + str(starting_rpi) + " to " + str(rpi) + " out of " + str(ending_rpi)) normalization = (ending_rpi - starting_rpi) * query.num_paths() with open(filename, 'w') as outfile: outfile.write(str(result) + " " + str(normalization) + "\n") with open(filename + ".log", 'w') as outfile: outfile.write(str(time.time() - start_time) + '\n')
def RunQueries(Query, filename): start_time = time.time() query = Query(network, S, P) result = 0 for rpi in range(starting_rpi, ending_rpi): number_of_matches = query(rpi) # DSGRN.LogToSTDOUT("Reduced parameter " + str(rpi) + " has " + str(number_of_matches) + " matches for query " + query.__class__.__name__) result += number_of_matches if (rpi - starting_rpi) % 10000 == 0: DSGRN.LogToSTDOUT("Processed from " + str(starting_rpi) + " to " + str(rpi) + " out of " + str(ending_rpi)) normalization = (ending_rpi - starting_rpi) * query.num_paths() with open(filename, 'w') as outfile: outfile.write(str(result) + " " + str(normalization) + "\n") with open(filename + ".log", 'w') as outfile: outfile.write(str(time.time() - start_time) + '\n')
print( "./ComputeQuery network_specification_file.txt partial_hysteresis_output_file.txt partial_resettable_output_file.txt full_hysteresis_output_file.txt full_resettable_output_file.txt starting_rpi ending_rpi S_gene P_gene" ) exit(1) network_specification_file = str(sys.argv[1]) network = DSGRN.Network(network_specification_file) partial_hysteresis_output_file = str(sys.argv[2]) partial_resettable_output_file = str(sys.argv[3]) full_hysteresis_output_file = str(sys.argv[4]) full_resettable_output_file = str(sys.argv[5]) starting_rpi = int(sys.argv[6]) ending_rpi = int(sys.argv[7]) S = sys.argv[8] P = sys.argv[9] DSGRN.LogToSTDOUT("Parameter graph has " + str(DSGRN.ParameterGraph(network).size()) + " parameters. ") def RunQueries(Query, filename): start_time = time.time() query = Query(network, S, P) result = 0 for rpi in range(starting_rpi, ending_rpi): number_of_matches = query(rpi) # DSGRN.LogToSTDOUT("Reduced parameter " + str(rpi) + " has " + str(number_of_matches) + " matches for query " + query.__class__.__name__) result += number_of_matches if (rpi - starting_rpi) % 10000 == 0: DSGRN.LogToSTDOUT("Processed from " + str(starting_rpi) + " to " + str(rpi) + " out of " + str(ending_rpi)) normalization = (ending_rpi - starting_rpi) * query.num_paths()