Mercurial > repos > bimib > cobraxy
comparison COBRAxy/ras_to_bounds.py @ 218:8d1988935e1f draft
Uploaded
| author | luca_milaz |
|---|---|
| date | Sat, 14 Dec 2024 18:50:08 +0000 |
| parents | b162b98f9de5 |
| children | 264a10b57481 |
comparison
equal
deleted
inserted
replaced
| 217:f9deb464e6a6 | 218:8d1988935e1f |
|---|---|
| 156 Returns: | 156 Returns: |
| 157 None | 157 None |
| 158 """ | 158 """ |
| 159 bounds = pd.DataFrame([(rxn.lower_bound, rxn.upper_bound) for rxn in model.reactions], index=rxns_ids, columns=["lower_bound", "upper_bound"]) | 159 bounds = pd.DataFrame([(rxn.lower_bound, rxn.upper_bound) for rxn in model.reactions], index=rxns_ids, columns=["lower_bound", "upper_bound"]) |
| 160 new_bounds = apply_ras_bounds(bounds, ras_row) | 160 new_bounds = apply_ras_bounds(bounds, ras_row) |
| 161 if new_bounds.isnull().values.any(): | |
| 162 warning(f"RAS values for {cellName} contain NaN values. Skipping this cell.") | |
| 161 new_bounds.to_csv(output_folder + cellName + ".csv", sep='\t', index=True) | 163 new_bounds.to_csv(output_folder + cellName + ".csv", sep='\t', index=True) |
| 162 pass | 164 pass |
| 163 | 165 |
| 164 def generate_bounds(model: cobra.Model, medium: dict, ras=None, output_folder='output/') -> pd.DataFrame: | 166 def generate_bounds(model: cobra.Model, medium: dict, ras=None, output_folder='output/') -> pd.DataFrame: |
| 165 """ | 167 """ |
