# HG changeset patch # User luca_milaz # Date 1728807929 0 # Node ID b10da5046afd05129628bdc67d1908b9921f2d3e # Parent 5302258f8262f4a9152c46ea63b51cd64cc80ebd Uploaded diff -r 5302258f8262 -r b10da5046afd COBRAxy/ras_to_bounds.py --- a/COBRAxy/ras_to_bounds.py Sun Oct 13 08:11:43 2024 +0000 +++ b/COBRAxy/ras_to_bounds.py Sun Oct 13 08:25:29 2024 +0000 @@ -123,7 +123,7 @@ scaling_factor = ras_row[reaction] lower_bound=model.reactions.get_by_id(reaction).lower_bound upper_bound=model.reactions.get_by_id(reaction).upper_bound - warning("Reaction: "+reaction+" Lower Bound: "+str(lower_bound)+" Upper Bound: "+str(upper_bound)+" Scaling Factor: "+str(scaling_factor)) + #warning("Reaction: "+reaction+" Lower Bound: "+str(lower_bound)+" Upper Bound: "+str(upper_bound)+" Scaling Factor: "+str(scaling_factor)) valMax=float((upper_bound)*scaling_factor) valMin=float((lower_bound)*scaling_factor) if upper_bound!=0 and lower_bound==0: @@ -185,9 +185,9 @@ rxn.upper_bound = float(df_FVA.loc[reaction, "maximum"]) if ras is not None: - #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) + 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) else: model_new = model.copy() apply_ras_bounds(model_new, pd.Series([1]*len(rxns_ids), index=rxns_ids), rxns_ids) @@ -233,7 +233,7 @@ # Concatenate all ras DataFrames into a single DataFrame - ras_combined = pd.concat(ras_list, axis=1) + ras_combined = pd.concat(ras_list, axis=0) # Normalize the RAS values by max RAS ras_combined = ras_combined.div(ras_combined.max(axis=0)) ras_combined = ras_combined.fillna(0)