Skip to content

Conversation

bbuesser
Copy link
Contributor

This extension brings the following features to RMG-Py:

  • new atom types for tri-valent and penta-valent nitrogen
  • the atom objects store a new attribute describing the number if lone electron pairs
  • new functions identifying resonance structures related to nitrogen atoms
  • functionality to change the number of lone electron pairs in reaction recipes for new reaction families
  • because of the definition of lone electron pairs the atom object attribute "charge" is now automatically assigned allowing formal charges
  • the function fromAdjacencyList accepts an optional parameter, between the radical number and the first bond definition, that describes the number of lone electron pairs (e.g.: 3 N 0 1 {1,S} … would be a non-radical nitrogen atom with one lone electron pair). The function toAdjacencyList() always writes this number of lone electron pairs. It is intended to become a useful feature in defining functional groups involving lone electron pairs.

Requirements:

  • requires the latest update of RMG-database
  • to correctly assign the number of lone electron pairs from adjacency lists explicit hydrogen atoms are required! All thermochemistry and kinetic databases have been updated accordingly.
  • because of the limitation of RDKit to tri-valent nitrogen RDKit is replaced in "fall back" blocks by OpenBabel in the functions toSMILES(), and toInChI() in molecule.py and the drawing functions of draw.py. This can be removed later if RDKit becomes ready for penta-valent nitrogen. Therefore RMG-Py is only depending on OpenBabel if nitrogen is desired.

Limitations:

  • so far fromAdjacenyList() is the only way of molecule input that has been tested
  • because of the formal charges beta-scission reactions, for example, could lead to species that are ions (sum of all atomic charges != 0). Because the thermochemistry and kinetic libraries do not contain information on ions so far, the formation of ions has currently been prohibited in isMoleculeForbidden()
  • because the QM calculation of thermochemistry has always relied on RDKit it is currently not called for species containing a penta-valent nitrogen atom

electron pairs along with function to manipulate and request their
values.
lists with hydrogen atoms from the function fromAdjacencyList requiring
that the input adjacency list have include already all hydrogen atoms.
Added a new code section calculating and storing the number of lone
electron pairs and electric charges for each atom which is possible only
if the adjacency list contains all hydrogen atoms.
pair resonance and extend the electronic charge calculation for the
special case of hydrogen.
This function writes for debugging the molecules in the edge into a
ChemkinFile similar to the function saveChemkinFile for the core
molecules but with additional information.
- adding function isNitrogen() to confirm that an atom is a nitrogen
atom
- updated and renamed the functions identifying lone pair - radical
electron shift resonance isomers
- added functions identifying resonance isomers with nitrogen atoms
having two double bonds (N4dd) and nitrogen atoms having one triple and
one single bond (N4ts)
- removed isRadical() in generateResonanceIsomers() because it is again
used inside getAdjacentResonanceIsomers() and
getLonePairRadicalIsomers() and is not required for
getN4dd_N4tsResonanceIsomers()
Because of the many new molecular structures possible by accounting for
lone electron pairs, such as ions and new forms of radicals, we have to
forbid, at least at the moment, certain structures until we have more
thermodynamic and kinetics information for them in our libraries.

- Until we have more thermodynamic data of charged molecules we will
forbid them
- We also forbid positively charged oxygen atoms
- We forbid at least at the moment oxygen atoms with bond order larger
than two and radical oxygen with a bond order of two
forming single bonds

Example reaction: Acatat ion (CH3CO2-) reacting with water (H2O)

In both of the two contributing resonance structures of the Acetat ion
one of the two oxygen atoms is connected to the carbon atom by a single
bond and bears three lone electron pairs while the other oxygen atom is
connected by a double bond and bears two lone electron pairs. The oxygen
atom with three lone electron pairs can abstract a proton (H+) from a
water molecule where one of the three lone electron pairs provides both
electrons for the new single bond formed to the new hydrogen atom,
resulting in an acetic acid (CH3COOH) and a hydroxide (OH-) molecule.
lines around atom symbols

- Needs further improvement to account for the direction of bonds to
adjacent atoms and the special drawing of small molecules
These action will be first used in the lone_electron_pair_bond reaction
family

- GAIN_PAIR increases the number of lone electron pairs on a specific
atom
- LOSE_PAIR decreases the number of lone electron pairs on a specific
atom
- adding attributes for lone electron pairs
- adding functions __gainPair() and __losePair() and handling of the new
reaction recipe actions GAIN_PAIR and LOSE_PAIR
- temporarily, until we have more thermo and kinetics data on ions
- treating special case of nitrogen in NO2 groups
Conflicts:
	rmgpy/molecule/atomtype.py
pairs

The following adjacency list example describes NO2 with the radical 
electron on the nitrogen atom with the following parameters where
numberLoneElectronPairs is new and optional:

atomIndex atomType numberRadicalElectrons numberLoneElectronPairs
bonds{}
1 N 1 0 {2,D} {3,S}
2 O 0 2 {1,D}
3 O 0 3 {1,S}
Conflicts:
	rmgpy/molecule/molecule.pxd
	rmgpy/molecule/molecule.py
Conflicts:
	rmgpy/molecule/adjlist.py
	rmgpy/molecule/atomtype.py
Because RDKit cannot handle non-standard valency like tetra-valent
nitrogen RMG is falling back to previous drawing functions and
replaces RDKit's toSMILE with getFormula.

Temporarily fixes ReactionMechanismGenerator#156
@connie
Copy link
Member

connie commented Nov 20, 2013

For bookkeeping- this is a list of unittests that now fail due to this branch (mostly related to adjacency lists)
< Test the AtomType.setActions() method. ... ok

Test the AtomType.setActions() method. ... ERROR
< Test the Group.toAdjacencyList() method. ... ok
Test the Group.toAdjacencyList() method. ... ERROR
< Check the adjacency list read/write functions for a full molecule. ... ok
Check the adjacency list read/write functions for a full molecule. ... FAIL
< Test the Molecule.fromAdjacencyList() method. ... ok
Test the Molecule.fromAdjacencyList() method. ... FAIL
< Test the Molecule.getLabeledAtoms() method. ... ok
Test the Molecule.getLabeledAtoms() method. ... FAIL
< Test the Molecule.getMolecularWeight() method. ... ok
Test the Molecule.getMolecularWeight() method. ... FAIL
< Test the Molecule.toAdjacencyList() method. ... ok
Test the Molecule.toAdjacencyList() method. ... FAIL
< Test that toAdjacencyList() works as expected. ... ok
Test that toAdjacencyList() works as expected. ... FAIL

@connie
Copy link
Member

connie commented Nov 20, 2013

Could you also write a new example job input file and put it in the examples folder? That would be very helpful.

@bbuesser
Copy link
Contributor Author

Yes, I will fix the failing unit tests and provide and example input file

The number of lone electron pairs is not defined for groups, therefore
should not be printed for groups
set removeH = False
add number of lone electron pairs to setup molecule
Introducing 1-centered biradicals to the H-abstraction family lets RMG
find the special case of CH2(T) + CH = CH + CH2(T). However for the
reverse reaction it recognizes that nothing happens and removes the
reverse reaction from the reaction list which leads an error for empty
reaction lists.
@bbuesser
Copy link
Contributor Author

The test failing because of nitrogen and related changes have been fixed by b4d8b86 f313e8a 97192bc d9425b0 6bdd706 0714b4f dcdce81

@bbuesser
Copy link
Contributor Author

I have added an example input for nitrogen in 65084ca

S - singlet
D - doublet
T - triplet
Q - quartet
V - quintet
The current assumptions for newly found products is that they attain the
highest possible multiplicity as this in most cases the most stable
species and resulting often in the fastest kinetics. However if we start
with a singlet biradical reactant in the forward direction we find with
this assumption only the triplet biradical as product of the reverse
reaction. I became aware of this because I have added the nitrogen atom
as a triradical to the three important reaction families H_abstraction,
Disproportionation and R_Addition_MultipleBond.

I think making it very general is the simplest solution. For that I have
added the electronic states of quartet (Q) and quintet (V). I didn’t
want to continue hardcode specific exceptions. Therefore I have modified
the function __generateProductStructures() to find all possible
electronic states for the newly found product structures and add all
possible combinations of these products to a product structures list.
This list can also contain spin-forbidden reactions! But instead of
hardcoding the removal of them I think we should add their often very
slow kinetics to the library.

I have extended __generateReactions() to make a list of reactions using
the new list of product structures. That way it will find the reverse
reaction leading to the correct electronic state of the reactants of the
forward reaction.
- improvements to obtain correct reaction degeneracy 
- replace while loop with if conditions
This function returns a list of atoms of the molecules containing at
least one unpaired electron.
- include the requirement for an existing lone electron pair for
N5dd-N5ts resonance
- this prevents two edge files having the same number of species from
overwriting each other
Conflicts:
	rmgpy/rmg/main.py
	rmgpy/rmg/model.py
- not using Substitution_O for now
- add function
getTransportPropertiesViaLennardJonesParameters(self,species) to
transport.py
- use this function as a fall back only if the library and the transport
groups do not have proper information
@connie connie merged commit 32cb930 into ReactionMechanismGenerator:master Dec 8, 2013
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

Successfully merging this pull request may close these issues.

2 participants