import os import pandas as pd from ROC.get_fpr_tpr import PlotRoc foo = PlotRoc('/home/yangfang/GFICLEE/test_cel_gficlee/input/', '/home/yangfang/GFICLEE/test_cel_gficlee/output/', '/home/yangfang/GFICLEE/test_cel_gficlee/cel.genome_filter.txt', '/home/yangfang/GFICLEE/test_cel_gficlee/result/') # threshold thr = list(reversed([i / 1 for i in range(0, 25)])) thr2 = [-x / 1 for x in list(range(0, 30, 1))] thr.extend(thr2) all_tpr_fpr_precision, all_r = foo.start_roc(6, thr) foo.write_tpr_fpr( all_tpr_fpr_precision, '/home/yangfang/GFICLEE/test_cel_gficlee/cel_tpr_fpr_precision_gficlee.txt' ) foo.write_all( all_r, '/home/yangfang/GFICLEE/test_cel_gficlee/cel_tp_fp_tn_fn_gficlee.txt')
# all_res = list(filter(lambda f: not f.startswith('.'), os.listdir(os.path.join(input_path,i)))) # if all_res != []: # for j in all_res: # read_path = os.path.join(input_path,i + '/' + j) # data = pd.read_csv(read_path,sep='\t') # df = df.append(data,ignore_index=True) # df = df.sort_values('score', ascending=False) # df.to_csv(w_path_name,sep='\t',index=False) # # trans_gficlee(input_path='/home/yangfang/GFICLEE/test_corum_gficlee/result/', # out_path='/home/yangfang/GFICLEE/test_corum_gficlee/result_trans/',) #Second get fpr and tpr foo = PlotRoc('/home/yangfang/GFICLEE/test_corum_gficlee/input/', '/home/yangfang/GFICLEE/test_corum_gficlee/output/', '/home/yangfang/GFICLEE/test_corum_gficlee/human.corum.txt', '/home/yangfang/GFICLEE/test_corum_gficlee/result/') # threshold thr = list(reversed([i / 1 for i in range(0, 35)])) thr2 = [-x / 1 for x in list(range(0, 20, 1))] thr.extend(thr2) all_tpr_fpr_precision, all_r = foo.start_roc(6, thr) foo.write_tpr_fpr( all_tpr_fpr_precision, '/home/yangfang/GFICLEE/test_corum_gficlee/kegg_tpr_fpr_precision_corum.txt' ) foo.write_all( all_r,
# get ecm+ and llr re = data[[name, 'LLR']][data['ECM/ECM+'].isin(['ECM+'])] names = ['name', 'score'] re.columns = names re = re.sort_values('score', ascending=False) re.to_csv(w_path_name, sep='\t', index=False) trans_clime('/home/yangfang/GFICLEE/test_ncr_clime/result_all/', '/home/yangfang/GFICLEE/test_ncr_clime/result_all_trans/', 'Gene Symbol') #Second get fpr and tpr foo = PlotRoc('/home/yangfang/GFICLEE/test_ncr_clime/input/', '/home/yangfang/GFICLEE/test_ncr_clime/output/', '/home/yangfang/GFICLEE/test_ncr_clime/ncr.genome.txt', '/home/yangfang/GFICLEE/test_ncr_clime/result_all_trans/') # threshold thr = list(reversed([i / 1 for i in range(50)])) # thr = list(reversed([i / 1 for i in range(0, 20)])) # thr2 = [-x / 1 for x in list(range(0, 10))] # thr.extend(thr2) # thr = list(reversed([i/1 for i in range(0, 25)])) # thr2 = [-x / 2 for x in list(range(0, 20,1))] # thr.extend(thr2) # thr = [-x / 1 for x in list(range(50, 130,2))][-25:] # thr = list([i / 500 for i in range(60)])[0:30] all_tpr_fpr_precision, all_r = foo.start_roc(6, thr)
# read_path = os.path.join(input_path,i + '/' + j) # data = pd.read_csv(read_path,sep='\t') # df = df.append(data,ignore_index=True) # df = df.sort_values('score', ascending=False) # df.to_csv(w_path_name,sep='\t',index=False) # # trans_gficlee(input_path='/home/yangfang/GFICLEE/test_ath_gficlee/result/', # out_path='/home/yangfang/GFICLEE/test_ath_gficlee/result_trans/',) #Second get fpr and tpr foo = PlotRoc('/home/yangfang/GFICLEE/test_ath_gficlee/input/', '/home/yangfang/GFICLEE/test_ath_gficlee/output/', '/home/yangfang/GFICLEE/test_ath_gficlee/ath00001_5_filter.txt', '/home/yangfang/GFICLEE/test_ath_gficlee/result_5/') # threshold thr = list(reversed([i/1 for i in range(0, 35)])) thr2 = [-x / 1 for x in list(range(0, 30,1))] thr.extend(thr2) all_tpr_fpr_precision, all_r = foo.start_roc(6, thr) foo.write_tpr_fpr(all_tpr_fpr_precision, '/home/yangfang/GFICLEE/test_ath_gficlee/ath_tpr_fpr_precision_gficlee5.txt') foo.write_all(all_r, '/home/yangfang/GFICLEE/test_ath_gficlee/ath_tp_fp_tn_fn_gficlee5.txt')