forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
184 stars 46 forks source link

NameError Encountered as Using `mk_prepare_ligand.py` with Argument `--multimol_prefix` #142

Open proline8314 opened 1 month ago

proline8314 commented 1 month ago

The following line is used to submit docking ligands handling jobs with Meeko.

conda activate <env name>
mk_prepare_ligand.py -i $1 --multimol_outdir $2 --multimol_prefix $3

And an error message occurs as follows.

File ".../miniconda3/envs/<env name>/lib/python3.10/site-packages/meeko/cli/mk_prepare_ligand.py", line 216, in __call__
2004     
name = '%s-%d' % (args.multimol_prefix, self.counter)
NameError: name 'args' is not defined

To address the issue, replacing args with self in line 216 appears to be a viable solution. Since the local variable args is not defined in the function __call__, and the previously defined class variable self.multimol_prefix seems to be the correct one to use.

diogomart commented 1 month ago

Thanks, good catch! You have meeko v0.5.1, right?

proline8314 commented 1 month ago

Hi @diogomart Thank you for pointing that out. And yes, I believe the version is v0.5.1. I've also verified that the lastest release on Github has an identical line 216 for the file mk_prepare_ligand.py with the one I use.