adpated combining_dfs.py and plotting.R for gid and attempting to make it generic
This commit is contained in:
parent
2c5c704d0b
commit
a1fef205da
3 changed files with 91 additions and 81 deletions
|
@ -57,10 +57,10 @@ from combining_FIXME import detect_common_cols
|
|||
from reference_dict import oneletter_aa_dict # CHECK DIR STRUC THERE!
|
||||
from reference_dict import low_3letter_dict # CHECK DIR STRUC THERE!
|
||||
#=======================================================================
|
||||
#%% command line args
|
||||
#%% command line args: case sensitive
|
||||
arg_parser = argparse.ArgumentParser()
|
||||
arg_parser.add_argument('-d', '--drug', help='drug name', default = 'pyrazinamide')
|
||||
arg_parser.add_argument('-g', '--gene', help='gene name', default = 'pncA') # case sensitive
|
||||
arg_parser.add_argument('-d', '--drug', help='drug name', default = '')
|
||||
arg_parser.add_argument('-g', '--gene', help='gene name', default = '')
|
||||
|
||||
arg_parser.add_argument('--datadir', help = 'Data Directory. By default, it assmumes homedir + git/Data')
|
||||
arg_parser.add_argument('-i', '--input_dir', help = 'Input dir containing pdb files. By default, it assmumes homedir + <drug> + input')
|
||||
|
@ -99,32 +99,37 @@ print('position regex:', pos_regex)
|
|||
# directories
|
||||
#==============
|
||||
if not datadir:
|
||||
datadir = homedir + '/' + 'git/Data'
|
||||
datadir = homedir + '/git/Data/'
|
||||
|
||||
if not indir:
|
||||
indir = datadir + '/' + drug + '/input'
|
||||
indir = datadir + drug + '/input/'
|
||||
|
||||
if not outdir:
|
||||
outdir = datadir + '/' + drug + '/output'
|
||||
outdir = datadir + drug + '/output/'
|
||||
|
||||
#=======
|
||||
# input
|
||||
#=======
|
||||
in_filename_mcsm = gene.lower() + '_complex_mcsm_norm.csv'
|
||||
#in_filename_mcsm = gene.lower() + '_complex_mcsm_norm.csv'
|
||||
in_filename_mcsm = gene.lower() + '_complex_mcsm_norm_SAM.csv' # gidb
|
||||
in_filename_foldx = gene.lower() + '_foldx.csv'
|
||||
in_filename_dssp = gene.lower() + '_dssp.csv'
|
||||
in_filename_kd = gene.lower() + '_kd.csv'
|
||||
in_filename_rd = gene.lower() + '_rd.csv'
|
||||
in_filename_snpinfo = 'ns' + gene.lower() + '_snp_info_f.csv'
|
||||
#in_filename_deepddg = gene.lower() + '_complex_ddg_results.txt' # change to decent filename and put it in the correct dir
|
||||
|
||||
in_filename_snpinfo = 'ns' + gene.lower() + '_snp_info_f.csv' # gwas f info
|
||||
in_filename_afor = gene.lower() + '_af_or.csv'
|
||||
in_filename_afor_kin = gene.lower() + '_af_or_kinship.csv'
|
||||
|
||||
|
||||
infile_mcsm = outdir + '/' + in_filename_mcsm
|
||||
infile_foldx = outdir + '/' + in_filename_foldx
|
||||
infile_dssp = outdir + '/' + in_filename_dssp
|
||||
infile_kd = outdir + '/' + in_filename_kd
|
||||
infile_rd = outdir + '/' + in_filename_rd
|
||||
infile_mcsm = outdir + in_filename_mcsm
|
||||
infile_foldx = outdir + in_filename_foldx
|
||||
infile_dssp = outdir + in_filename_dssp
|
||||
infile_kd = outdir + in_filename_kd
|
||||
infile_rd = outdir + in_filename_rd
|
||||
#infile_deepddg = outdir + in_filename_deepddg
|
||||
|
||||
infile_snpinfo = outdir + '/' + in_filename_snpinfo
|
||||
infile_afor = outdir + '/' + in_filename_afor
|
||||
infile_afor_kin = outdir + '/' + in_filename_afor_kin
|
||||
|
@ -135,7 +140,9 @@ print('\nInput path:', indir
|
|||
, '\nInput filename foldx:', infile_foldx, '\n'
|
||||
, '\nInput filename dssp:', infile_dssp
|
||||
, '\nInput filename kd:', infile_kd
|
||||
, '\nInput filename rd', infile_rd , '\n'
|
||||
, '\nInput filename rd', infile_rd
|
||||
# , '\nInput filename rd', infile_deepddg , '\n'
|
||||
|
||||
, '\nInput filename snp info:', infile_snpinfo, '\n'
|
||||
, '\nInput filename af or:', infile_afor
|
||||
, '\nInput filename afor kinship:', infile_afor_kin
|
||||
|
@ -225,10 +232,39 @@ print('\nResult of Fourth merge:', combined_df.shape
|
|||
, '\n===================================================================')
|
||||
combined_df[merging_cols_m4].apply(len)
|
||||
combined_df[merging_cols_m4].apply(len) == len(combined_df)
|
||||
|
||||
#%%============================================================================
|
||||
|
||||
# OR merges: TEDIOUSSSS!!!!
|
||||
#deepddg_df = pd.read_csv(infile_deepddg, sep = ' ')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#%%============================================================================
|
||||
# Output columns
|
||||
|
||||
out_filename_stab_struc = gene.lower() + '_comb_stab_struc_params.csv'
|
||||
outfile_stab_struc = outdir + '/' + out_filename_stab_struc
|
||||
print('Output filename:', outfile_stab_struc
|
||||
, '\n===================================================================')
|
||||
|
||||
# write csv
|
||||
print('Writing file: combined stability and structural parameters')
|
||||
combined_df.to_csv(outfile_stab_struc, index = False)
|
||||
print('\nFinished writing file:'
|
||||
, '\nNo. of rows:', combined_df.shape[0]
|
||||
, '\nNo. of cols:', combined_df.shape[1])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#%%============================================================================
|
||||
# OR merges: TEDIOUSSSS!!!!
|
||||
#[ DELETE ]
|
||||
del(mcsm_df, foldx_df, mcsm_foldx_dfs, dssp_kd_dfs, dssp_kd_rd_dfs,rd_df, kd_df, infile_mcsm, infile_foldx, infile_dssp, infile_kd)
|
||||
del(merging_cols_m1, merging_cols_m2, merging_cols_m3, merging_cols_m4)
|
||||
del(in_filename_dssp, in_filename_foldx, in_filename_kd, in_filename_mcsm, in_filename_rd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue