From a2f11a790c62c1ee50d43eadbc89f60380c8a676 Mon Sep 17 00:00:00 2001 From: hilaryh <17692590+hilaryh@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:06:14 +1100 Subject: [PATCH] Fixed bug that resulted in an error when there weren't two copies of a protocol in the experiment (should now skip those protocols) --- pcpostprocess/scripts/run_herg_qc.py | 18 +++++++++++------- pcpostprocess/subtraction_plots.py | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pcpostprocess/scripts/run_herg_qc.py b/pcpostprocess/scripts/run_herg_qc.py index 9965069..69afff2 100644 --- a/pcpostprocess/scripts/run_herg_qc.py +++ b/pcpostprocess/scripts/run_herg_qc.py @@ -243,13 +243,14 @@ def main(): times = sorted(res_dict[protocol]) savename = combined_dict[protocol] - readnames.append(protocol) if len(times) == 2: + readnames.append(protocol) savenames.append(savename) times_list.append(times) elif len(times) == 4: + readnames.append(protocol) savenames.append(savename) times_list.append(times[::2]) @@ -263,6 +264,7 @@ def main(): wells_to_export = wells if args.export_failed else overall_selection logging.info(f"exporting wells {wells}") + logging.info(f"overall selection {overall_selection}") no_protocols = len(res_dict) @@ -1041,15 +1043,17 @@ def qc3_bookend(readname, savename, time_strs, args): save_fname = f"{well}_{savename}_before0.pdf" #  Plot subtraction - get_leak_corrected(first_before_current, - voltage, times, - *ramp_bounds, - save_fname=save_fname, - output_dir=output_directory) + # get_leak_corrected(first_before_current, + # voltage, times, + # *ramp_bounds, + # save_fname=save_fname, + # output_dir=output_directory) before_traces_first[well] = get_leak_corrected(first_before_current, voltage, times, - *ramp_bounds) + *ramp_bounds, + save_fname=save_fname, + output_dir=output_directory) before_traces_last[well] = get_leak_corrected(last_before_current, voltage, times, diff --git a/pcpostprocess/subtraction_plots.py b/pcpostprocess/subtraction_plots.py index 8a9fd53..e39b4a0 100644 --- a/pcpostprocess/subtraction_plots.py +++ b/pcpostprocess/subtraction_plots.py @@ -150,6 +150,7 @@ def do_subtraction_plot(fig, times, sweeps, before_currents, after_currents, # ax.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.1e')) ax = subtracted_ax + ax.axhline(0, linestyle='--', color='lightgrey') sweep_list = [] pcs = [] for i, sweep in enumerate(sweeps):