@@ -184,12 +184,12 @@ def AUC(time, volume, time_normalize=True):
184184 dict: Dictionary containing the AUC value.
185185 """
186186 auc = trapz_auc (time , volume )
187- print ('at line 187' )
188- print (time .shape )
189- print (time .dtype )
190- print (np .max (time .astype (int )))
191- print ('auc is : ' )
192- print (auc )
187+ # print('at line 187')
188+ # print(time.shape)
189+ # print(time.dtype)
190+ # print(np.max(time.astype(int)))
191+ # print('auc is : ')
192+ # print(auc)
193193 if time_normalize :
194194 auc = auc / np .max (time )
195195 return {"metric" : "auc" , "value" : auc , 'time' :np .max (time )}
@@ -292,7 +292,7 @@ def lmm(time, volume, treatment, drug_name):
292292 #interaction_term = 'time:exp_type'
293293# if interaction_term in fit.params:
294294# time_coef_value = fit.params['time']
295- print (fit .params )
295+ # print(fit.params)
296296 i_coef_value = fit .params ['time:exp_type[T.' + drug_name + ']' ]
297297 #i_coef_value = fit.params['time:exp_type['+drug_name+']']
298298 # else:
@@ -312,6 +312,8 @@ def main():
312312 parser .add_argument ('curvefile' )
313313 parser .add_argument ('--drugfile' )
314314 parser .add_argument ('--outprefix' ,default = '/tmp/' )
315+ parser .add_argument ('--study' )
316+ parser .add_argument ('--source' )
315317
316318 args = parser .parse_args ()
317319
@@ -325,22 +327,21 @@ def main():
325327 expsing = expsing .dropna ()
326328
327329 # source improve_sample_id improve_drug_id study time time_unit dose_response_metric dose_response_value
328-
329- combos [['drug1' ,'drug2' ]]= combos .drug .str .split ('+' ,expand = True )
330- print ('COMBOS ARE: ' )
331- print (combos [['drug1' , 'drug2' ]])
332- combos = combos .rename ({'metric' :'drug_combination_metric' ,'value' :'drug_combination_value' ,'sample' :'improve_sample_id' },axis = 1 ).dropna ()
333-
334- expcomb = combos .rename ({'drug1' :'chem_name' },axis = 1 ).merge (drugs ,on = 'chem_name' ,how = 'left' ).rename ({'improve_drug_id' :'improve_drug_1' },axis = 1 )[['improve_drug_1' ,'drug2' ,'improve_sample_id' ,'time_unit' ,'time' ,'drug_combination_metric' ,'drug_combination_value' ]]
335- expcomb = expcomb .rename ({'drug2' :'chem_name' },axis = 1 ).merge (drugs ,on = 'chem_name' ,how = 'left' ).rename ({'improve_drug_id' :'improve_drug_2' },axis = 1 )[['improve_drug_1' ,'improve_drug_2' ,'improve_sample_id' ,'time_unit' ,'time' ,'drug_combination_metric' ,'drug_combination_value' ]]
336- print (expcomb [['improve_drug_1' , 'improve_drug_2' ]])
337- expcomb [['source' ]]= 'Synapse'
338- expcomb [['study' ]]= 'MPNST PDX in vivo'
339-
340- expsing [['source' ]]= 'Synapse'
341- expsing [['study' ]]= 'MPNST PDX in vivo'
330+ if combos .shape [0 ]> 0 :
331+ combos [['drug1' ,'drug2' ]]= combos ['drug' ].str .split ('+' ,expand = True )
332+
333+ combos = combos .rename ({'metric' :'drug_combination_metric' ,'value' :'drug_combination_value' ,'sample' :'improve_sample_id' },axis = 1 ).dropna ()
334+
335+ expcomb = combos .rename ({'drug1' :'chem_name' },axis = 1 ).merge (drugs ,on = 'chem_name' ,how = 'left' ).rename ({'improve_drug_id' :'improve_drug_1' },axis = 1 )[['improve_drug_1' ,'drug2' ,'improve_sample_id' ,'time_unit' ,'time' ,'drug_combination_metric' ,'drug_combination_value' ]]
336+ expcomb = expcomb .rename ({'drug2' :'chem_name' },axis = 1 ).merge (drugs ,on = 'chem_name' ,how = 'left' ).rename ({'improve_drug_id' :'improve_drug_2' },axis = 1 )[['improve_drug_1' ,'improve_drug_2' ,'improve_sample_id' ,'time_unit' ,'time' ,'drug_combination_metric' ,'drug_combination_value' ]]
337+ expcomb [['source' ]]= args .source
338+ expcomb [['study' ]]= args .study
339+ expcomb .to_csv (args .outprefix + '_combinations.tsv' ,index = False , sep = "\t " )
340+
341+ expsing [['source' ]]= args .source
342+ expsing [['study' ]]= args .study
342343 expsing .to_csv (args .outprefix + '_experiments.tsv' ,index = False , sep = "\t " )
343- expcomb .to_csv (args .outprefix + '_combinations.tsv' ,index = False , sep = "\t " )
344+ # expcomb.to_csv(args.outprefix+'_combinations.tsv',index=False, sep="\t")
344345
345346
346347
0 commit comments