From 50cf6ca3acec186ea55a13a3f42b6a21fcd1f7e5 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Fri, 6 Aug 2021 19:09:29 +0100 Subject: [PATCH] ran submit and get_results for one last batch for mcsm_na and did some bash formatting to get proper filenames, etc. --- mcsm/mcsm.py | 30 +++++++++++++++++++++++++++++- mcsm_na/get_results_mcsm_na.py | 2 +- mcsm_na/run_get_results_mcsm_na.py | 5 +++-- mcsm_na/run_submit_mcsm_na.py | 8 +++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/mcsm/mcsm.py b/mcsm/mcsm.py index 1adf57c..817089c 100644 --- a/mcsm/mcsm.py +++ b/mcsm/mcsm.py @@ -359,7 +359,19 @@ def format_mcsm_output(mcsm_outputcsv): print('Raw duet scores:\n', mcsm_data['duet_stability_change'] , '\n---------------------------------------------------------------' , '\nScaled duet scores:\n', mcsm_data['duet_scaled']) - +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# additional check added + c2 = mcsm_data[mcsm_data['duet_scaled']>=0].count() + DUET_pos2 = c2.get(key = 'duet_scaled') + + if DUET_pos == DUET_pos2: + print('\nPASS: DUET values scaled correctly') + else: + print('\nFAIL: DUET values scaled numbers MISmatch' + , '\nExpected number:', DUET_pos + , '\nGot:', DUET_pos2 + , '\n======================================================') +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #%%===================================================================== ############# # scale affinity values @@ -375,6 +387,22 @@ def format_mcsm_output(mcsm_outputcsv): print('Raw affinity scores:\n', mcsm_data['ligand_affinity_change'] , '\n---------------------------------------------------------------' , '\nScaled affinity scores:\n', mcsm_data['affinity_scaled']) +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# additional check added + c_lig = mcsm_data[mcsm_data['ligand_affinity_change']>=0].count() + Lig_pos = c_lig.get(key = 'ligand_affinity_change') + + c_lig2 = mcsm_data[mcsm_data['affinity_scaled']>=0].count() + Lig_pos2 = c_lig2.get(key = 'affinity_scaled') + + if Lig_pos == Lig_pos2: + print('\nPASS: Ligand affintiy values scaled correctly') + else: + print('\nFAIL: Ligand affinity values scaled numbers MISmatch' + , '\nExpected number:', Lig_pos + , '\nGot:', Lig_pos2 + , '\n======================================================') +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #%%===================================================================== ############# diff --git a/mcsm_na/get_results_mcsm_na.py b/mcsm_na/get_results_mcsm_na.py index 75a7721..ac87ac9 100644 --- a/mcsm_na/get_results_mcsm_na.py +++ b/mcsm_na/get_results_mcsm_na.py @@ -40,7 +40,7 @@ def get_results(url_file, host_url, output_dir, outfile_suffix): txt_url = f"{host_url}/mcsm_na/static/results/" + prediction_number + '.txt' print('CHECK txt url:', txt_url) - out_filename = mcsm_na_results_dir + '/' + outfile_suffix + '_output_' + prediction_number + '.txt' + out_filename = mcsm_na_results_dir + '/' + outfile_suffix + '_output_' + prediction_number + '.txt.gz' response_txt = requests.get(txt_url, stream = True) if response_txt.status_code == 200: print('\nDownloading .txt:', txt_url diff --git a/mcsm_na/run_get_results_mcsm_na.py b/mcsm_na/run_get_results_mcsm_na.py index 0a0b83c..3d619c7 100755 --- a/mcsm_na/run_get_results_mcsm_na.py +++ b/mcsm_na/run_get_results_mcsm_na.py @@ -23,8 +23,9 @@ outdir = datadir + '/' + drug + '/output' #============================================================================== # batch 26: 25.txt, RETRIEVED: 16 Feb: -my_url_file = outdir + '/mcsm_na_temp/mcsm_na_result_url_gid_b26.txt' -my_suffix = 'gid_b26' +# batch 27: 26.txt, RETRIEVED: 6 Aug: +my_url_file = outdir + '/mcsm_na_temp/mcsm_na_result_url_gid_b27.txt' +my_suffix = 'gid_b27' #============================================================================== diff --git a/mcsm_na/run_submit_mcsm_na.py b/mcsm_na/run_submit_mcsm_na.py index 249aba5..474ca5c 100755 --- a/mcsm_na/run_submit_mcsm_na.py +++ b/mcsm_na/run_submit_mcsm_na.py @@ -28,8 +28,10 @@ my_pdb_file = indir + '/gid_complex.pdb' #============================================================================= # batch 26: 25.txt # RAN: 16 Feb: -my_mutation_list = outdir + '/snp_batches/20/snp_batch_25.txt' -my_suffix = 'gid_b26' +# batch 27: 26.txt # RAN: 6 Aug: +# off by one +my_mutation_list = outdir + '/snp_batches/20/snp_batch_26.txt' +my_suffix = 'gid_b27' #============================================================================== #========================== @@ -43,4 +45,4 @@ submit_mcsm_na(host_url = my_host , prediction_url = my_prediction_url , output_dir = outdir , outfile_suffix = my_suffix) -#%%##################################################################### \ No newline at end of file +#%%#####################################################################