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

Charged atom types #1206

Merged
merged 28 commits into from
Feb 2, 2018
Merged

Charged atom types #1206

merged 28 commits into from
Feb 2, 2018

Conversation

nyee
Copy link
Contributor

@nyee nyee commented Sep 20, 2017

This must be pulled in simultaneously with the RMG-database PR also named chargedAT. Be sure to remove the first commit redirecting the travis build before merging

This PR adds the charge attribute to atomtypes with the goal to increase the diversity of nitrogen and sulfur groups we can represent. This also had some effect on the atomtypes for carbon monoxide. Additionally, we have renamed carbon and oxygen atomtypes to conform to the format of nitrogen and sulfur.

This was a major functional change, so many coding edits (besides refactoring atom type names in code and test database) were also included. Some of the major ones are listed below:

  1. Molecule objects need correct lone pairs and charge to get correct atomtypes now. The Molecule.update() function and many tests were changed accordingly
  2. Because of the previous point, sub-molecules used in the polycyclic thermo heuristic now need to be saturated before descending the tree for corrections. Otherwise, the charge/lone pairs get assumed incorrectly.
  3. Now that we define lone pairs as part of the atom types, we no longer need to convert lone pairs to bi-radicals in solvation

@codecov
Copy link

codecov bot commented Sep 20, 2017

Codecov Report

Merging #1206 into master will decrease coverage by 0.27%.
The diff coverage is 8.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1206      +/-   ##
==========================================
- Coverage    43.8%   43.52%   -0.28%     
==========================================
  Files         170      170              
  Lines       28166    28242      +76     
  Branches     5496     5495       -1     
==========================================
- Hits        12338    12293      -45     
- Misses      14994    15116     +122     
+ Partials      834      833       -1
Impacted Files Coverage Δ
...inetics/families/Singlet_Val6_to_triplet/groups.py 100% <ø> (ø) ⬆️
.../test_data/testing_database/thermo/groups/group.py 100% <ø> (ø) ⬆️
.../testing_database/solvation/groups/nonacentered.py 100% <ø> (ø) ⬆️
...est_data/testing_database/thermo/groups/radical.py 100% <ø> (ø) ⬆️
...milies/intra_substitutionS_isomerization/groups.py 100% <ø> (ø) ⬆️
...ase/kinetics/families/Disproportionation/groups.py 100% <ø> (ø) ⬆️
...base/kinetics/families/Disproportionation/rules.py 100% <ø> (ø) ⬆️
rmgpy/molecule/parser.py 0% <ø> (ø) ⬆️
rmgpy/molecule/generator.py 0% <ø> (ø) ⬆️
...inetics/families/R_Addition_MultipleBond/groups.py 100% <ø> (ø) ⬆️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8236fc9...4e17060. Read the comment docs.

@nyee
Copy link
Contributor Author

nyee commented Sep 28, 2017

@goldmanm, @KEHANG I noticed that compiling the cython code after this PR's changes takes much longer. Do you guys have any idea why since you probably have the most cython experience?

@alongd alongd force-pushed the chargedAT branch 12 times, most recently from b953d14 to ee7c31e Compare October 3, 2017 01:08
@alongd alongd force-pushed the chargedAT branch 3 times, most recently from 9124fa7 to a3174a2 Compare October 11, 2017 14:16
@alongd
Copy link
Member

alongd commented Oct 11, 2017

@nyee , a possible cause to the slower code compilation is the large amount of new atomTypes. I merged some charged atomTypes which are only important for resonance structures but not for reactivity/thermo (many charged resonance structures will be filtered out in a future PR), and made the new list as short as possible...

@nyee
Copy link
Contributor Author

nyee commented Oct 11, 2017

@alongd, did it make much difference to the compilation speed? I know some other members have noticed compilation slow-downs unrelated to the atomtype changes, so it may not just be that.

alongd and others added 18 commits February 2, 2018 14:49
This method of generating all combination of atomtypes with all combination of charges/radicals
does not work anymore because we now define charge/radical by atomType. Although the previous test
was comprehensive, it also tested some unphysical combinations which are now forbidden (i.e., don't
have corresponding atomTypes). For now I just commented-out the tests.
Perhaps this should be revisited at some point.
Previously we would transform and lone pairs to biradicals in solvation thermo estimation.
Now that we have more specific atomTypes with lone pairs specified it is unnecessary,
although we may still lack the data for carbenes.

This commit avoids saturating lonePairs if the atomType of C is C2tc, which means the molecule is
carbon monoxide or isoelectronic to carbon monoxide.
This method is used to repalce radicals with an H for HBI corrections. The new name is less ambigious.
Now that we update chargedAtoms when we do Molecule.update(), some functions for the Heuristic ring poly ring corrections are broken. One thing that breaks is that previously correctly atomtyped atoms in submols get charges unless we saturate with Hs. This commit adds H saturation to these cases.

This block of code was added to the functions:

thermo.__addPolyRingCorrectionThermoDataFromHeuristic
thermo.getBicyclicCorrectionThermoDataFromHeuristic
Removed some trailing white space. Already refactored three functions:

saturate_radicals
saturate_unfilled_valence
saturate_rng_bonds

from camel case to underscores as agreed upon for style.
Regardless of the direction in generateN5dd_N5tsResonanceStructures(),
atom2 is always the one onto which the incrementLonePairs() action is
applied. This commit verifies that atom2 is not carbon so no carbenes
are formed.
The 'C#[O-]' structure is already forbidden since its O atom doesn't fit
any current atomType.
since it isn't physical from test_data NC chemkin file
O2sn is an oxygen atom with 2 lone pairs, 3 single bonds and a negative charge -1
mliu49
mliu49 previously approved these changes Feb 2, 2018
@mliu49
Copy link
Contributor

mliu49 commented Feb 2, 2018

Ok, you can remove the temporary commits here and on RMG-database. I'll merge both branches after that's done.

@alongd
Copy link
Member

alongd commented Feb 2, 2018

Done!
And thanks for all the reviewers of both repos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants