resonance generation creates charged species

Open
#53 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start in autotst/species.py around line 143, where generate_resonance_structures() is called during species initialization. Reproduce the failure with the SMILES string OON+[O-], then inspect the referenced RMG molecule.py and resonance.py locations to understand the charged-species error. Done means this input no longer raises the reported ValueError, with regression coverage for the case.

Written by the indexing model from the issue text.

Description

Currently, AutoTST uses RMG's generate_resonance_structures() method to automatically generate resonance structures when an autotst species is initialized. However, occasionally, this resonance generation method raises a ValueError when trying to create a charged species. This is happening to some of the weird HAN nitrogen intermediates. This is the traceback when trying to generate a species from smiles string 'OO[N+](O)[O-]'

Traceback (most recent call last):
  File "molecules.py", line 103, in <module>
    species = Species(smiles=[smiles])
  File "/home/farina.d/AutoTST/autotst/species.py", line 143, in __init__
    species_list.append(molecule.generate_resonance_structures())
  File "rmgpy/molecule/molecule.py", line 2089, in rmgpy.molecule.molecule.Molecule.generate_resonance_structures
  File "rmgpy/molecule/molecule.py", line 2091, in rmgpy.molecule.molecule.Molecule.generate_resonance_structures
  File "rmgpy/molecule/resonance.py", line 150, in rmgpy.molecule.resonance.generate_resonance_structures
  File "rmgpy/molecule/resonance.py", line 185, in rmgpy.molecule.resonance.generate_resonance_structures
ValueError: Got the following structure:
SMILES: OO[N+2](O)[O-]
AdjacencyList:
1 O u0 p2 c0 {3,S} {5,S}
2 O u0 p2 c0 {5,S} {6,S}
3 O u0 p2 c0 {1,S} {7,S}
4 O u0 p3 c-1 {5,S}
5 N u0 p0 c+2 {1,S} {2,S} {4,S}
6 H u0 p0 c0 {2,S}
7 H u0 p0 c0 {3,S}

Net charge: 1

Currently RMG cannot process charged species correctly.
If this structure was entered in SMILES, try using the adjacencyList format for an unambiguous definition.
Dominant language
Python
Stars
51
Forks
19
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ReactionMechanismGenerator/AutoTST

All issues in ReactionMechanismGenerator/AutoTST

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.