From 43f71d5d8e4297884026cab086e45c1bb7d3377d Mon Sep 17 00:00:00 2001 From: ZhouGengmo <2015201981@ruc.edu.cn> Date: Mon, 17 Jun 2024 17:40:59 +0800 Subject: [PATCH] fix ligand name bug (#232) Co-authored-by: zhougm --- unimol_docking_v2/interface/predictor/processor.py | 4 ++++ unimol_docking_v2/interface/predictor/unimol_predictor.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/unimol_docking_v2/interface/predictor/processor.py b/unimol_docking_v2/interface/predictor/processor.py index 6c88a9b..436e7aa 100644 --- a/unimol_docking_v2/interface/predictor/processor.py +++ b/unimol_docking_v2/interface/predictor/processor.py @@ -416,6 +416,10 @@ def single_clash_fix(self, input_content): def clash_fix(self, predicted_ligand, input_protein, input_ligand): if self.mode=='batch_one2many': input_protein = [input_protein] * len(input_ligand) + elif self.mode == 'single': + input_ligand = [input_ligand] + input_protein = [input_protein] + predicted_ligand = [predicted_ligand] input_content = zip(predicted_ligand, predicted_ligand, input_ligand, input_protein) with Pool(self.nthreads) as pool: diff --git a/unimol_docking_v2/interface/predictor/unimol_predictor.py b/unimol_docking_v2/interface/predictor/unimol_predictor.py index 688a8a3..dbb227b 100644 --- a/unimol_docking_v2/interface/predictor/unimol_predictor.py +++ b/unimol_docking_v2/interface/predictor/unimol_predictor.py @@ -37,8 +37,8 @@ def predict(self, input_protein:str, batch_size:int): lmdb_name = self.preprocess(input_protein, input_ligand, input_docking_grid, output_ligand_name, output_ligand_dir) - pkt_data_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "example_data", "docking", "dict_pkt.txt") - mol_data_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "example_data", "docking", "dict_mol.txt") + pkt_data_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "example_data", "dict_pkt.txt") + mol_data_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "example_data", "dict_mol.txt") script_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "unimol", "infer.py") user_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "unimol") # inference