Skip to content

Commit

Permalink
Fixed bug that resulted in an error when there weren't two copies of …
Browse files Browse the repository at this point in the history
…a protocol in the experiment (should now skip those protocols)
  • Loading branch information
hilaryh committed Jan 8, 2025
1 parent 8b0b1b4 commit a2f11a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pcpostprocess/scripts/run_herg_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions pcpostprocess/subtraction_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a2f11a7

Please sign in to comment.