swansonk14 / SyntheMol

Combinatorial antibiotic generation
MIT License
83 stars 19 forks source link

AttributeError: 'int' object has no attribute 'GetAtoms' #8

Closed jklyu0824 closed 6 months ago

jklyu0824 commented 6 months ago

I tried to run the generation step in antibiotics.md with the command line below: synthemol \ --model_path $BASEDIR/data/Models/antibiotic_chemprop \ --model_type chemprop \ --building_blocks_path $BASEDIR/data/Models/antibiotic_chemprop/building_blocks.csv \ --building_blocks_score_column chemprop_ensemble_preds \ --building_blocks_id_column Reagent_ID \ --reaction_to_building_blocks_path $BASEDIR/data/Data/4_real_space/reaction_to_building_blocks.pkl \ --save_dir $BASEDIR/test_antibiotics/generate_molecules_with_SyntheMol/generations_chemprop \ --max_reactions 1 \ --n_rollout 20000 \ --replicate
but I got this error. Any idea what could the fix be? File "/miniconda3/envs/synthemol/lib/python3.10/site-packages/chemprop/features/featurization.py", line 345, in init self.f_atoms = [atom_features(atom) for atom in mol.GetAtoms()] AttributeError: 'int' object has no attribute 'GetAtoms'

jxZh0104 commented 6 months ago

It seems that the above error is due to the reaction_to_building_blocks.pkl file storing the building_blocks as integers not SMILEs. Will greatly appreciate if the authors can clarify if this is correct!

swansonk14 commented 6 months ago

Hi @jklyu0824,

Thank you for bringing up this issue! I'm traveling right now and I'm not sure exactly what the issue is offhand, but I'll get back to you shortly!

Best, Kyle

swansonk14 commented 6 months ago

Hi @jklyu0824,

I checked the issue and the problem is a typo in the antibiotics.md file. The --reaction_to_building_blocks_path should use reaction_to_building_blocks_filtered.pkl instead of reaction_to_building_blocks.pkl. I have now corrected this. Please try again with this updated file path and reopen this issue if you're still having problems.

Best, Kyle

ChinggyLiu commented 4 months ago

Hello @swansonk14,

I think this problem also occurred at the clogp.md in the generate molecules section. It would be really nice if you could fix it.

Thanks, Chingyuen