From 26aafdf3733ccd44e4bab7084c252a5d4af1b515 Mon Sep 17 00:00:00 2001 From: dp-yuanyn <139571209+dp-yuanyn@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:58:23 +0800 Subject: [PATCH] fix:ligand index list too long err (#127) --- .../src/unidock_tools/application/unidock_pipeline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/unidock_tools/src/unidock_tools/application/unidock_pipeline.py b/unidock_tools/src/unidock_tools/application/unidock_pipeline.py index d0559f5..cc4db05 100644 --- a/unidock_tools/src/unidock_tools/application/unidock_pipeline.py +++ b/unidock_tools/src/unidock_tools/application/unidock_pipeline.py @@ -212,11 +212,10 @@ def main(args: dict): if args.get("ligand_index"): with open(args["ligand_index"], "r") as f: index_content = f.read() - index_lines1 = [Path(line.strip()).resolve() for line in index_content.split("\n") - if line.strip() and Path(line.strip()).exists()] - index_lines2 = [Path(line.strip()).resolve() for line in index_content.split(" ") - if line.strip() and Path(line.strip()).exists()] + index_lines1 = [line.strip() for line in index_content.split("\n") if line.strip()] + index_lines2 = [line.strip() for line in index_content.split(" ") if line.strip()] ligands.extend(index_lines2 if len(index_lines2) > len(index_lines1) else index_lines1) + ligands = [Path(ligand).resolve() for ligand in ligands if Path(ligand).exists()] if len(ligands) == 0: logging.error("No ligands found.")