From 0b091a251ae6f9b8ff9eab26e93af599cf70c780 Mon Sep 17 00:00:00 2001 From: "Akshata N. Rudrapatna" <139808049+ANRudrapatna@users.noreply.github.com> Date: Tue, 14 Jul 2026 13:54:56 -0400 Subject: [PATCH] Update threshold.py Issue: there is currently no function to plot figures of validation performance (precision, recall, log2FC, and F1-score) v. the thresholds identified through threshold.py. Ideally, we would be able to visualize these as line plots (similar to results available in the maxATAC_data repository. Solution: Added a new function to plot.py to generate a four-paneled figure with the aforementioned line plots. A matching function call was also added to threshold.py. I successfully tested this code for the TF CBX2 (sample output is displayed below). --- maxatac/analyses/threshold.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maxatac/analyses/threshold.py b/maxatac/analyses/threshold.py index c8ebac8..e6ba83c 100644 --- a/maxatac/analyses/threshold.py +++ b/maxatac/analyses/threshold.py @@ -143,7 +143,10 @@ def run_thresholding(args): PR_CURVE_DF.columns = ['Monotonic_Precision', 'Monotonic_Recall', 'Threshold', 'Monotonic_log2FC', 'Monotonic_F1'] PR_CURVE_DF.to_csv(results_filename, sep="\t", header=True, index=False) - + logging.info("Plot the validation statistics v. threshold values.") + plot_threshold_calibration_stats(PR_CURVE_DF_THRESHOLD['Standard_Threshold'], PR_CURVE_DF_THRESHOLD['Monotonic_Median_Precision'], + PR_CURVE_DF_THRESHOLD['Monotonic_Median_Recall'], PR_CURVE_DF_THRESHOLD['Monotonic_Median_log2FC'], + PR_CURVE_DF_THRESHOLD['F1_Score'], output_dir, args.prefix)