cimm-kzn / 3D-MIL-QSAR

Multi-instance ML for ligand bioactivity prediction
54 stars 17 forks source link

TypeError: main() got an unexpected keyword argument 'path' #15

Open Superlit-CC opened 2 years ago

Superlit-CC commented 2 years ago

Thank you for your repo.

When I ran the example.ipynb:

import os from miqsar.utils import calc_3d_pmapper

Choose dataset to be modeled and create a folder where the descriptors will be stored

nconfs = 5 #number of conformers to create; calculation is time consuming, so here we set 5, for real tasks set 25..100 ncpu = 7 # set number of CPU cores you have

dataset_file = 'datasets/CHEMBL1075104.smi' descriptors_folder = os.path.join('descriptors') os.mkdir(descriptors_folder)

bags, labels, molid = calc_3d_pmapper(dataset_file, nconfs=nconfs, stereo=False, path=descriptors_folder, ncpu=ncpu)

print(f'There are {len(bags)} molecules encoded with {bags[0].shape[1]} pmapper descriptors')

then got:

TypeError Traceback (most recent call last) /tmp/ipykernel_99958/2926432156.py in 11 os.mkdir(descriptors_folder) 12 ---> 13 bags, labels, molid = calc_3d_pmapper(dataset_file, nconfs=nconfs, stereo=False, path=descriptors_folder, ncpu=ncpu) 14 15 print(f'There are {len(bags)} molecules encoded with {bags[0].shape[1]} pmapper descriptors')

~/caocheng/3D-MIL-QSAR-main/miqsar/utils.py in calc_3d_pmapper(dataset_file, nconfs, stereo, path, ncpu) 24 25 for conf in conf_files: ---> 26 dsc_file = calc_pmapper_descriptors(conf, path=path, ncpu=ncpu, col_clean=None, del_undef=True) 27 28 with open(dsc_file, 'rb') as inp:

~/caocheng/3D-MIL-QSAR-main/miqsar/descriptor_calculation/pmapper_3d.py in calc_pmapper_descriptors(*args, kwargs) 229 230 def calc_pmapper_descriptors(*args, *kwargs): --> 231 return main(args, kwargs)

TypeError: main() got an unexpected keyword argument 'path'

I didn't change anything in example. Why is it wrong?

dzankov commented 2 years ago

Dear Superlit-CC, we have significantly modified our example.ipynb and made it clearer and more understandable. We also fixed some bugs. Just try our new example.ipynb.

Superlit-CC commented 2 years ago

Thanks for your reply, I have now successfully run example.ipynb.

Timeless1 commented 1 year ago

I have had the same problem when i run example.ipynb: TypeError: main() got an unexpected keyword argument 'factory'

I checked the main () function for the source code and did not seem to be calculated for 'factory';

I didn't change anything in example. Why is it wrong?