def generate_raw_data_traces(libKey, tfKey, floworder, SIGPROC_RESULTS): ######################################################## #Generate Raw Data Traces for lib and TF keys # ######################################################## printtime("Generate Raw Data Traces for lib and TF keys(iontrace_Test_Fragment.png, iontrace_Library.png) and raw_peak_signal file") tfRawPath = os.path.join(SIGPROC_RESULTS, 'avgNukeTrace_%s.txt' % tfKey) libRawPath = os.path.join(SIGPROC_RESULTS, 'avgNukeTrace_%s.txt' % libKey) peakOut = 'raw_peak_signal' if os.path.exists(tfRawPath): try: kp = plotKey.KeyPlot(tfKey, floworder, 'Test Fragment') kp.parse(tfRawPath) kp.dump_max(os.path.join('.',peakOut)) kp.plot() except: printtime("TF key graph didn't render") traceback.print_exc() else: printtime("ERROR: %s is missing" % tfRawPath) if os.path.exists(libRawPath): try: kp = plotKey.KeyPlot(libKey, floworder, 'Library') kp.parse(libRawPath) kp.dump_max(os.path.join('.',peakOut)) kp.plot() except: printtime("Lib key graph didn't render") traceback.print_exc() else: printtime("ERROR: %s is missing" % libRawPath)
def generate_raw_data_traces(libKey, tfKey, floworder, SIGPROC_RESULTS, plot_output_dir=os.getcwd()): # # Generate Raw Data Traces for lib and TF keys # # printtime("Generate Raw Data Traces for lib and TF keys " + "(iontrace_Test_Fragment.png, iontrace_Library.png) " + "and raw_peak_signal file") tfRawPath = os.path.join(SIGPROC_RESULTS, "avgNukeTrace_%s.txt" % tfKey) libRawPath = os.path.join(SIGPROC_RESULTS, "avgNukeTrace_%s.txt" % libKey) peakOut = "raw_peak_signal" if os.path.exists(tfRawPath): try: kp = plotKey.KeyPlot(tfKey, floworder, "Test Fragment") kp.parse(tfRawPath) kp.dump_max(os.path.join(plot_output_dir, peakOut)) kp.plot(outdir=plot_output_dir) except Exception: printtime("TF key graph didn't render") traceback.print_exc() else: printtime("ERROR: %s is missing" % tfRawPath) if os.path.exists(libRawPath): try: kp = plotKey.KeyPlot(libKey, floworder, "Library") kp.parse(libRawPath) kp.dump_max(os.path.join(plot_output_dir, peakOut)) kp.plot(outdir=plot_output_dir) except Exception: printtime("Lib key graph didn't render") traceback.print_exc() else: printtime("ERROR: %s is missing" % libRawPath)