Mercurial > repos > bimib > cobraxy
changeset 60:547942aa1a93 draft
Uploaded
author | luca_milaz |
---|---|
date | Sun, 13 Oct 2024 07:21:04 +0000 |
parents | d4162562c8f5 |
children | 455e8945d02a |
files | COBRAxy/ras_to_bounds.py |
diffstat | 1 files changed, 4 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/COBRAxy/ras_to_bounds.py Sun Oct 13 07:20:51 2024 +0000 +++ b/COBRAxy/ras_to_bounds.py Sun Oct 13 07:21:04 2024 +0000 @@ -58,11 +58,6 @@ required = True, type=utils.Bool("using_RAS"), help = 'ras selector') - - parser.add_argument('-c', '--classes', - type = str, - required = False, - help = 'input classes') parser.add_argument('-cc', '--cell_class', type = str, @@ -218,10 +213,9 @@ if(ARGS.ras_selector == True): ras_file_list = ARGS.input_ras.split(",") - if(len(ras_file_list)>1): - ras_class_names = [cls.strip() for cls in ARGS.classes.split(',')] - else: - ras_class_names = ["placeHolder"] + ras_class_names = [] + for file in ras_file_list: + ras_class_names.append(file.split(".")[0]) ras_list = [] class_assignments = pd.DataFrame(columns=["Patient_ID", "Class"]) for ras_matrix, ras_class_name in zip(ras_file_list, ras_class_names): @@ -232,7 +226,7 @@ ras = ras.astype(float) ras_list.append(ras) for patient_id in ras.index: - class_assignments = pd.concat([class_assignments, pd.DataFrame({"Patient_ID": ras.index, "Class": ras_class_name})]) + class_assignments = pd.concat([class_assignments, pd.DataFrame({"Patient_ID": patient_id, "Class": ras_class_name})]) # Concatenate all ras DataFrames into a single DataFrame