@@ -367,6 +367,11 @@ def enrichmentPlot(labelScheme):
367
367
"""
368
368
fig , ax = plt .subplots ()
369
369
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
+
370
375
if labelScheme == "Strict Labeling Successful Compounds" :
371
376
plt .title ("Enrichment Plot for Triaging Active Compounds" , fontname = "Times New Roman" , fontsize = 14 )
372
377
historic_hits = pickle .load (open ("pickles/historic_hits_conventional_standard.pkl" , "rb" ))
@@ -407,13 +412,25 @@ def enrichmentPlot(labelScheme):
407
412
if j in ML_hits :
408
413
cumulative_summation += ML_fraction
409
414
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
+
410
422
x1 = np .arange (0 , 1 , float (1 / 1600 ))
411
423
hist_AUC = np .trapz (historic_plot , x1 )
412
424
print ("HIST AUC: " , hist_AUC )
413
425
ML_AUC = np .trapz (ML_plot , x1 )
414
426
print ("ML AUC: " , ML_AUC )
427
+ cell_profiler_AUC = np .trapz (cell_profiler_plot , x1 )
428
+ print ("cellProfiler AUC: " , cell_profiler_AUC )
429
+
415
430
ax .plot (x1 , ML_plot , color = "red" , label = "ML Method, AUC = " + str (round (ML_AUC , 2 )))
416
431
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
+
417
434
ax .set_xlabel ("Ranked Queue Percentage" , fontname = "Times New Roman" , fontsize = 12 )
418
435
ax .set_ylabel ("Percentage of Successful Compounds Discovered" , fontname = "Times New Roman" , fontsize = 12 )
419
436
plt .legend (loc = 'lower right' , prop = {"family" :"Times New Roman" , "size" :10 })
@@ -602,12 +619,12 @@ def osteoAblationPlot():
602
619
x = pickle .load (open ("pickles/ablation_osteo_x_fold_1.pkl" , "rb" ))
603
620
y1 = pickle .load (open ("pickles/ablation_osteo_y_fold_1.pkl" , "rb" ))
604
621
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"))
606
623
y_avg = []
607
624
y_std = []
608
625
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]))
611
628
612
629
# sorted_pairs = sorted(zip(x, y_avg, y_std))
613
630
# tuples = zip(*sorted_pairs)
@@ -619,7 +636,7 @@ def osteoAblationPlot():
619
636
x_vals = ax .get_xticks ()
620
637
x_vals = np .insert (x_vals , 0 , 0 )
621
638
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 )
623
640
ax .errorbar (x , y_avg , yerr = y_std , capsize = 1.5 , elinewidth = .2 , ecolor = "black" , label = "ML Model" )
624
641
ax .set_ylabel ("Average Pearson Correlation Over Test Set" , fontname = "Times New Roman" , fontsize = 12 )
625
642
plt .axis ((- .02 ,102 ,0 ,1 ))
@@ -633,8 +650,8 @@ def osteoAblationPlot():
633
650
634
651
635
652
## method calls
636
- performanceBarCharts ()
637
- calculateStatisticalSignificance ()
653
+ # performanceBarCharts()
654
+ # calculateStatisticalSignificance()
638
655
enrichmentPlot ("Strict Labeling Successful Compounds" )
639
656
enrichmentPlot ("Strict Labeling Missed Successful Compounds" )
640
657
enrichmentPlot ("Strict Labeling Successful Compounds - ML" )
@@ -643,9 +660,9 @@ def osteoAblationPlot():
643
660
enrichmentBoxPlot ("Strict Labeling Missed Successful Compounds" )
644
661
enrichmentBoxPlot ("Strict Labeling Successful Compounds - ML" )
645
662
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()
651
668
osteoAblationPlot ()
0 commit comments