RMG-Java
RMG-Java copied to clipboard
RMG does not handle multiple kinetics from different rxn families properly
Take *CH2-CH2-CH2-CH2-OH as an example. When running this against all of RMG's reaction family templates, one set of products is: C2H4 + *CH2CH2OH.
One template that generates this reaction is Beta_Scission (reverse of R_Addition_MultipleBond). Another template that should generate this reaction is 1,2_Elimination_ROR (reverse of 1,3_Insertion_ROR).
However, when running RMG or PopulateReactions, RMG will only find one of these two, depending on which reaction family template is accessed first when reacting the species against all templates. The problem is that RMG will make the reaction via one of the rxn family templates (in current_reactions in TemplateReactionGenerator for those following at home) and then add this to the reaction_Set. The next instance of this reaction (with different kinetics) is made, placed in current_reactions, and then trys to add to reaction_Set. However, the .addAll() recognizes these two reactions as equal (based on the Reaction.equals() definition) and does not include it.
MRH is working on this now.
Documentation for this known issue may be found here: https://github.com/GreenGroup/RMG-Java/commit/5f5b0fce0264cb2d7ec562ded166434412214c11
MRH has removed the "3.2" tag and replaced it with "3.4 or later".
Each reaction that is an instance of TemplateReaction should have a reactionTemplate attribute that specifies which ReactionTemplate it came from. The equality check .equals() could insist that these, as well as the reaction structure, are equal. That may have unintended consequences elsewhere, which would have to be checked for. One possibility would be to just override the .equals() method for the TemplateReaction class and leave it alone for generic Reactions (in fact, you would have to do that, because generic Reactions and PDepReacitons do not have a reactionTemplate attribute).
This approach, however, would lead to duplicate reaction structures in the list. If we want to instead have unique reaction structures and add the kinetics, then something else has to be done.