comocheng / kineticmodelssite

a django site for kinetic models
4 stars 9 forks source link

Fail reaction imports when there are no reactants or no products #126

Closed kiancm closed 4 years ago

kiancm commented 4 years ago

I noticed in previous runs of the importer script that some reactions ended up with no reactants or no products. This change adds a check for that and fails the import of the reaction if that is the case. Additionally, the flow of the reaction import has been changed to search for the reaction given stoichiometry data first, then creates the reaction if it is not found. When the reaction is being created, all of the stoichiometric data is added before saving to prevent reaction uniqueness validation issues that arise when the stoichiometries are partially saved and conflict with another existing reaction.