changeset 243:5aaf15260ca6 draft

Uploaded
author francesco_lapi
date Wed, 15 Jan 2025 10:41:57 +0000
parents c6d78b0d324d
children ccb4ae0e01b3
files COBRAxy/flux_to_map.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/COBRAxy/flux_to_map.py	Wed Jan 15 10:32:09 2025 +0000
+++ b/COBRAxy/flux_to_map.py	Wed Jan 15 10:41:57 2025 +0000
@@ -869,6 +869,16 @@
         where=dataset.loc['EX_gln__L_e'].to_numpy() != 0
     )
 
+    # Controllo e sostituzione dei NaN con 0 se necessario
+    vectors = {'lact_glc': lact_glc, 'lact_gln': lact_gln, 'lact_o2': lact_o2, 'glu_gln': glu_gln}
+
+    for name, vector in vectors.items():
+        if np.all(np.isnan(vector)):  # Controlla se tutti i valori sono NaN
+            vectors[name] = np.zeros_like(vector)  # Sostituisci con un vettore di zeri
+
+    # Riassegna i vettori aggiornati
+    lact_glc, lact_gln, lact_o2, glu_gln = vectors['lact_glc'], vectors['lact_gln'], vectors['lact_o2'], vectors['glu_gln']
+
     # Create a DataFrame for the new rows
     new_rows = pd.DataFrame({
         dataset.index.name: ['LactGlc', 'LactGln','LactO2', 'GluGln'],