Skip to content

Commit 6335fac

Browse files
committed
Add GREMLIN-DCA avGFP DirectEvo: ProSST to launch.json
1 parent 778e761 commit 6335fac

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,4 @@ datasets/AVGFP/Pickles/*
421421
datasets/AVGFP/DCA_Hybrid_Model_Performance_ESM1v_no_ML.png
422422
datasets/AVGFP/DCA_Hybrid_Model_Performance_ProSST_no_ML.png
423423
datasets/AVGFP/HYBRIDgremlinesm_DE_trajectories.png
424+
datasets/AVGFP/HYBRIDgremlinprosst_DE_trajectories.png

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,25 @@
369369
]
370370
},
371371

372+
{
373+
"name": "Python: PyPEF hybrid/only-PS-zero-shot GREMLIN-DCA avGFP DirectEvo: ProSST",
374+
"type": "debugpy",
375+
"request": "launch",
376+
"env": {"PYTHONPATH": "${workspaceFolder}"},
377+
"program": "${workspaceFolder}/pypef/main.py",
378+
"console": "integratedTerminal",
379+
"justMyCode": true,
380+
"cwd": "${workspaceFolder}/datasets/AVGFP/",
381+
"args": [
382+
"hybrid",
383+
"directevo",
384+
"-m", "HYBRIDgremlinprosst",
385+
"--wt", "P42212_F64L.fasta",
386+
"--params", "GREMLIN",
387+
"--temp", "0.1"
388+
]
389+
},
390+
372391
{ // PLMC zero-shot steps:
373392
// 1. $pypef param_inference --params uref100_avgfp_jhmmer_119_plmc_42.6.params
374393
// 2. $pypef hybrid -t TS.fasl --params PLMC

pypef/utils/directed_evolution.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)