File tree Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ def process_datasets(args):
357
357
outfile_path = args .WORKDIR .joinpath (
358
358
"data_out" ,
359
359
"x_data" ,
360
- "cancer_discretized_copy_number.tsv.tsv "
360
+ "cancer_discretized_copy_number.tsv"
361
361
)
362
362
(discretized_copy_number
363
363
.transpose ()
@@ -367,10 +367,37 @@ def process_datasets(args):
367
367
header = False
368
368
)
369
369
)
370
- # join the "meta data tables" like copynumber etc.
370
+
371
+ #-------------------------------------------------------------------
372
+ # create SMILES table
373
+ #-------------------------------------------------------------------
374
+
375
+ dfs_to_merge = {}
376
+ for data_set in data_sets :
377
+ if (data_sets [data_set ].experiments is not None
378
+ and data_sets [data_set ].drugs is not None
379
+ ):
380
+ dfs_to_merge [data_set ] = deepcopy (data_sets [data_set ].drugs )
381
+
382
+ concat_drugs = pd .concat (dfs_to_merge .values ())
383
+ out_df = concat_drugs [['improve_drug_id' ,'canSMILES' ]].drop_duplicates ()
384
+ out_df .rename (
385
+ columns = {'improve_drug_id' : 'improve_chem_id' },
386
+ inplace = True ,
387
+ )
388
+
389
+ outfile_path = args .WORKDIR .joinpath (
390
+ "data_out" ,
391
+ "x_data" ,
392
+ "drug_SMILES.tsv"
393
+ )
394
+ out_df .to_csv (
395
+ path_or_buf = outfile_path ,
396
+ sep = '\t ' ,
397
+ index = False ,
398
+ )
371
399
372
400
373
-
374
401
375
402
def split_data_sets (
376
403
args : dict ,
You can’t perform that action at this time.
0 commit comments