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