Mercurial > repos > bimib > cobraxy
comparison COBRAxy/ras_to_bounds.py @ 118:6e1a6e480969 draft
Uploaded
author | luca_milaz |
---|---|
date | Sun, 13 Oct 2024 16:32:08 +0000 |
parents | 69190617d1ea |
children | 829ea241c3a1 |
comparison
equal
deleted
inserted
replaced
117:69190617d1ea | 118:6e1a6e480969 |
---|---|
176 | 176 |
177 Returns: | 177 Returns: |
178 pd.DataFrame: DataFrame containing the bounds of reactions in the model. | 178 pd.DataFrame: DataFrame containing the bounds of reactions in the model. |
179 """ | 179 """ |
180 rxns_ids = [rxn.id for rxn in model.reactions] | 180 rxns_ids = [rxn.id for rxn in model.reactions] |
181 | |
182 warning(str(model.reactions.get_by_id("EX_Lcystin_e").lower_bound)) | |
183 warning(str(model.reactions.get_by_id("EX_Lcystin_e").upper_bound)) | |
184 | 181 |
185 # Set medium conditions | 182 # Set medium conditions |
186 for reaction, value in medium.items(): | 183 for reaction, value in medium.items(): |
187 if value is not None: | 184 if value is not None: |
188 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): | 185 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): |
197 | 194 |
198 # Set FVA bounds | 195 # Set FVA bounds |
199 for reaction in rxns_ids: | 196 for reaction in rxns_ids: |
200 model.reactions.get_by_id(reaction).lower_bound = float(df_FVA.loc[reaction, "minimum"]) | 197 model.reactions.get_by_id(reaction).lower_bound = float(df_FVA.loc[reaction, "minimum"]) |
201 model.reactions.get_by_id(reaction).upper_bound = float(df_FVA.loc[reaction, "maximum"]) | 198 model.reactions.get_by_id(reaction).upper_bound = float(df_FVA.loc[reaction, "maximum"]) |
199 | |
200 warning(str(model.reactions.get_by_id("EX_Lcystin_e").lower_bound)) | |
201 warning(str(model.reactions.get_by_id("EX_Lcystin_e").upper_bound)) | |
202 | 202 |
203 if ras is not None: | 203 if ras is not None: |
204 #Parallel(n_jobs=cpu_count())(delayed(process_ras_cell)(cellName, ras_row, model, rxns_ids, output_folder) for cellName, ras_row in ras.iterrows()) | 204 #Parallel(n_jobs=cpu_count())(delayed(process_ras_cell)(cellName, ras_row, model, rxns_ids, output_folder) for cellName, ras_row in ras.iterrows()) |
205 for cellName, ras_row in ras.iterrows(): | 205 for cellName, ras_row in ras.iterrows(): |
206 process_ras_cell(cellName, ras_row, model, rxns_ids, mediumRxns_ids, output_folder) | 206 process_ras_cell(cellName, ras_row, model, rxns_ids, mediumRxns_ids, output_folder) |