xiaoruiDong/RDMC

Resonance Structure Generation: different starting structures

Opened this issue · 0 comments

[N]1N=NN=C1C2C=CC([N+](=O)[O-])=CC=2 and N1=NN=NC1=C1[CH]C=C([N+](=O)[O-])C=C1 are resonance structures, with the first having the radical site on the N ring and the second having the radial site on the benzene ring.

838a89e6-a108-4a37-9130-83d396b53061
835a95bb-0b10-4048-a215-31e4db8da3ec

When generating the resonance structures of this molecule
The first gives 4 resonance structures (the kekulized version of the input molecule + 3 resonance structures with aromatic benzene and radical roaming on the 5-membered ring)
The second gives 6 resonance structures (same as the native RMG results)

It seems that there are still issues with handling aromatic ring molecules.
The difference between the two cases is at least rooted in the different results from analyze_molecule results ("is_aromatic": True for the first, False for the second).

However, even with the differences, the following lines should convert the aromatic form of the molecule to kekulized form...

if features["is_aromatic"]:
# This may be an intended behavior in RMG!
# `mol` (`mol_list[0]`) will be changed inplace to kekule form during `analyze_molecule`.
# So the optimal aromatic structure, generated in the next block will always be different
# from the initial one, if it is indeed an aromatic molecule. We will then always have an
# optimal aromatic structure and fully kekulized structure carried over to the later steps
# for aromatic molecules. And in the filtration step, all aromatic structures will be kept.
# The kekulized structure will be removed by aromaticity_filtration. But, it will be added
# back in the end, since it is the first structure in the list.
# However, in RDMC workflow, `mol` is not modified in `analyze_molecule`
# Therefore, to mimic RMG's behavior, we need to generate kekulized form of `mol` here
mol_list = generate_kekule_structure(mol)
else:
mol_list = [mol]
.

Further investigation is needed