Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toRDKitMol sanization issues #257

Closed
connie opened this issue Jul 24, 2014 · 3 comments
Closed

toRDKitMol sanization issues #257

connie opened this issue Jul 24, 2014 · 3 comments

Comments

@connie
Copy link
Member

connie commented Jul 24, 2014

Running an ethylnitrite example and it crashes because the new calculateCyclicSymmetryNumber calls molecule.toRDKitMol (https://github.com/GreenGroup/RMG-Py/blob/master/rmgpy/molecule/symmetry.py#L340)

Turns out we generate saturated compounds when calculating thermo for radical species by calling estimateRadicalThermoViaHBI in data/thermo.py. We sometimes produce saturated compounds that are not approved by RDKit. The radical and saturated compound in question are:

Radical:

1 C 0 0 {2,S} {6,S} {7,S} {8,S}
2 C 1 0 {1,S} {3,S} {9,S}
3 O 0 2 {2,S} {4,S}
4 N 0 1 {3,S} {5,D}
5 O 0 2 {4,D}
6 H 0 0 {1,S}
7 H 0 0 {1,S}
8 H 0 0 {1,S}
9 H 0 0 {2,S}

Saturated Compound:

1  C 0 0 {2,S} {3,S} {4,S} {5,S}
2  N 0 0 {1,S} {4,S} {6,S} {7,S}
3  C 0 0 {1,S} {8,S} {9,S} {10,S}
4  O 0 2 {1,S} {2,S}
5  H 0 0 {1,S}
6  O 0 3 {2,S}
7  H 0 0 {2,S}
8  H 0 0 {3,S}
9  H 0 0 {3,S}
10 H 0 0 {3,S}

Which generates an explicit valence > 4 for N error. Any thoughts on how to fix this problem?

Typing the following in the command line:

    from rmgpy.molecule import Molecule
    mol = Molecule(SMILES="C1([NH+](O1)[O-])C")
    mol.toRDKitMol()

will lead straight to the problem.

@rwest
Copy link
Member

rwest commented Jul 24, 2014

I think @bbuesser found there is no way to get the flexi-valent N to work in RDKit so resorted to avoiding RDKit (in the context of drawing molecules or making SMILES). The use of RDKit in making symmetry numbers is newer than that (by @enochd?). Not sure if/how we can avoid it or fall back to alternatives?

@connie
Copy link
Member Author

connie commented Jul 24, 2014

One hack could be to not run the cyclic symmetry when nitrogen is in the molecule? Not the best solution however...

rwest added a commit to rwest/RMG-Py that referenced this issue Jul 25, 2014
See Issue ReactionMechanismGenerator#257

One thought is to make the aromatic_copy of molecule via
aromatic_copy = Molecule()
aromatic_copy.fromRDKitMol(molecule.toRDKitMol(), kekulize=False)
@mliu49
Copy link
Contributor

mliu49 commented May 17, 2018

The calculateCyclicSymmetryNumber method no longer converts to RDKitMol, so this issue should no longer apply. In general, we use OpenBabel for generating identifiers for nitrogen compounds to avoid this issue.

@mliu49 mliu49 closed this as completed May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants