# HG changeset patch
# User luca_milaz
# Date 1734449936 0
# Node ID 1e7a8da6c47ad2714fbd51cd970ead4020b9ab3f
# Parent  5c70439f2907622dbf6bff31d35ec24239589828
Uploaded

diff -r 5c70439f2907 -r 1e7a8da6c47a COBRAxy/ras_to_bounds.py
--- a/COBRAxy/ras_to_bounds.py	Tue Dec 17 11:09:55 2024 +0000
+++ b/COBRAxy/ras_to_bounds.py	Tue Dec 17 15:38:56 2024 +0000
@@ -239,8 +239,11 @@
             ras.set_index("Reactions", drop=True, inplace=True)
             ras = ras.T
             ras = ras.astype(float)
-            #append class name to patient id (dataframe index)
-            ras.index = [f"{idx}_{ras_class_name}" for idx in ras.index]
+            if(len(ras_file_list)>1):
+                #append class name to patient id (dataframe index)
+                ras.index = [f"{idx}_{ras_class_name}" for idx in ras.index]
+            else:
+                ras.index = [f"{idx}" for idx in ras.index]
             ras_list.append(ras)
             for patient_id in ras.index:
                 class_assignments.loc[class_assignments.shape[0]] = [patient_id, ras_class_name]