Skip to content

Commit af2f1ea

Browse files
author
Daniel Wong
committed
added pickled results from CellProfiler run
1 parent 8a47b4c commit af2f1ea

8 files changed

+43
-23
lines changed

figure_generator.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ def enrichmentPlot(labelScheme):
367367
"""
368368
fig, ax = plt.subplots()
369369
x1 = range(0, 1600)
370+
cellProfilerHits = pickle.load(open("pickles/CellProfilerRanks.pkl", "rb"))
371+
cell_profiler_fraction = float(1/len(cellProfilerHits))
372+
if "Missed" in labelScheme:
373+
cellProfilerHits = [x for x in cellProfilerHits if x > 40]
374+
370375
if labelScheme == "Strict Labeling Successful Compounds":
371376
plt.title("Enrichment Plot for Triaging Active Compounds", fontname="Times New Roman", fontsize=14)
372377
historic_hits = pickle.load(open("pickles/historic_hits_conventional_standard.pkl", "rb"))
@@ -407,13 +412,25 @@ def enrichmentPlot(labelScheme):
407412
if j in ML_hits:
408413
cumulative_summation += ML_fraction
409414
ML_plot.append(cumulative_summation)
415+
cumulative_summation = 0
416+
cell_profiler_plot = []
417+
for j in range(0, 1600):
418+
if j in cellProfilerHits:
419+
cumulative_summation += cell_profiler_fraction
420+
cell_profiler_plot.append(cumulative_summation)
421+
410422
x1 = np.arange(0, 1, float(1/1600))
411423
hist_AUC = np.trapz(historic_plot, x1)
412424
print("HIST AUC: ", hist_AUC)
413425
ML_AUC = np.trapz(ML_plot, x1)
414426
print("ML AUC: ", ML_AUC)
427+
cell_profiler_AUC = np.trapz(cell_profiler_plot, x1)
428+
print("cellProfiler AUC: ", cell_profiler_AUC)
429+
415430
ax.plot(x1, ML_plot, color = "red", label="ML Method, AUC = " + str(round(ML_AUC, 2)))
416431
ax.plot(x1, historic_plot, color = "blue", label="Conventional Method, AUC = " + str(round(hist_AUC, 2)))
432+
ax.plot(x1, cell_profiler_plot, color = "purple", label="CellProfiler, AUC = " + str(round(cell_profiler_AUC, 2)))
433+
417434
ax.set_xlabel("Ranked Queue Percentage", fontname="Times New Roman", fontsize=12)
418435
ax.set_ylabel("Percentage of Successful Compounds Discovered", fontname="Times New Roman", fontsize=12)
419436
plt.legend(loc='lower right', prop={"family":"Times New Roman", "size":10})
@@ -602,12 +619,12 @@ def osteoAblationPlot():
602619
x = pickle.load(open("pickles/ablation_osteo_x_fold_1.pkl", "rb"))
603620
y1 = pickle.load(open("pickles/ablation_osteo_y_fold_1.pkl", "rb"))
604621
y2 = pickle.load(open("pickles/ablation_osteo_y_fold_2.pkl", "rb"))
605-
y3 = pickle.load(open("pickles/ablation_osteo_y_fold_3.pkl", "rb"))
622+
# y3 = pickle.load(open("pickles/ablation_osteo_y_fold_3.pkl", "rb"))
606623
y_avg = []
607624
y_std = []
608625
for i in range(0, len(x)):
609-
y_avg.append(np.mean(y1[i] + y2[i] + y3[i]))
610-
y_std.append(np.std(y1[i] + y2[i] + y3[i]))
626+
y_avg.append(np.mean(y1[i] + y2[i]))# + y3[i]))
627+
y_std.append(np.std(y1[i] + y2[i]))# + y3[i]))
611628

612629
# sorted_pairs = sorted(zip(x, y_avg, y_std))
613630
# tuples = zip(*sorted_pairs)
@@ -619,7 +636,7 @@ def osteoAblationPlot():
619636
x_vals = ax.get_xticks()
620637
x_vals = np.insert(x_vals, 0, 0)
621638
ax.set_xticklabels(['{:,.0%}'.format(x_val) for x_val in x_vals], fontname="Times New Roman")
622-
ax.axhline(.40, linestyle="--", color='black', lw=.80, alpha=0.8)
639+
ax.axhline(.44, linestyle="--", color='black', lw=.80, alpha=0.8)
623640
ax.errorbar(x, y_avg, yerr=y_std, capsize=1.5, elinewidth=.2, ecolor="black", label="ML Model")
624641
ax.set_ylabel("Average Pearson Correlation Over Test Set", fontname="Times New Roman", fontsize=12)
625642
plt.axis((-.02,102,0,1))
@@ -633,8 +650,8 @@ def osteoAblationPlot():
633650

634651

635652
## method calls
636-
performanceBarCharts()
637-
calculateStatisticalSignificance()
653+
# performanceBarCharts()
654+
# calculateStatisticalSignificance()
638655
enrichmentPlot("Strict Labeling Successful Compounds")
639656
enrichmentPlot("Strict Labeling Missed Successful Compounds")
640657
enrichmentPlot("Strict Labeling Successful Compounds - ML")
@@ -643,9 +660,9 @@ def osteoAblationPlot():
643660
enrichmentBoxPlot("Strict Labeling Missed Successful Compounds")
644661
enrichmentBoxPlot("Strict Labeling Successful Compounds - ML")
645662
enrichmentBoxPlot("Strict Labeling Missed Successful Compounds - ML")
646-
ablationPlot()
647-
performancePlot(plot="ROC")
648-
performancePlot(plot="PRC")
649-
overlapPlot()
650-
plateSeparatedPerformance()
663+
# ablationPlot()
664+
# performancePlot(plot="ROC")
665+
# performancePlot(plot="PRC")
666+
# overlapPlot()
667+
# plateSeparatedPerformance()
651668
osteoAblationPlot()

pickles/CellProfilerRanks.pkl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3a99ff4b529c58799156d467eba2c278c40e73ed5263bc3c5c0c694ca031d51d
3+
size 49

pickles/ablation_osteo_x_fold_1.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:37c25539afbc540da69276b65b213adae7ca64338465436dff47787fefb224fd
3-
size 408
2+
oid sha256:4e1f7c111b562cc866cf49c48e2f9608f870ef14496fba99be5200dbf8cc0ffd
3+
size 430

pickles/ablation_osteo_x_fold_2.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:37c25539afbc540da69276b65b213adae7ca64338465436dff47787fefb224fd
3-
size 408
2+
oid sha256:4e1f7c111b562cc866cf49c48e2f9608f870ef14496fba99be5200dbf8cc0ffd
3+
size 430

pickles/ablation_osteo_x_fold_3.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:af832fd594f00ac709fd4f787c357ef81a71974b560ebc6dfb99eed31332d574
3-
size 276
2+
oid sha256:0ee7ffed1bff97c3fe1e8d86104c1acfc4f4f793f6bce1eaae97763cda069e31
3+
size 342

pickles/ablation_osteo_y_fold_1.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:b7f5bf5e4f843a21075abc3c68296686d6f09a7b82f8172dbe1bdbfba74f19f6
3-
size 47017712
2+
oid sha256:281418f01a68246f9b080ee6918655b0a2a6c53aeee368ecd58cc29ed467c08a
3+
size 50376166

pickles/ablation_osteo_y_fold_2.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:bb87518e70839c2cdbb41216d89b899ed4cded8c376846cf27a5757cf415b6c1
3-
size 47012504
2+
oid sha256:db28805f91fc30ccf406c672c86774487f891b3586a9b5c4c82c40c8eb097185
3+
size 50370586

pickles/ablation_osteo_y_fold_3.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:a0023eda65e741985b070ea7880458f193d457eaefa5361d02143cfa63d14756
3-
size 26869716
2+
oid sha256:f47e71f5869cf4f212654dd14e6fee6eaab40a5dcedefbd54a4737698a6895d7
3+
size 36946101

0 commit comments

Comments
 (0)