Nathalie BERNARD

petite modif

...@@ -143,9 +143,9 @@ def specificity(tp, tn, fp, fn): ...@@ -143,9 +143,9 @@ def specificity(tp, tn, fp, fn):
143 143
144 # ================== Code from Louis Beckey Benchark.py ============================== 144 # ================== Code from Louis Beckey Benchark.py ==============================
145 145
146 -def write_mcc_in_file_E(sequence_id, true_contacts, true_structure): 146 +def write_mcc_in_file_E(sequence_id, true_contacts, true_structure, estimator):
147 - read_prd = open("results/test_" + sequence_id + ".json_pmE_MFE", "r") 147 + read_prd = open("results/test_" + sequence_id + ".json_pmE_"+ estimator, "r")
148 - write = open("results/test_" + sequence_id + ".mcc_E_MFE", "w") 148 + write = open("results/test_" + sequence_id + ".mcc_E_" + estimator, "w")
149 149
150 max_mcc_str = -1; 150 max_mcc_str = -1;
151 max_mcc_ctc = -1; 151 max_mcc_ctc = -1;
...@@ -186,10 +186,10 @@ def write_mcc_in_file_E(sequence_id, true_contacts, true_structure): ...@@ -186,10 +186,10 @@ def write_mcc_in_file_E(sequence_id, true_contacts, true_structure):
186 write.close() 186 write.close()
187 return [max_mcc_ctc, max_mcc_str] 187 return [max_mcc_ctc, max_mcc_str]
188 188
189 -def write_mcc_in_file_F(sequence_id, true_contacts, true_structure): 189 +def write_mcc_in_file_F(sequence_id, true_contacts, true_structure, estimator):
190 190
191 - read_prd = open("results/test_" + sequence_id + ".json_pmF_MFE", "r") 191 + read_prd = open("results/test_" + sequence_id + ".json_pmF_" + estimator, "r")
192 - write = open("results/test_" + sequence_id + ".mcc_F_MFE", "w") 192 + write = open("results/test_" + sequence_id + ".mcc_F_" + estimator, "w")
193 193
194 max_mcc_str = -1; 194 max_mcc_str = -1;
195 max_mcc_ctc = -1; 195 max_mcc_ctc = -1;
...@@ -404,7 +404,7 @@ while seq: ...@@ -404,7 +404,7 @@ while seq:
404 404
405 file_path = "results/test_" + name + ".json_pmE_MFE" 405 file_path = "results/test_" + name + ".json_pmE_MFE"
406 if os.path.isfile(file_path): 406 if os.path.isfile(file_path):
407 - tabE_MFE = write_mcc_in_file_E(name, contacts, structure2d) 407 + tabE_MFE = write_mcc_in_file_E(name, contacts, structure2d, 'MFE')
408 list_contacts_E_MFE.append(tabE_MFE[0]) 408 list_contacts_E_MFE.append(tabE_MFE[0])
409 list_struct2d_E_MFE.append(tabE_MFE[1]) 409 list_struct2d_E_MFE.append(tabE_MFE[1])
410 countE_MFE = countE_MFE + 1 410 countE_MFE = countE_MFE + 1
...@@ -414,7 +414,7 @@ while seq: ...@@ -414,7 +414,7 @@ while seq:
414 414
415 file_path = "results/test_" + name + ".json_pmF_MFE" 415 file_path = "results/test_" + name + ".json_pmF_MFE"
416 if os.path.isfile(file_path): 416 if os.path.isfile(file_path):
417 - tabF_MFE = write_mcc_in_file_F(name, contacts, structure2d) 417 + tabF_MFE = write_mcc_in_file_F(name, contacts, structure2d, 'MFE')
418 list_contacts_F_MFE.append(tabF_MFE[0]) 418 list_contacts_F_MFE.append(tabF_MFE[0])
419 list_struct2d_F_MFE.append(tabF_MFE[1]) 419 list_struct2d_F_MFE.append(tabF_MFE[1])
420 countF_MFE = countF_MFE + 1 420 countF_MFE = countF_MFE + 1
...@@ -424,7 +424,7 @@ while seq: ...@@ -424,7 +424,7 @@ while seq:
424 424
425 file_path = "results/test_" + name + ".json_pmE_MEA" 425 file_path = "results/test_" + name + ".json_pmE_MEA"
426 if os.path.isfile(file_path): 426 if os.path.isfile(file_path):
427 - tabE_MEA = write_mcc_in_file_E(name, contacts, structure2d) 427 + tabE_MEA = write_mcc_in_file_E(name, contacts, structure2d, 'MEA')
428 list_contacts_E_MEA.append(tabE_MEA[0]) 428 list_contacts_E_MEA.append(tabE_MEA[0])
429 list_struct2d_E_MEA.append(tabE_MEA[1]) 429 list_struct2d_E_MEA.append(tabE_MEA[1])
430 countE_MEA = countE_MEA + 1 430 countE_MEA = countE_MEA + 1
...@@ -434,7 +434,7 @@ while seq: ...@@ -434,7 +434,7 @@ while seq:
434 434
435 file_path = "results/test_" + name + ".json_pmF_MEA" 435 file_path = "results/test_" + name + ".json_pmF_MEA"
436 if os.path.isfile(file_path): 436 if os.path.isfile(file_path):
437 - tabF_MEA = write_mcc_in_file_F(name, contacts, structure2d) 437 + tabF_MEA = write_mcc_in_file_F(name, contacts, structure2d, 'MEA')
438 list_contacts_F_MEA.append(tabF_MEA[0]) 438 list_contacts_F_MEA.append(tabF_MEA[0])
439 list_struct2d_F_MEA.append(tabF_MEA[1]) 439 list_struct2d_F_MEA.append(tabF_MEA[1])
440 countF_MEA = countF_MEA + 1 440 countF_MEA = countF_MEA + 1
......