Example code discrepancies?

2012-11-07
2013-05-30
  • Hi, I'm trying to learn how to use pyCOBRA. I'm working on a windows 7 machine, used the extra_installers to install the dependencies, and then installed pyCOBRA using the cobra-0.2.0-py2.7.egg. I'm trying to run the example scripts found in the extras folder on the sourceforge site. When I use the code from examples.zip, examples 01, 02, 03, and 07 seem to work fine. However, when I try to run the 04 and 05 script, I get different values from the hardcoded expected values. It says the expected values for the two objectives are 0.380 and 0.845, whereas my outputs are 0.320064 and 2.505. Does this happen for other people? Also, when I try to run the 05 script I get the following warning:
    c:\Python27\lib\site-packages\cobra-0.2.0-py2.7.egg\cobra\core\Formula.py:150: UserWarning: The element 'R' is not in the weight_dict
      warn('The element %s is not in the weight_dict'%e)

    In addition, if I try to run the scripts found in tutorial_examples.zip in the mini_cobra_spring_2012 folder, I get the following error when I try to run the 03 script:
    Traceback (most recent call last):
      File "03_single_deletion.py", line 8, in <module>
        cobra_model = load(in_file)
    ImportError: No module named collections.DictList

    Is something wrong with my install?

     
  • Hi,
    I'm working on a Mac machine and when runnning the scripts found in the extra folders, I get exactly the same results with the examples 04 and 05, additionally I have the same warning with example 02 and also different results than the expected ones(simulated growth rate: 0.380, expected: 0.478).
    Would be happy about any hint that might help finding the problem

     
  • Hi, I'm working on a Mac machine and when runnning the scripts found in the extra folders, I get exactly the same results with the examples 04 and 05, additionally I have the same warning with example 02 and also different results than the expected ones(simulated growth rate: 0.380, expected: 0.478). Would be happy about any hint that might help finding the problem

    Actually I found kind of an explanation. I realised that my results from example 02 fits to the expected result of example 04 and 05. So I changed the model in 04 and 05 from 'salmonella_pickle' to 'salmonella_sbml' and I got the same results as are expected, although the warnings are still there. So maybe there was just a mixup in the expected results or in the models. The only thing left for me is the question why my results in example 02 are not as expected.

     
  • Daniel Hyduke
    Daniel Hyduke
    2012-12-10

    It's okay to have warnings, they arise from the convention of using specific letters to represent large or unknown composition. 

    I'll look into the numerical errors; based on what you've posted, they're likely the result of the values being calculated with different a different medium composition than's set in the pickle.