From d0f3d73e2df655d1433be8a3e66a32859d0cc0c4 Mon Sep 17 00:00:00 2001 From: Eirc Deveaud Date: Mon, 20 Apr 2026 11:56:18 +0200 Subject: [PATCH 1/4] python consistency --- src/rfantibody/cli/inference.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rfantibody/cli/inference.py b/src/rfantibody/cli/inference.py index f34276e..778e803 100644 --- a/src/rfantibody/cli/inference.py +++ b/src/rfantibody/cli/inference.py @@ -100,7 +100,7 @@ def rfdiffusion( sys.exit(1) # Build command - cmd = ['python', str(script_path), '--config-name', 'antibody'] + cmd = [sys.executable, str(script_path), '--config-name', 'antibody'] # Required parameters cmd.append(f'antibody.target_pdb={target}') @@ -246,7 +246,7 @@ def proteinmpnn( sys.exit(1) # Build command - cmd = ['python', str(script_path)] + cmd = [sys.executable, str(script_path)] # Input if input_dir: @@ -394,7 +394,7 @@ def rf2( sys.exit(1) # Build command - cmd = ['python', str(script_path)] + cmd = [sys.executable, str(script_path)] # Input if input_pdb: From a22641133c3584e02ff8e87b0cbc4d55f0f74df1 Mon Sep 17 00:00:00 2001 From: Eirc Deveaud Date: Mon, 20 Apr 2026 18:39:01 +0200 Subject: [PATCH 2/4] hydraconf set ouputs to HOME/.rfantibody/outputs --- scripts/config/inference/antibody.yaml | 7 +++++++ scripts/config/inference/base.yaml | 7 +++++++ src/rfantibody/rf2/config/base.yaml | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/scripts/config/inference/antibody.yaml b/scripts/config/inference/antibody.yaml index ae048ff..31f3916 100644 --- a/scripts/config/inference/antibody.yaml +++ b/scripts/config/inference/antibody.yaml @@ -21,3 +21,10 @@ antibody: terminate_bad_targeting: null hotspot_termination_threshold: 10 hotspot_termination_failures_permitted: 20 + +hydra: + run: + dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S} + sweep: + dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S} + subdir: ${hydra.job.num} diff --git a/scripts/config/inference/base.yaml b/scripts/config/inference/base.yaml index a48d6d2..4b42864 100644 --- a/scripts/config/inference/base.yaml +++ b/scripts/config/inference/base.yaml @@ -168,3 +168,10 @@ scaffoldguided: target_ss: null target_adj: null mask_loops: True + +hydra: + run: + dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S} + sweep: + dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S} + subdir: ${hydra.job.num} diff --git a/src/rfantibody/rf2/config/base.yaml b/src/rfantibody/rf2/config/base.yaml index b38552e..06a71ad 100644 --- a/src/rfantibody/rf2/config/base.yaml +++ b/src/rfantibody/rf2/config/base.yaml @@ -54,3 +54,9 @@ model_param: div: 4 n_heads: 4 +hydra: + run: + dir: ${oc.env:HOME}/.rfantibody/outputs/${now:%Y-%m-%d}/${now:%H-%M-%S} + sweep: + dir: ${oc.env:HOME}/.rfantibody/multirun/${now:%Y-%m-%d}/${now:%H-%M-%S} + subdir: ${hydra.job.num} From 2dba312c9c27e2094f48978f741c4d06a706ddab Mon Sep 17 00:00:00 2001 From: Eirc Deveaud Date: Mon, 20 Apr 2026 18:39:49 +0200 Subject: [PATCH 3/4] pkls saved to HOME/.rfantibody/cached_schedules --- src/rfantibody/rfdiffusion/diffusion.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rfantibody/rfdiffusion/diffusion.py b/src/rfantibody/rfdiffusion/diffusion.py index 5302d44..c6f3794 100644 --- a/src/rfantibody/rfdiffusion/diffusion.py +++ b/src/rfantibody/rfdiffusion/diffusion.py @@ -1,6 +1,7 @@ # script for diffusion protocols import logging import os +from pathlib import Path import pickle import time from typing import List @@ -49,8 +50,10 @@ def get_chi_betaT(max_timestep=100, beta_0=0.01, abar_T=1e-3, method='cosine'): Function to precalculate beta_T for chi angles (decoded at different time steps, so T in beta_T varies). Calculated empirically """ + cache_dir=os.path.join(Path.home(), '.rfantibody', 'cached_schedules') + name = f'T{max_timestep}_beta_0{beta_0}_abar_T{abar_T}_method_{method}.pkl' + name=os.path.join(cache_dir, name) - name = f'./cached_schedules/T{max_timestep}_beta_0{beta_0}_abar_T{abar_T}_method_{method}.pkl' if not os.path.exists(name): print('Calculating chi_beta_T dictionary...') @@ -72,8 +75,8 @@ def get_chi_betaT(max_timestep=100, beta_0=0.01, abar_T=1e-3, method='cosine'): beta_Ts[timestep] = idx.item() # save cached schedule - if not os.path.isdir('./cached_schedules/'): - os.makedirs('./cached_schedules/', exist_ok=True) + if not os.path.isdir(cache_dir): + os.makedirs(cache_dir, exist_ok=True) with open(name, 'wb') as fp: pickle.dump(beta_Ts, fp) @@ -880,7 +883,7 @@ def __init__(self, schedule_kwargs={}, chi_kwargs={}, var_scale=1.0, - cache_dir='.', + cache_dir=os.path.join(Path.home(), '.rfantibody', 'cached_schedules'), partial_T=None, truncation_level=2000 ): From 51de79a19f3ca41a00e258db2918f8f332bf4913 Mon Sep 17 00:00:00 2001 From: Eirc Deveaud Date: Mon, 20 Apr 2026 18:47:55 +0200 Subject: [PATCH 4/4] Revert "python consistency" This reverts commit d0f3d73e2df655d1433be8a3e66a32859d0cc0c4. --- src/rfantibody/cli/inference.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rfantibody/cli/inference.py b/src/rfantibody/cli/inference.py index 778e803..f34276e 100644 --- a/src/rfantibody/cli/inference.py +++ b/src/rfantibody/cli/inference.py @@ -100,7 +100,7 @@ def rfdiffusion( sys.exit(1) # Build command - cmd = [sys.executable, str(script_path), '--config-name', 'antibody'] + cmd = ['python', str(script_path), '--config-name', 'antibody'] # Required parameters cmd.append(f'antibody.target_pdb={target}') @@ -246,7 +246,7 @@ def proteinmpnn( sys.exit(1) # Build command - cmd = [sys.executable, str(script_path)] + cmd = ['python', str(script_path)] # Input if input_dir: @@ -394,7 +394,7 @@ def rf2( sys.exit(1) # Build command - cmd = [sys.executable, str(script_path)] + cmd = ['python', str(script_path)] # Input if input_pdb: