Saoge123 / ccgnet

MIT License
38 stars 11 forks source link

Error message while excuting predict.py #4

Open y31apw00 opened 1 year ago

y31apw00 commented 1 year ago

Hi Saoge123,

We appriciate your valuable work and code for co-crystal prediction.

While I use the example command to run predict.py, the python code reports an error message as following. It seems that I don't have ccdc module. However, there is no further instruction in this blog and README.md. Could you please figure out how to fix it?

============ Traceback (most recent call last): File "predict.py", line 4, in from Featurize import * File "D:\QSAR\ccgnet-main\Featurize__init__.py", line 7, in from .Change_Hbond_Criterion import Change_Hbond_Criterion File "D:\QSAR\ccgnet-main\Featurize\Change_Hbond_Criterion.py", line 2, in import ccdc ModuleNotFoundError: No module named 'ccdc'

Many thanks.

y31apw00 commented 1 year ago

I guess this error may be triggered by CCDC python API. Then, copying files in "ccgnet-OB" replace original ones and try the same command again. No ccdc error is found, but related rdkit error is prompted. I have installed RDKit. Could you please give me a hint to solve it?

=========== Traceback (most recent call last): File "predict.py", line 4, in from Featurize import File "D:\QSAR\ccgnet-main\Featurize__init__.py", line 2, in from .CalcuDescriptors import File "D:\QSAR\ccgnet-main\Featurize\CalcuDescriptors.py", line 4, in from rdkit.Chem import Descriptors, rdFreeSASA ImportError: cannot import name 'rdFreeSASA'

Thank you.

Saoge123 commented 1 year ago

Hi This error may be lead by rdkit. The windows version of rdkit may not contain rdFreeSASA module. You can try it on linux.

---Original--- From: @.> Date: Thu, Jun 1, 2023 13:20 PM To: @.>; Cc: @.***>; Subject: Re: [Saoge123/ccgnet] Error message while excuting predict.py (Issue#4)

I guess this error may be triggered by CCDC python API. Then, copying files in "ccgnet-OB" replace original ones and try the same command again. No ccdc error is found, but related rdkit error is prompted. I have installed RDKit. Could you please give me a hint to solve it?

=========== Traceback (most recent call last): File "predict.py", line 4, in from Featurize import File "D:\QSAR\ccgnet-main\Featurizeinit.py", line 2, in from .CalcuDescriptors import File "D:\QSAR\ccgnet-main\Featurize\CalcuDescriptors.py", line 4, in from rdkit.Chem import Descriptors, rdFreeSASA ImportError: cannot import name 'rdFreeSASA'

Thank you.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

y31apw00 commented 1 year ago

Hi Thank you for your guide. After reinstalling entire modules in linux, I get few steps forward. Now, I use codes in "ccgnet-OB" instead of original ccgnet and run your example code for testing. It reports some new errors as follow. Could you please help me to figure out how to fix it?

CMD: python predict.py -table ./data/Test/Test_Table.tab -mol_dir ./data/Test/coformers -out cc_test.xlsx -fmt sdf Error message:

Bad input sample:CC(=O)Nc1ccc(O)cc1&c1ccc2ccccc2c1, skipped. Bad input sample:2554&757, skipped. . . . Bad input sample:c1cc2ccc3cccc4ccc(c1)c2c34&BrC1=C(Br)C(=O)C(=C(Br)C1=O)Br, skipped. Bad input sample:NC(=O)c1cccnc1&CCOC(=O)c1ccc(O)cc1, skipped. Traceback (most recent call last): File "predict.py", line 296, in main(args.table, args.mol_dir, fmt=args.fmt, model_type=args.type, xlsx_name=args.out) File "predict.py", line 226, in main infer = Inference(table, mol_dir=mol_dir, mol_file_type=fmt) File "predict.py", line 179, in init processes=8, max_graph_size=160) File "predict.py", line 99, in make_graph_dataset self.data_attr_names = D[0].keys() AttributeError: 'NoneType' object has no attribute 'keys'

By the way, the predict.py in "ccgnet-OB" seems no argument of "-model_path". It is not allowed to specify model_path like example command.

Thank you.

lochana commented 11 months ago

Did you get a solution to this? I tried the code with anaconda. Once I fix one error I run into another. Some are Tensor flow errors although I have version 2.0 in my anaconda environment. Can anyone at least give the list of libraries with correct version numbers? The predict.py version in ccgnet-OB won't accept model path parameter. Not sure how to specify it?? Thanks.

lochana commented 10 months ago

As it turns out most errors were due to tensorflow (v2 doesn't work so, you need a prior version) and unavailability of things like xlsx writer. Now, I get the output but, there are bunch of warning type errors during the calculation. I am not sure what these errors mean for the accuracy of the calculations. The authors are quite unhelpful and did not respond to any of my emails.

============================== *** Open Babel Error in OpenBabel::EEMCharges::ComputeCharges No parameters found for: Cl 1. EEM charges were not calculated for the molecule.

============================== *** Open Babel Error in OpenBabel::EEMCharges::_loadParameters Cannot open file with parameters: eem2015bm.txt

sharmaji841 commented 2 months ago

does this require ccdc python api?

Saoge123 commented 2 months ago

yes

---Original--- From: @.> Date: Tue, Jun 11, 2024 19:03 PM To: @.>; Cc: @.**@.>; Subject: Re: [Saoge123/ccgnet] Error message while excuting predict.py (Issue#4)

does this require ccdc python api?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

PotatoGan commented 1 month ago

Hi Thank you for your guide. After reinstalling entire modules in linux, I get few steps forward. Now, I use codes in "ccgnet-OB" instead of original ccgnet and run your example code for testing. It reports some new errors as follow. Could you please help me to figure out how to fix it?

CMD: python predict.py -table ./data/Test/Test_Table.tab -mol_dir ./data/Test/coformers -out cc_test.xlsx -fmt sdf

Error message:

Bad input sample:CC(=O)Nc1ccc(O)cc1&c1ccc2ccccc2c1, skipped. Bad input sample:2554&757, skipped. . . . Bad input sample:c1cc2ccc3cccc4ccc(c1)c2c34&BrC1=C(Br)C(=O)C(=C(Br)C1=O)Br, skipped. Bad input sample:NC(=O)c1cccnc1&CCOC(=O)c1ccc(O)cc1, skipped. Traceback (most recent call last): File "predict.py", line 296, in main(args.table, args.mol_dir, fmt=args.fmt, model_type=args.type, xlsx_name=args.out) File "predict.py", line 226, in main infer = Inference(table, mol_dir=mol_dir, mol_file_type=fmt) File "predict.py", line 179, in init processes=8, max_graph_size=160) File "predict.py", line 99, in make_graph_dataset self.data_attr_names = D[0].keys() AttributeError: 'NoneType' object has no attribute 'keys'

By the way, the predict.py in "ccgnet-OB" seems no argument of "-model_path". It is not allowed to specify model_path like example command.

Thank you.

I have encountered a problem similar to yours. It will report this error when running the demo.

AttributeError                            Traceback (most recent call last)
Cell In[3], [line 2](vscode-notebook-cell:?execution_count=3&line=2)
      [1](vscode-notebook-cell:?execution_count=3&line=1) data1 = Dataset('data/CC_Table/ECC&CC_Table.tab', mol_blocks_dir='data/Mol_Blocks.dir')
----> [2](vscode-notebook-cell:?execution_count=3&line=2) data1.make_graph_dataset(Desc=1, A_type='OnlyCovalentBond', hbond=0, pipi_stack=0, contact=0, make_dataframe=True)

File [f:\CODE\ccgnet-main\ccgnet\Dataset.py:110](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:110), in Dataset.make_graph_dataset(self, Desc, A_type, hbond, pipi_stack, contact, processes, max_graph_size, make_dataframe, save_name)
    [108](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:108) pool.close()
    [109](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:109) pool.join()
--> [110](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:110) self.data_attr_names = D[0].keys()
    [111](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:111) attrs = self.__dict__
    [112](file:///F:/CODE/ccgnet-main/ccgnet/Dataset.py:112) for k in self.data_attr_names:

AttributeError: 'NoneType' object has no attribute 'keys'

Do I have to run on Linux? I have already installed CCDC on Windows.