comparison COBRAxy/ras_to_bounds.py @ 61:455e8945d02a draft

Uploaded
author luca_milaz
date Sun, 13 Oct 2024 08:05:26 +0000
parents 547942aa1a93
children 14076662f687
comparison
equal deleted inserted replaced
60:547942aa1a93 61:455e8945d02a
224 ras.set_index("Reactions", drop=True, inplace=True) 224 ras.set_index("Reactions", drop=True, inplace=True)
225 ras = ras.T 225 ras = ras.T
226 ras = ras.astype(float) 226 ras = ras.astype(float)
227 ras_list.append(ras) 227 ras_list.append(ras)
228 for patient_id in ras.index: 228 for patient_id in ras.index:
229 class_assignments = pd.concat([class_assignments, pd.DataFrame({"Patient_ID": patient_id, "Class": ras_class_name})]) 229 class_assignments.loc[class_assignments.shape[0]] = [patient_id, ras_class_name]
230 230
231 231
232 # Concatenate all ras DataFrames into a single DataFrame 232 # Concatenate all ras DataFrames into a single DataFrame
233 ras_combined = pd.concat(ras_list, axis=1) 233 ras_combined = pd.concat(ras_list, axis=1)
234 # Normalize the RAS values by max RAS 234 # Normalize the RAS values by max RAS