opencobra / cobrapy

COBRApy is a package for constraint-based modeling of metabolic networks.
http://opencobra.github.io/cobrapy/
GNU General Public License v2.0
465 stars 218 forks source link

ecoli_pickle does NOT contain media_compositions? #90

Closed kozo2 closed 10 years ago

kozo2 commented 10 years ago

I tried to get media from ecoli_pickle with cobrapy(GitHub HEAD), but it seems it does not contain "media_compositions". Is there any way to set "media_compositions" to ecoli model?


In [2]: sal_model = cobra.test.create_test_model(cobra.test.salmonella_pickle) 

In [3]: sal_model.media_compositions 
Out[27]: defaultdict(<type 'dict'>, {'LB': {'EX_ser__L_e': -5.0, 
'EX_dcyt_e': -5.0, 'EX_hg2_e': -1000.0, 'EX_ins_e': -5.0, 'EX_cd2_e': 
-1000.0, 'EX_nac_e': -5.0, 'EX_tungs_e': -1000.0, 'EX_glu__L_e': -5.0, 
'EX_trp__L_e': -5.0, 'EX_h_e': -100.0, 'EX_mobd_e': -1000.0, 
'EX_val__L_e': -5.0, 'EX_cobalt2_e': -1000.0, 'EX_so4_e': -1000.0, 
'EX_co2_e': -1000.0, 'EX_k_e': -1000.0, 'EX_cu2_e': -1000.0, 
'EX_zn2_e': -1000.0, 'EX_na1_e': -1000.0, 'EX_cl_e': -1000.0, 
'EX_leu__L_e': -5.0, 'EX_arg__L_e': -5.0, 'EX_pnto__R_e': -5.0, 
'EX_lys__L_e': -5.0, 'EX_ala__L_e': -5.0, 'EX_cbl1_e': -0.01, 
'EX_thr__L_e': -5.0, 'EX_fe3_e': -1000.0, 'EX_adn_e': -5.0, 'EX_pi_e': 
-1000.0, 'EX_thymd_e': -5.0, 'EX_mn2_e': -1000.0, 'EX_phe__L_e': -5.0, 
'EX_ura_e': -5.0, 'EX_dad__2_e': -5.0, 'EX_h2o_e': -100.0, 
'EX_aso3_e': -1000.0, 'EX_hxan_e': -5.0, 'EX_glc__D_e': -5.0, 
'EX_uri_e': -5.0, 'EX_his__L_e': -5.0, 'EX_o2_e': -18.5, 
'EX_pro__L_e': -5.0, 'EX_asp__L_e': -5.0, 'EX_gly_e': -5.0, 
'EX_fe2_e': -1000.0, 'EX_ca2_e': -1000.0, 'EX_mg2_e': -1000.0, 
'EX_cysi__L_e': -5.0, 'EX_tyr__L_e': -5.0, 'EX_met__L_e': -5.0, 
'EX_ile__L_e': -5.0}, 'Host': {'EX_dcyt_e': -5.0, 'EX_ins_e': -5.0, 
'EX_cobalt2_e': -10.0, 'EX_dmso_e': -1000.0, 'EX_so4_e': -1000.0, 
'EX_melib_e': -5.0, 'EX_glcn_e': -5.0, 'EX_uri_e': -5.0, 
'EX_rib__D_e': -5.0, 'EX_tungs_e': -10.0, 'EX_malt_e': -5.0, 
'EX_glu__L_e': -5.0, 'EX_arab__L_e': -5.0, 'EX_12ppd__S_e': -5.0, 
'EX_h_e': -100.0, 'EX_mobd_e': -10.0, 'EX_mnl_e': -5.0, 'EX_mg2_e': 
-10.0, 'EX_acnam_e': -5.0, 'EX_co2_e': -1000.0, 'EX_thm_e': -5.0, 
'EX_glcr_e': -5.0, 'EX_k_e': -10.0, 'EX_cu2_e': -10.0, 'EX_na1_e': 
-1000.0, 'EX_cbl1_e': -0.01, 'EX_cl_e': -1000.0, 'EX_sbt__D_e': -5.0, 
'EX_arg__L_e': -5.0, 'EX_pnto__R_e': -5.0, 'EX_lys__L_e': -5.0, 
'EX_fuc__L_e': -5.0, 'EX_ala__L_e': -5.0, 'EX_csn_e': -5.0, 
'EX_gal_e': -5.0, 'EX_crn_e': -5.0, 'EX_no3_e': -1000.0, 
'EX_thr__L_e': -5.0, 'EX_fe3_e': -10.0, 'EX_adn_e': -5.0, 'EX_pi_e': 
-1000.0, 'EX_glcur_e': -5.0, 'EX_thymd_e': -5.0, 'EX_mn2_e': -10.0, 
'EX_etha_e': -5.0, 'EX_galt_e': -5.0, 'EX_ura_e': -5.0, 'EX_dad__2_e': 
-5.0, 'EX_gsn_e': -5.0, 'EX_h2o_e': -100.0, 'EX_hxan_e': -5.0, 
'EX_glc__D_e': -5.0, 'EX_galct__D_e': -5.0, 'EX_his__L_e': -5.0, 
'EX_met__L_e': -5.0, 'EX_o2_e': -18.5, 'EX_asn__L_e': -5.0, 
'EX_pro__L_e': -5.0, 'EX_acgam_e': -5.0, 'EX_so3_e': -1000.0, 
'EX_cys__L_e': -5.0, 'EX_rmn_e': -5.0, 'EX_ca2_e': -10.0, 
'EX_val__L_e': -5.0, 'EX_man_e': -5.0, 'EX_zn2_e': -10.0, 
'EX_leu__L_e': -5.0, 'EX_fru_e': -5.0, 'EX_fe2_e': -10.0, 
'EX_alltn_e': -5.0, 'EX_galctn__D_e': -5.0, 'EX_ile__L_e': -5.0}, 
'M9': {'EX_cobalt2_e': -1000.0, 'EX_tungs_e': -1000.0, 'EX_h_e': 
-100.0, 'EX_mobd_e': -1000.0, 'EX_mg2_e': -1000.0, 'EX_so4_e': 
-1000.0, 'EX_co2_e': -1000.0, 'EX_k_e': -1000.0, 'EX_fe3_e': -1000.0, 
'EX_na1_e': -1000.0, 'EX_cl_e': -1000.0, 'EX_cu2_e': -1000.0, 
'EX_nh4_e': -1000.0, 'EX_fe2_e': -1000.0, 'EX_cbl1_e': -0.01, 
'EX_pi_e': -1000.0, 'EX_mn2_e': -1000.0, 'EX_h2o_e': -100.0, 
'EX_glc__D_e': -5.0, 'EX_o2_e': -18.5, 'EX_ca2_e': -1000.0, 
'EX_zn2_e': -1000.0}, 'LPM': {'EX_ca2_e': -0.005, 'EX_cit_e': -0.0005, 
'EX_h_e': -100, 'EX_mobd_e': -0.005, 'EX_o2_e': -18.5, 'EX_cobalt2_e': 
-0.005, 'EX_mg2_e': -0.008, 'EX_thm_e': -2.9649835443413292e-08, 
'EX_so4_e': -1.0, 'EX_glyc_e': -41.04680204148116, 'EX_co2_e': -18.5, 
'EX_pi_e': -0.337, 'EX_k_e': -6.0, 'EX_cu2_e': -0.005, 'EX_cl_e': 
-5.016, 'EX_zn2_e': -0.005, 'EX_h2o_e': -1000, 'EX_nh4_e': -15.0, 
'EX_mn2_e': -0.005, 'EX_fe3_e': -0.005}, 'MgM': {'EX_ser__L_e': 
-0.3115, 'EX_cobalt2_e': -0.01, 'EX_glu__L_e': -0.802, 'EX_glyc_e': 
-38.0, 'EX_h_e': -100, 'EX_mobd_e': -0.01, 'EX_val__L_e': -0.3, 
'EX_so4_e': -8.0, 'EX_co2_e': -18.5, 'EX_k_e': -7.002685538757439, 
'EX_fe3_e': -0.01, 'EX_na1_e': -0.551983923305118, 'EX_cl_e': 
-5.645853297492152, 'EX_leu__L_e': -0.4385, 'EX_arg__L_e': -0.1135, 
'EX_nh4_e': -0.3545, 'EX_tyr__L_e': -0.0035, 'EX_lys__L_e': -0.3245, 
'EX_ala__L_e': -0.22, 'EX_thr__L_e': -0.2085, 'EX_pi_e': -1.0, 
'EX_mn2_e': -0.01, 'EX_phe__L_e': -0.0455, 'EX_h2o_e': -1000, 
'EX_his__L_e': -0.097, 'EX_o2_e': -18.5, 'EX_pro__L_e': -0.6185, 
'EX_asp__L_e': -0.3285, 'EX_gly_e': -0.1555, 'EX_cys__L_e': -0.0145, 
'EX_cu2_e': -0.01, 'EX_ca2_e': -0.0020709616248315785, 'EX_mg2_e': 
-0.008098333676198314, 'EX_zn2_e': -0.01, 'EX_met__L_e': -0.1125, 
'EX_ile__L_e': -0.196}}) 

In [4]: eco_model = cobra.test.create_test_model(cobra.test.ecoli_pickle) 

In [5]: eco_model.media_compositions 
--------------------------------------------------------------------------- 
AttributeError                            Traceback (most recent call last) 
<ipython-input-29-5df76f76ba9e> in <module>() 
----> 1 eco_model.media_compositions 

AttributeError: 'Model' object has no attribute 'media_compositions' 

In [6]: 
aebrahim commented 10 years ago

The E. coli model does not come with multiple media compositions. To simulate a media composition, set all exchange fluxes appropriately.

2014-05-11 21:23 GMT-07:00 Kozo Nishida notifications@github.com:

I tried to get media from ecoli_pickle with cobrapy(GitHub HEAD), but it seems it does not contain "media_compositions". Is there any way to set "media_compositions" to ecoli model?

In [2]: sal_model = cobra.test.create_test_model(cobra.test.salmonella_pickle)

In [3]: sal_model.media_compositions Out[27]: defaultdict(, {'LB': {'EX_serL_e': -5.0, 'EX_dcyt_e': -5.0, 'EX_hg2_e': -1000.0, 'EX_ins_e': -5.0, 'EX_cd2_e': -1000.0, 'EX_nac_e': -5.0, 'EX_tungs_e': -1000.0, 'EX_gluL_e': -5.0, 'EX_trpL_e': -5.0, 'EX_h_e': -100.0, 'EX_mobd_e': -1000.0, 'EX_valL_e': -5.0, 'EX_cobalt2_e': -1000.0, 'EX_so4_e': -1000.0, 'EX_co2_e': -1000.0, 'EX_k_e': -1000.0, 'EX_cu2_e': -1000.0, 'EX_zn2_e': -1000.0, 'EX_na1_e': -1000.0, 'EX_cl_e': -1000.0, 'EX_leuL_e': -5.0, 'EX_argL_e': -5.0, 'EX_pntoR_e': -5.0, 'EX_lysL_e': -5.0, 'EX_alaL_e': -5.0, 'EX_cbl1_e': -0.01, 'EX_thrL_e': -5.0, 'EX_fe3_e': -1000.0, 'EX_adn_e': -5.0, 'EX_pi_e': -1000.0, 'EX_thymd_e': -5.0, 'EX_mn2_e': -1000.0, 'EX_pheL_e': -5.0, 'EX_ura_e': -5.0, 'EX_dad2_e': -5.0, 'EX_h2o_e': -100.0, 'EX_aso3_e': -1000.0, 'EX_hxan_e': -5.0, 'EX_glcD_e': -5.0, 'EX_uri_e': -5.0, 'EX_hisL_e': -5.0, 'EX_o2_e': -18.5, 'EX_proL_e': -5.0, 'EX_aspL_e': -5.0, 'EX_gly_e': -5.0, 'EX_fe2_e': -1000.0, 'EX_ca2_e': -1000.0, 'EX_mg2_e': -1000.0, 'EX_cysiL_e': -5.0, 'EX_tyrL_e': -5.0, 'EX_metL_e': -5.0, 'EX_ileL_e': -5.0}, 'Host': {'EX_dcyt_e': -5.0, 'EX_ins_e': -5.0, 'EX_cobalt2_e': -10.0, 'EX_dmso_e': -1000.0, 'EX_so4_e': -1000.0, 'EX_melib_e': -5.0, 'EX_glcn_e': -5.0, 'EX_uri_e': -5.0, 'EX_ribD_e': -5.0, 'EX_tungs_e': -10.0, 'EX_malt_e': -5.0, 'EX_gluL_e': -5.0, 'EX_arabL_e': -5.0, 'EX_12ppdS_e': -5.0, 'EX_h_e': -100.0, 'EX_mobd_e': -10.0, 'EX_mnl_e': -5.0, 'EX_mg2_e': -10.0, 'EX_acnam_e': -5.0, 'EX_co2_e': -1000.0, 'EX_thm_e': -5.0, 'EX_glcr_e': -5.0, 'EX_k_e': -10.0, 'EX_cu2_e': -10.0, 'EX_na1_e': -1000.0, 'EX_cbl1_e': -0.01, 'EX_cl_e': -1000.0, 'EX_sbtD_e': -5.0, 'EX_argL_e': -5.0, 'EX_pntoR_e': -5.0, 'EX_lysL_e': -5.0, 'EX_fucL_e': -5.0, 'EX_alaL_e': -5.0, 'EX_csn_e': -5.0, 'EX_gal_e': -5.0, 'EX_crn_e': -5.0, 'EX_no3_e': -1000.0, 'EX_thrL_e': -5.0, 'EX_fe3_e': -10.0, 'EX_adn_e': -5.0, 'EX_pi_e': -1000.0, 'EX_glcur_e': -5.0, 'EX_thymd_e': -5.0, 'EX_mn2_e': -10.0, 'EX_etha_e': -5.0, 'EX_galt_e': -5.0, 'EX_ura_e': -5.0, 'EX_dad2_e': -5.0, 'EX_gsn_e': -5.0, 'EX_h2o_e': -100.0, 'EX_hxan_e': -5.0, 'EX_glcD_e': -5.0, 'EX_galctD_e': -5.0, 'EX_hisL_e': -5.0, 'EX_metL_e': -5.0, 'EX_o2_e': -18.5, 'EX_asnL_e': -5.0, 'EX_proL_e': -5.0, 'EX_acgam_e': -5.0, 'EX_so3_e': -1000.0, 'EX_cysL_e': -5.0, 'EX_rmn_e': -5.0, 'EX_ca2_e': -10.0, 'EX_valL_e': -5.0, 'EX_man_e': -5.0, 'EX_zn2_e': -10.0, 'EX_leuL_e': -5.0, 'EX_fru_e': -5.0, 'EX_fe2_e': -10.0, 'EX_alltn_e': -5.0, 'EX_galctnD_e': -5.0, 'EX_ileL_e': -5.0}, 'M9': {'EX_cobalt2_e': -1000.0, 'EX_tungs_e': -1000.0, 'EX_h_e': -100.0, 'EX_mobd_e': -1000.0, 'EX_mg2_e': -1000.0, 'EX_so4_e': -1000.0, 'EX_co2_e': -1000.0, 'EX_k_e': -1000.0, 'EX_fe3_e': -1000.0, 'EX_na1_e': -1000.0, 'EX_cl_e': -1000.0, 'EX_cu2_e': -1000.0, 'EX_nh4_e': -1000.0, 'EX_fe2_e': -1000.0, 'EX_cbl1_e': -0.01, 'EX_pi_e': -1000.0, 'EX_mn2_e': -1000.0, 'EX_h2o_e': -100.0, 'EX_glcD_e': -5.0, 'EX_o2_e': -18.5, 'EX_ca2_e': -1000.0, 'EX_zn2_e': -1000.0}, 'LPM': {'EX_ca2_e': -0.005, 'EX_cit_e': -0.0005, 'EX_h_e': -100, 'EX_mobd_e': -0.005, 'EX_o2_e': -18.5, 'EX_cobalt2_e': -0.005, 'EX_mg2_e': -0.008, 'EX_thm_e': -2.9649835443413292e-08, 'EX_so4_e': -1.0, 'EX_glyc_e': -41.04680204148116, 'EX_co2_e': -18.5, 'EX_pi_e': -0.337, 'EX_k_e': -6.0, 'EX_cu2_e': -0.005, 'EX_cl_e': -5.016, 'EX_zn2_e': -0.005, 'EX_h2o_e': -1000, 'EX_nh4_e': -15.0, 'EX_mn2_e': -0.005, 'EX_fe3_e': -0.005}, 'MgM': {'EX_serL_e': -0.3115, 'EX_cobalt2_e': -0.01, 'EX_gluL_e': -0.802, 'EX_glyc_e': -38.0, 'EX_h_e': -100, 'EX_mobd_e': -0.01, 'EX_valL_e': -0.3, 'EX_so4_e': -8.0, 'EX_co2_e': -18.5, 'EX_k_e': -7.002685538757439, 'EX_fe3_e': -0.01, 'EX_na1_e': -0.551983923305118, 'EX_cl_e': -5.645853297492152, 'EX_leuL_e': -0.4385, 'EX_argL_e': -0.1135, 'EX_nh4_e': -0.3545, 'EX_tyrL_e': -0.0035, 'EX_lysL_e': -0.3245, 'EX_alaL_e': -0.22, 'EX_thrL_e': -0.2085, 'EX_pi_e': -1.0, 'EX_mn2_e': -0.01, 'EX_pheL_e': -0.0455, 'EX_h2o_e': -1000, 'EX_hisL_e': -0.097, 'EX_o2_e': -18.5, 'EX_proL_e': -0.6185, 'EX_aspL_e': -0.3285, 'EX_gly_e': -0.1555, 'EX_cysL_e': -0.0145, 'EX_cu2_e': -0.01, 'EX_ca2_e': -0.0020709616248315785, 'EX_mg2_e': -0.008098333676198314, 'EX_zn2_e': -0.01, 'EX_metL_e': -0.1125, 'EX_ileL_e': -0.196}})

In [4]: eco_model = cobra.test.create_test_model(cobra.test.ecoli_pickle) In [5]: eco_model.media_compositions

AttributeError Traceback (most recent call last) in () ----> 1 eco_model.media_compositions

AttributeError: 'Model' object has no attribute 'media_compositions'

In [6]:

— Reply to this email directly or view it on GitHubhttps://github.com/opencobra/cobrapy/issues/90 .

kozo2 commented 10 years ago

Is there flux data about this paper? (or I have to set the bounds manually?) http://msb.embopress.org/content/7/1/535.long

aebrahim commented 10 years ago

You will have to change the bounds for the exchange reactions corresponding to the media conditions you want to simulate.

kozo2 commented 10 years ago

So it means there is no reusable (published) medium data for iJO1366?

aebrahim commented 10 years ago

Hello Kozo,

A few things:

1) On a more procedural note, this is a bug tracker for cobrapy. Because this isn't really a bug, the google group mailing list (http://groups.google.com/group/cobra-pie) is a more appropriate place to ask how to set reaction bounds to match media.

2) The default bounds in iJO1366 are set to match growth on glucose (minimal media), as described in the "Constraint-based modeling" section of the paper. If you wish to model other growth substrates, you will have to set exchanges appropriately yourself... I'm not sure of any central repository for those.

kozo2 commented 10 years ago

Hello Ali,

1) OK, I move to cobra-pie ML. 2) Thank you for all the information. It was very helpful. I will ask Orth about iJO medium.