ModelSEED/Model-SEED-core — Issue #98: Problem with Biochemistry overwrite
Author: samseaver
Created: 2011-11-15 15:26:15+00:00
State: open

If mdl-importmodel is run with the overwrite option, but without a biochemistry source, then it has trouble switching from the FIGMODELTable objects to the ModelDB objects.

To recap, when the FIGMODELmodel object is created, and a biochemistry is present in the form of flat files, it loads the flat files as FIGModelTable objects. However, if the overwrite is called, then in FIGMODELmodel::GenerateModelProvenance, it will delete the flat files, and it should be able to re-create the flat files from the ModelDB.

However, when it deletes the flat files, it needs to remove the FIGMODELTable objects in the model, that represented the biochemistry source and reload the biochemistry from as ModelDB objects from the ModelDB database. This switch is not effectively performed, and thus, when an attempt is made to re-create the biochemistry, it is done so from the now-empty FIGMODELTable objects, and thus, no new biochemistry is created.

One thing of note, the function that is supposed to perform the switch: FIGMODELmodel::buildDBInterface() loads an array of configuration files/hashes. This array accumulates every time it is called, which in turn seems to indicate that $self->{_figmodel}->{_configSettings} contains duplicates, which could be causing the bug.