@@ -240,13 +240,14 @@ def in_silico_de(self):
240240 if wt_prediction is None or wt_prediction == 'skip' :
241241 wt_prediction = 'skip'
242242 while wt_prediction == 'skip' :
243- rand_pos = random .randint (0 , len (self .s_wt ))
243+ rand_pos = random .randint (0 , len (self .s_wt ) - 1 )
244244 wt_mut = self .s_wt [rand_pos ] + str (rand_pos ) + self .s_wt [rand_pos ]
245+ print (f"Trying to get WT fitness: { wt_mut } ..." )
245246 wt_prediction = predict ( # AAidx, OneHot, or DCA-based pure ML prediction
246247 path = self .path ,
247248 model = self .model ,
248249 encoding = self .encoding ,
249- variants = np .atleast_1d (wt_mut ),
250+ variants = np .atleast_1d (wt_mut ), # WT, e.g. F17F
250251 sequences = np .atleast_1d (self .s_wt ),
251252 no_fft = self .no_fft ,
252253 couplings_file = self .dca_encoder
@@ -272,14 +273,14 @@ def in_silico_de(self):
272273 if wt_prediction is None or wt_prediction == 'skip' :
273274 wt_prediction = 'skip'
274275 while wt_prediction == 'skip' :
275- rand_pos = random .randint (0 , len (self .s_wt ))
276+ rand_pos = random .randint (0 , len (self .s_wt ) - 1 )
276277 wt_mut = self .s_wt [rand_pos ] + str (rand_pos ) + self .s_wt [rand_pos ]
278+ print (f"Trying to get WT fitness: { wt_mut } ..." )
277279 wt_prediction = predict_directed_evolution (
278280 encoder = self .dca_encoder ,
279- variant = self .s_wt [int (new_variant [:- 1 ]) - 1 ] + new_variant [:- 1 ] +
280- self .s_wt [int (new_variant [:- 1 ]) - 1 ], # WT, e.g. F17F
281+ variant = wt_mut , # WT, e.g. F17F
281282 variant_sequence = self .s_wt ,
282- hybrid_model_data_pkl = self .model
283+ hybrid_model_data_pkl = self .model # TODO: Add global model
283284 )
284285 if self .de_step_counter == 0 :
285286 logger .info (
0 commit comments