comparison COBRAxy/ras_to_bounds.py @ 67:1f928ad6a87e draft

Uploaded
author luca_milaz
date Sun, 13 Oct 2024 09:01:06 +0000
parents b10da5046afd
children 067d3487ce58
comparison
equal deleted inserted replaced
66:c46df775b9fa 67:1f928ad6a87e
60 help = 'ras selector') 60 help = 'ras selector')
61 61
62 parser.add_argument('-cc', '--cell_class', 62 parser.add_argument('-cc', '--cell_class',
63 type = str, 63 type = str,
64 help = 'output of cell class') 64 help = 'output of cell class')
65
66 parser.add_argument('-rn', '--names',
67 required = True,
68 type=str,
69 help = 'ras class names')
65 70
66 ARGS = parser.parse_args() 71 ARGS = parser.parse_args()
67 return ARGS 72 return ARGS
68 73
69 ########################### warning ########################################### 74 ########################### warning ###########################################
214 219
215 ARGS.output_folder = 'ras_to_bounds/' 220 ARGS.output_folder = 'ras_to_bounds/'
216 221
217 if(ARGS.ras_selector == True): 222 if(ARGS.ras_selector == True):
218 ras_file_list = ARGS.input_ras.split(",") 223 ras_file_list = ARGS.input_ras.split(",")
224 ras_file_names = ARGS.names.split(",")
219 ras_class_names = [] 225 ras_class_names = []
220 for file in ras_file_list: 226 for file in ras_file_names:
221 ras_class_names.append(file.split(".")[0]) 227 ras_class_names.append(file.split(".")[0])
222 ras_list = [] 228 ras_list = []
223 class_assignments = pd.DataFrame(columns=["Patient_ID", "Class"]) 229 class_assignments = pd.DataFrame(columns=["Patient_ID", "Class"])
224 for ras_matrix, ras_class_name in zip(ras_file_list, ras_class_names): 230 for ras_matrix, ras_class_name in zip(ras_file_list, ras_class_names):
225 ras = read_dataset(ras_matrix, "ras dataset") 231 ras = read_dataset(ras_matrix, "ras dataset")