Commit 5af8294b authored by Roman Sarrazin-Gendron's avatar Roman Sarrazin-Gendron
Browse files

Final paper supplementary version

parent 969ac9ad
import pickle
import numpy as np
from matplotlib import pyplot as plt
from pylab import rcParams
top = []
max5 = []
......@@ -14,7 +13,7 @@ actual_module = []
moip_motifs = []
to_sort = []
b = pickle.load(open("../output/full_shuffled.cPickle","rb"))
b = pickle.load(open("../output/dishuffled.cPickle","rb"))
predictions_shuffled = []
accuracy_shuffled = []
for motif in b:
......@@ -37,20 +36,17 @@ for motif in b:
a = pickle.load(open("../output/3dmotif_newalign_cv.cPickle","rb"))
for motif in a:
motif_scores = []
for sequence in a[motif]:
for sequence in motif:
#print(sequence)
seq_scores = []
for result in sequence[:1]:
score = result[0]
seq_scores.append(score)
actual_module.append(score)
if result[2]>-1000:
if result[0]>=0.5:
bayespairing_prediction.append(result[2])
positives.append(result[2])
else:
bayespairing_prediction.append(result[2])
negatives.append(result[2])
if result[2]>-100:
bayespairing_prediction.append(result[2])
positives.append(result[2])
elif result[2]<0:
bayespairing_prediction.append(0.00001)
if len(seq_scores) == 0:
......@@ -114,7 +110,7 @@ for treshold in tresholds:
#plt.plot(np.linspace(0,1,10),np.linspace(0,1,10))
#plt.xticks(range(0,200)[::5],[round(x,1) for x in tresholds][::5])
#plt.show()
rcParams['figure.figsize'] = 10,10
plt.plot(FDR)
plt.title("FDR - Rna3dmotif")
plt.xlabel("threshold")
......@@ -122,5 +118,15 @@ plt.ylabel("FDR")
plt.xticks(range(0,200)[::8],[int(x) for x in tresholds][::8])
plt.show()
#print(FDR)
for ind,iFDR in enumerate(FDR):
if iFDR<0.1:
print("TRESHOLD FOR FDR UNDER 0.1:",tresholds[ind])
break
for ind, iFDR in enumerate(FDR):
if iFDR < 0.01:
print("TRESHOLD FOR FDR UNDER 0.01:",tresholds[ind])
break
#print(sorted(negatives))
#print(sorted(positives))
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment