dptech-corp / Uni-Dock

Uni-Dock: a GPU-accelerated molecular docking program
189 stars 39 forks source link

Can't find mgltools properly #30

Open yanze039 opened 1 year ago

yanze039 commented 1 year ago

Hi,

Based on code here:

https://github.com/dptech-corp/Uni-Dock/blob/7c0cda06c94fc802194c55e7cec0cef1f834c31a/unidock_tools/unidock_tools/protein_prepare/protein_prepare.py#L14-L32

I thought this way to find mgltools is not good. I was assuming users are under Unidock tools conda env where Unidock are installed when executing this command. This requires python=3. But mgltools are based on python2, so it can't coexist with Unidock_tools and therefore in another environment.

But the code here is searching for a *, which returns the env of Unidock tools not mgltools. This can lead to

Traceback (most recent call last):
  File "/home/gridsan/ywang3/.conda/envs/unidock/bin/Unidock", line 33, in <module>
    sys.exit(load_entry_point('unidock-tools==1.1.2', 'console_scripts', 'Unidock')())
  File "/home/gridsan/ywang3/.conda/envs/unidock/lib/python3.9/site-packages/unidock_tools-1.1.2-py3.9.egg/unidock_tools/unidock.py", line 312, in main
    unidock = UniDock(args.receptor, args.scoring, args.dir)
  File "/home/gridsan/ywang3/.conda/envs/unidock/lib/python3.9/site-packages/unidock_tools-1.1.2-py3.9.egg/unidock_tools/unidock.py", line 27, in __init__
    self.set_receptor(receptor)
  File "/home/gridsan/ywang3/.conda/envs/unidock/lib/python3.9/site-packages/unidock_tools-1.1.2-py3.9.egg/unidock_tools/unidock.py", line 52, in set_receptor
    self.receptor = preparer.run()
  File "/home/gridsan/ywang3/.conda/envs/unidock/lib/python3.9/site-packages/unidock_tools-1.1.2-py3.9.egg/unidock_tools/protein_prepare/protein_prepare.py", line 54, in run
    self.pdb2pdbqt(self.input_protein_path, self.output_protein_path)
  File "/home/gridsan/ywang3/.conda/envs/unidock/lib/python3.9/site-packages/unidock_tools-1.1.2-py3.9.egg/unidock_tools/protein_prepare/protein_prepare.py", line 27, in pdb2pdbqt
    if "*" in set(line.split("")):
ValueError: empty separator

I guess we can let users define the location of mgltools. Just correct me if I'm wrong.

pkuyyj commented 1 year ago

@YNYuan