xiaoruiDong / RDMC

Reaction Data and Molecular Conformers (RDMC) is a package dealing with reactions, molecules, conformers, majorly in 3D.
https://xiaoruidong.github.io/RDMC/
MIT License
23 stars 1 forks source link

Support removing duplicate resonance structures #51

Closed xiaoruiDong closed 1 year ago

xiaoruiDong commented 1 year ago

In previous verions, generate_radical_resonance_structures will created duplicate structures especially for species with benzene (or more general, aromatic rings). This PR adds support to remove these unwanted structures.

E.g., 1-benzyl ethlyene radical has four resonance structures if considering atom map difference, and three resonance structures if only considering chemical graph isomorphism. However, the original function returns five resonance structures with a pair of duplicate structures. The updated function in this PR should yield desired results.

xiaoruiDong commented 1 year ago

@kspieks Thanks for reviewing the PR. I added a few more commits to fix the issues (and was too lazy to squash some of them into previous commits). The issue related to [CH2]-C=C=O resonance structure generation will be fixed in a future PR.

kspieks commented 1 year ago

Thanks for pushing the changes! Yea don't worry about squashing. I'll merge now