# HG changeset patch # User luca_milaz # Date 1728828413 0 # Node ID 58919e82d96e9226181c389a93364c1485ee92f9 # Parent 1629671d4ca60d8cfd3f62fe2f59c641989be3bd Uploaded diff -r 1629671d4ca6 -r 58919e82d96e COBRAxy/ras_to_bounds.py --- a/COBRAxy/ras_to_bounds.py Sun Oct 13 14:01:03 2024 +0000 +++ b/COBRAxy/ras_to_bounds.py Sun Oct 13 14:06:53 2024 +0000 @@ -185,7 +185,11 @@ ''' for reaction, value in medium.items(): if value is not None: - model.reactions.get_by_id(reaction).lower_bound = -float(value) + if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): + model.reactions.get_by_id(reaction).lower_bound = -float(value) + if(reaction == "EX_lac__L_e"): + model.reactions.get_by_id(reaction).lower_bound = float(0.0) + # Perform Flux Variability Analysis (FVA) df_FVA = cobra.flux_analysis.flux_variability_analysis(model, fraction_of_optimum=0, processes=1).round(8) @@ -199,7 +203,7 @@ #Parallel(n_jobs=cpu_count())(delayed(process_ras_cell)(cellName, ras_row, model, rxns_ids, output_folder) for cellName, ras_row in ras.iterrows()) for cellName, ras_row in ras.iterrows(): process_ras_cell(cellName, ras_row, model, rxns_ids, output_folder) - break + break #just one cell for testing else: model_new = model.copy() apply_ras_bounds(model_new, pd.Series([1]*len(rxns_ids), index=rxns_ids), rxns_ids)