diff COBRAxy/ras_to_bounds.py @ 236:1e7a8da6c47a draft default tip

Uploaded
author luca_milaz
date Tue, 17 Dec 2024 15:38:56 +0000
parents c2ce7d75fceb
children
line wrap: on
line diff
--- 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]