()
| 186 | function_mapping = {'CCLE':'process_CCLE', 'Customized':'process_Customized'} |
| 187 | |
| 188 | def process_CCLE(): |
| 189 | |
| 190 | def load_file(postfix): |
| 191 | if args.train_test_mode == 'fine_tune': |
| 192 | df = pd.read_csv(os.path.join(ROOT_DIR, 'data', 'cell_line_data','CCLE','CCLE_%s.csv' % postfix),sep=',') |
| 193 | else: |
| 194 | df = pd.read_csv(os.path.join(ROOT_DIR, 'data', 'cell_line_data','CCLE','CCLE_%s.csv' % postfix),sep=',') |
| 195 | |
| 196 | |
| 197 | ## need to transform mut into one-hot dataframe |
| 198 | if postfix == 'mut': |
| 199 | # remove entre_id which is 0 |
| 200 | mu = df.loc[df['Entrez_Gene_Id'].values !=0] |
| 201 | |
| 202 | # transform data to one_hot format |
| 203 | clean_cells_ALL = list(set(list(mu['DepMap_ID']))) |
| 204 | clean_genes_ALL = list(set(list(mu['Entrez_Gene_Id']))) |
| 205 | CCLE_mu = pd.DataFrame(one_hot(mu,clean_cells_ALL,clean_genes_ALL), columns=['Entrez gene id']+clean_genes_ALL) |
| 206 | |
| 207 | |
| 208 | # use entrez gene id as index |
| 209 | if postfix != "mut": |
| 210 | df.columns = ['Entrez gene id']+[split_it_cell(_) for _ in list(df.columns)[1:]] |
| 211 | df_transpose = df.T |
| 212 | # set first row as column |
| 213 | df_transpose.columns = df_transpose.iloc[0] |
| 214 | processed_data = df_transpose.drop(df_transpose.index[0]) |
| 215 | # use entrez gene id as index |
| 216 | if postfix != "mut": |
| 217 | if postfix == "GSVA_scores": |
| 218 | # X_tr, means1, std1, means2, std2, feat_filt = normalize(df, norm='tanh_norm') |
| 219 | # X_tr = pd.DataFrame(X_tr,columns=df.columns,index=df.index) |
| 220 | processed_data = df |
| 221 | |
| 222 | else: |
| 223 | df.columns = ['Entrez gene id']+[split_it_cell(_) for _ in list(df.columns)[1:]] |
| 224 | df_transpose = df.T |
| 225 | # set first row as column |
| 226 | df_transpose.columns = df_transpose.iloc[0] |
| 227 | processed_data = df_transpose.drop(df_transpose.index[0]) |
| 228 | |
| 229 | else: |
| 230 | ## same as exp |
| 231 | mu_transpose = CCLE_mu.T |
| 232 | # set first row as column |
| 233 | mu_transpose.columns = mu_transpose.iloc[0] |
| 234 | processed_data = mu_transpose.drop(mu_transpose.index[0]) |
| 235 | return processed_data |
| 236 | |
| 237 | # load all cell line features |
| 238 | save_path = os.path.join(ROOT_DIR, 'data', 'cell_line_data','CCLE') |
| 239 | save_path = os.path.join(save_path, 'input_cellline_data.npy') |
| 240 | if not os.path.exists(save_path): |
| 241 | data_dicts = {} |
| 242 | for file_type in ['exp', 'cn', 'mut']: |
| 243 | data_dicts[ file_type ] = load_file(file_type) |
| 244 | # load GNN_cell |
| 245 | gnn_path = os.path.join(ROOT_DIR, 'data', 'cell_line_data','CCLE') |
nothing calls this directly
no test coverage detected