-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfigures.py
84 lines (72 loc) · 2.11 KB
/
figures.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
import pandas as pd
import numpy as np
import click as ck
from sklearn.metrics import roc_curve, auc
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from scipy.stats import spearmanr, pearsonr, wilcoxon, rankdata
plot_title = 'Human Gene-Disease association predictions'
plot_filename = 'GD-human.pdf'
@ck.command()
def main():
plot_rocs()
def plot_rocs():
plt.figure()
df = pd.read_pickle('data/sim_gd_human.pkl')
fpr = df['fpr'].values
tpr = df['tpr'].values
roc_auc = auc(fpr, tpr)
print(roc_auc)
plt.plot(
fpr,
tpr,
label='Real annotation ROC curve (area = %0.3f)' % roc_auc)
df = pd.read_pickle('data/sim_gd_human_only_pred.pkl')
fpr = df['fpr'].values
tpr = df['tpr'].values
roc_auc = auc(fpr, tpr)
print(roc_auc)
plt.plot(
fpr,
tpr,
label='Only predictions ROC curve (area = %0.3f)' % roc_auc)
df = pd.read_pickle('data/sim_gd_human_with_pred.pkl')
fpr = df['fpr'].values
tpr = df['tpr'].values
roc_auc = auc(fpr, tpr)
print(roc_auc)
plt.plot(
fpr,
tpr,
label='With predictions ROC curve (area = %0.3f)' % roc_auc)
# df = pd.read_pickle('data/sim_ppi_human_deep_only.pkl')
# fpr = df['fpr'].values
# tpr = df['tpr'].values
# roc_auc = auc(fpr, tpr)
# print(roc_auc)
# plt.plot(
# fpr,
# tpr,
# label='DeepGO and Only predictions ROC curve (area = %0.3f)' % roc_auc)
# df = pd.read_pickle('data/sim_ppi_human_deep_with.pkl')
# fpr = df['fpr'].values
# tpr = df['tpr'].values
# roc_auc = auc(fpr, tpr)
# print(roc_auc)
# plt.plot(
# fpr,
# tpr,
# label='DeepGO and With predictions ROC curve (area = %0.3f)' % roc_auc)
plt.plot([0, 1], [0, 1], 'k--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title(plot_title)
plt.legend(loc="lower right")
plt.savefig(plot_filename)
return roc_auc
if __name__ == '__main__':
main()