@@ -671,9 +671,11 @@ def _parse_result(a3m_string):
671
671
if args .verbose :
672
672
print (f"predict affinity ranking score with { model } :{ ref_pkl } " )
673
673
674
+ # model params
674
675
setattr (args , "model_file" , ref_pkl )
675
676
setattr (args , "model_ckpt" , os .path .join (args .ref_pkl , f"{ model } _model.pth" ))
676
677
678
+ # prepare variants
677
679
feat = data .get_multimer (compose_pid (pid , "P" ), chains )
678
680
assert len (feat ["str_var" ]) == len (feat ["variant_pid" ])
679
681
a3m_string = "\n " .join (
@@ -685,12 +687,13 @@ def _parse_result(a3m_string):
685
687
output_file_path = os .path .join (args .output_dir , f"{ model } _{ pid } .a3m" )
686
688
with open (output_file_path , "w" ) as output_file :
687
689
setattr (args , "output_file" , output_file )
688
- energy .main (args )
690
+ energy .main (args ) # calc the Elo-score
689
691
with open (output_file_path , "r" ) as output_file :
690
692
a3m_string = output_file .read ()
691
693
for pid , pred in _parse_result (a3m_string ):
692
694
pred_dict [pid ].append (pred )
693
695
696
+ # write results to csv
694
697
with open (os .path .join (args .output_dir , f"{ model } _pred.csv" ), "w" ) as f :
695
698
writer = csv .DictWriter (f , fieldnames = ["id" , "chains" ] + task .task_name_list )
696
699
writer .writeheader ()
0 commit comments