Skip to content

Commit

Permalink
pyproject.toml: add some dir; mcdock.py,unidock_pipeline.py: Path-->str
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangplpl committed Apr 9, 2024
1 parent 3311fcc commit 767e023
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4,119 deletions.
5 changes: 3 additions & 2 deletions unidock_tools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ classifiers = [
]

[tool.setuptools.package-data]
"*" = ["*.dat"]
"*" = ["*/templates/*", "*/receptor_topology/bin/*","*/receptor_topology/data/*"]


[project.urls]
Homepage = "https://github.com/dptech-corp/Uni-Dock"
Expand All @@ -54,4 +55,4 @@ reportMissingImports = false
reportMissingModuleSource = false
reportAttributeAccessIssue = false
reportIncompatibleMethodOverride = false
reportCallIssue = false
reportCallIssue = false
2 changes: 1 addition & 1 deletion unidock_tools/src/unidock_tools/application/mcdock.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self,
if receptor.suffix == ".pdb":
#pdb2pdbqt(receptor, workdir.joinpath(receptor.stem + ".pdbqt"))
#receptor = workdir.joinpath(receptor.stem + ".pdbqt")
receptor_pdbqt_file_name = receptor_preprocessor(receptor, working_dir_name=workdir)
receptor_pdbqt_file_name = receptor_preprocessor(str(receptor), working_dir_name=str(workdir))
self.receptor = receptor_pdbqt_file_name
if receptor.suffix != ".pdbqt":
logging.error("receptor file must be pdb/pdbqt format")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self,
if receptor.suffix == ".pdb":
###pdb2pdbqt(receptor, workdir.joinpath(receptor.stem + ".pdbqt"))
###receptor = workdir.joinpath(receptor.stem + ".pdbqt")
receptor_pdbqt_file_name = receptor_preprocessor(receptor, working_dir_name=workdir)
receptor_pdbqt_file_name = receptor_preprocessor(str(receptor), working_dir_name=str(workdir))
self.receptor = receptor_pdbqt_file_name
if receptor.suffix != ".pdbqt":
logging.error("receptor file must be pdb/pdbqt format")
Expand Down
24 changes: 1 addition & 23 deletions unidock_tools/src/unidock_tools/modules/docking/unidock.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self,
size_z = min(size_z*2, 25)

if scoring.lower() == "ad4":
map_prefix = os.path.join(working_dir_name, 'protein.maps.fld')
map_prefix = os.path.join(self.workdir, 'receptor_grids','protein_conf_0', 'protein.maps.fld')
cmd += ["--maps", str(map_prefix)]
else:
cmd += ["--receptor", str(receptor)]
Expand Down Expand Up @@ -92,28 +92,6 @@ def __init__(self,

self.pre_result_ligands = [Path(os.path.join(output_dir, f"{l.stem}_out.sdf")) for l in ligands]

def check_env(self, use_ad4: bool = False):
if not shutil.which("unidock"):
raise ModuleNotFoundError("UniDock is not installed.")
if use_ad4:
mgltools_python_path = shutil.which("pythonsh")
if not mgltools_python_path:
raise ModuleNotFoundError("MGLTools is not installed.")
prepare_gpf4_script_path = os.path.join(
os.path.dirname(os.path.dirname(mgltools_python_path)),
"MGLToolsPckgs",
"AutoDockTools",
"Utilities24",
"prepare_gpf4.py",
)
if not os.path.exists(prepare_gpf4_script_path):
raise ModuleNotFoundError("MGLTools is not installed.")
if not shutil.which("autogrid4"):
raise ModuleNotFoundError("AutoGrid4 is not installed.")
self.mgltools_python_path = mgltools_python_path
self.prepare_gpf4_script_path = prepare_gpf4_script_path
self.ad4_map_data_path = str(Path(__file__).parent.parent.parent.joinpath("data/docking/AD4.1_bound.dat"))


def run(self):
resp = subprocess.run(
Expand Down
Loading

0 comments on commit 767e023

Please sign in to comment.