adding options to specify files by user
This commit is contained in:
parent
20bba2ad70
commit
fc4313045f
2 changed files with 43 additions and 15 deletions
|
@ -17,12 +17,24 @@ arg_parser.add_argument('-U', '--url', help='mCSM Server URL', default = 'ht
|
||||||
arg_parser.add_argument('-c', '--chain', help='Chain ID as per PDB, Case sensitive', default = 'A')
|
arg_parser.add_argument('-c', '--chain', help='Chain ID as per PDB, Case sensitive', default = 'A')
|
||||||
arg_parser.add_argument('-l','--ligand', help='Ligand ID as per PDB, Case sensitive. REQUIRED only in "submit" stage', default = None)
|
arg_parser.add_argument('-l','--ligand', help='Ligand ID as per PDB, Case sensitive. REQUIRED only in "submit" stage', default = None)
|
||||||
arg_parser.add_argument('-a','--affinity', help='Affinity in nM. REQUIRED only in "submit" stage', default = 0.99)
|
arg_parser.add_argument('-a','--affinity', help='Affinity in nM. REQUIRED only in "submit" stage', default = 0.99)
|
||||||
|
|
||||||
arg_parser.add_argument('-pdb','--pdb_file', help = 'PDB File')
|
arg_parser.add_argument('-pdb','--pdb_file', help = 'PDB File')
|
||||||
|
arg_parser.add_argument('-m','--mutation_file', help = 'Mutation File, mcsm style')
|
||||||
|
|
||||||
arg_parser.add_argument('--datadir', help = 'Data Directory. By default, it assmumes homedir + git/Data')
|
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')
|
arg_parser.add_argument('-i', '--input_dir', help = 'Input dir containing pdb files. By default, it assmumes homedir + <drug> + input')
|
||||||
arg_parser.add_argument('-o', '--output_dir', help = 'Output dir for results. By default, it assmes homedir + <drug> + output')
|
arg_parser.add_argument('-o', '--output_dir', help = 'Output dir for results. By default, it assmes homedir + <drug> + output')
|
||||||
|
|
||||||
|
# stage: submit, output url file
|
||||||
|
arg_parser.add_argument('--url_file', help = 'Output results url file. The result of stage "submit". By default, it creates a output result url file in the output dir: "output_dir + gene.lower() + _result_urls.txt")
|
||||||
|
|
||||||
|
# stage: get, intermediate mcsm output file
|
||||||
|
arg_parser.add_argument('--outfile_scraped', help = 'Output mcsm results scraped. The result of stage "get". By default, it creates an interim output file in the output dir: "output_dir + gene.lower() +_mcsm_output.csv")
|
||||||
|
|
||||||
|
# stage: format, formatted output with scaled values, etc
|
||||||
|
# FIXME: Don't call this stage until you have ALL the interim results for your snps as the normalisation will be affected!
|
||||||
|
arg_parser.add_argument('--outfile_formatted', help = 'Output mcsm results formatted. The result of stage "format". By default, it creates a formatted output file in the output dir: "output_dir + gene.lower() + _complex_mcsm_norm.csv")
|
||||||
|
|
||||||
arg_parser.add_argument('--debug', action='store_true', help = 'Debug Mode')
|
arg_parser.add_argument('--debug', action='store_true', help = 'Debug Mode')
|
||||||
|
|
||||||
args = arg_parser.parse_args()
|
args = arg_parser.parse_args()
|
||||||
|
@ -41,6 +53,11 @@ chain = args.chain
|
||||||
ligand = args.ligand
|
ligand = args.ligand
|
||||||
affinity = args.affinity
|
affinity = args.affinity
|
||||||
pdb_filename = args.pdb_file
|
pdb_filename = args.pdb_file
|
||||||
|
mutation_filename = args.mutation_file
|
||||||
|
|
||||||
|
result_urls = args.url_file
|
||||||
|
mcsm_output = args.outfile_scraped
|
||||||
|
outfile_format = args.outfile_formatted
|
||||||
|
|
||||||
datadir = args.datadir
|
datadir = args.datadir
|
||||||
indir = args.input_dir
|
indir = args.input_dir
|
||||||
|
@ -80,29 +97,39 @@ else:
|
||||||
|
|
||||||
infile_pdb = indir + '/' + in_filename_pdb
|
infile_pdb = indir + '/' + in_filename_pdb
|
||||||
|
|
||||||
in_filename_snps = gene.lower() + '_mcsm_snps.csv' #(outfile_mcsm_snps, from data_extraction.py)
|
#in_filename_snps = gene.lower() + '_mcsm_snps.csv' #(outfile_mcsm_snps, from data_extraction.py)
|
||||||
|
#infile_snps = outdir + '/' + in_filename_snps
|
||||||
|
|
||||||
|
if mutation_filename:
|
||||||
|
in_filename_snps = mutation_filename
|
||||||
|
else:
|
||||||
|
in_filename_snps = gene.lower() + '_mcsm_snps.csv'
|
||||||
|
|
||||||
infile_snps = outdir + '/' + in_filename_snps
|
infile_snps = outdir + '/' + in_filename_snps
|
||||||
|
|
||||||
#=======
|
#=======
|
||||||
# output
|
# output
|
||||||
#=======
|
#=======
|
||||||
# mcsm_results globals
|
# mcsm_results globals
|
||||||
result_urls_filename = gene.lower() + '_result_urls.txt'
|
if not result_url:
|
||||||
result_urls = outdir + '/' + result_urls_filename
|
result_urls_filename = gene.lower() + '_result_urls.txt'
|
||||||
if DEBUG:
|
result_urls = outdir + '/' + result_urls_filename
|
||||||
print('DEBUG: Result URLs:', result_urls)
|
if DEBUG:
|
||||||
|
print('DEBUG: Result URLs:', result_urls)
|
||||||
|
|
||||||
mcsm_output_filename = gene.lower() + '_mcsm_output.csv'
|
if not mcsm_output:
|
||||||
mcsm_output = outdir + '/' + mcsm_output_filename
|
mcsm_output_filename = gene.lower() + '_mcsm_output.csv'
|
||||||
if DEBUG:
|
mcsm_output = outdir + '/' + mcsm_output_filename
|
||||||
print('DEBUG: mCSM output CSV file:', mcsm_output)
|
if DEBUG:
|
||||||
|
print('DEBUG: mCSM output CSV file:', mcsm_output)
|
||||||
|
|
||||||
# format_results globals
|
# format_results globals
|
||||||
#out_filename_format = gene.lower() + '_mcsm_processed.csv'
|
#out_filename_format = gene.lower() + '_mcsm_processed.csv'
|
||||||
out_filename_format = gene.lower() + '_complex_mcsm_norm.csv'
|
if not outfile_format:
|
||||||
outfile_format = outdir + '/' + out_filename_format
|
out_filename_format = gene.lower() + '_complex_mcsm_norm.csv'
|
||||||
if DEBUG:
|
outfile_format = outdir + '/' + out_filename_format
|
||||||
print('DEBUG: formatted CSV output:', outfile_format)
|
if DEBUG:
|
||||||
|
print('DEBUG: formatted CSV output:', outfile_format)
|
||||||
#%%=====================================================================
|
#%%=====================================================================
|
||||||
def submit_mcsm():
|
def submit_mcsm():
|
||||||
# Example:
|
# Example:
|
||||||
|
|
|
@ -39,7 +39,7 @@ arg_parser.add_argument('--datadir', help = 'Data Directory. By default, it assm
|
||||||
arg_parser.add_argument('-i', '--input_dir', help = 'Input dir containing pdb files. By default, it assmumes homedir + <drug> + input')
|
arg_parser.add_argument('-i', '--input_dir', help = 'Input dir containing pdb files. By default, it assmumes homedir + <drug> + input')
|
||||||
arg_parser.add_argument('-o', '--output_dir', help = 'Output dir for results. By default, it assmes homedir + <drug> + output')
|
arg_parser.add_argument('-o', '--output_dir', help = 'Output dir for results. By default, it assmes homedir + <drug> + output')
|
||||||
|
|
||||||
arg_parser.add_argument('--debug', action ='store_true', help = 'Debug Mode')
|
arg_parser.add_argument('--debug', action ='store_true', help = 'Debug Mode') # not used atm
|
||||||
|
|
||||||
args = arg_parser.parse_args()
|
args = arg_parser.parse_args()
|
||||||
#%% variable assignment: input and output
|
#%% variable assignment: input and output
|
||||||
|
@ -68,7 +68,8 @@ if not outdir:
|
||||||
#=======
|
#=======
|
||||||
# input
|
# input
|
||||||
#=======
|
#=======
|
||||||
in_filename = 'merged_df3.csv'
|
#in_filename = 'merged_df3.csv'
|
||||||
|
in_filename = gene.lower() + '_complex_mcsm_norm.csv'
|
||||||
infile_merged_df3 = outdir + '/' + in_filename
|
infile_merged_df3 = outdir + '/' + in_filename
|
||||||
print('Input file: ', infile_merged_df3
|
print('Input file: ', infile_merged_df3
|
||||||
, '\n============================================================')
|
, '\n============================================================')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue