Mercurial > repos > bimib > cobraxy
comparison COBRAxy/ras_to_bounds.py @ 108:22cebbdb4b6d draft
Uploaded
| author | luca_milaz | 
|---|---|
| date | Sun, 13 Oct 2024 14:35:39 +0000 | 
| parents | 58919e82d96e | 
| children | ba10ad78fc5f | 
   comparison
  equal
  deleted
  inserted
  replaced
| 107:58919e82d96e | 108:22cebbdb4b6d | 
|---|---|
| 173 pd.DataFrame: DataFrame containing the bounds of reactions in the model. | 173 pd.DataFrame: DataFrame containing the bounds of reactions in the model. | 
| 174 """ | 174 """ | 
| 175 rxns_ids = [rxn.id for rxn in model.reactions] | 175 rxns_ids = [rxn.id for rxn in model.reactions] | 
| 176 | 176 | 
| 177 # Set medium conditions | 177 # Set medium conditions | 
| 178 ''' | |
| 179 reactions_medium=model2.medium.keys() | |
| 180 for reaction in reactions_medium: | |
| 181 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): | |
| 182 model2.reactions.get_by_id(reaction).lower_bound=-float(ras_meta.loc[cell,"countmatrix_"+reaction]) | |
| 183 if(reaction == "EX_lac__L_e"): | |
| 184 model2.reactions.get_by_id(reaction).lower_bound=float(0.0) | |
| 185 ''' | |
| 186 for reaction, value in medium.items(): | 178 for reaction, value in medium.items(): | 
| 187 if value is not None: | 179 if value is not None: | 
| 188 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): | 180 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): | 
| 189 model.reactions.get_by_id(reaction).lower_bound = -float(value) | 181 model.reactions.get_by_id(reaction).lower_bound = -float(value) | 
| 190 if(reaction == "EX_lac__L_e"): | 182 if(reaction == "EX_lac__L_e"): | 
