Skip to content

Commit

Permalink
Error checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl Wilding-McBride committed Jul 17, 2018
1 parent d188d47 commit 1296815
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions correlate-ms2-peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@
ms2_peak_id = ms2_peaks_df.loc[ms2_peak_idx].peak_id.astype(int)
peak_correlation.append((feature_id, base_peak_id, ms2_peak_id, float(correlation)))

print("Writing out the peak correlations for features {}-{}".format(args.feature_id_lower, args.feature_id_upper))
# feature_id, base_peak_id, ms2_peak_id, float(correlation)
src_c.executemany("INSERT INTO peak_correlation VALUES (?, ?, ?, ?)", peak_correlation)
if len(peak_correlation) > 0:
print("Writing out the peak correlations for features {}-{}".format(args.feature_id_lower, args.feature_id_upper))
# feature_id, base_peak_id, ms2_peak_id, float(correlation)
src_c.executemany("INSERT INTO peak_correlation VALUES (?, ?, ?, ?)", peak_correlation)
else:
print("Error: there are no peak correlations for feature range {}-{}".format(args.feature_id_lower, args.feature_id_upper))

stop_run = time.time()
print("{} seconds to process features {} to {}".format(stop_run-start_run, args.feature_id_lower, args.feature_id_upper))
Expand Down

0 comments on commit 1296815

Please sign in to comment.