From d27c07b04e3b230457368e592974081f911bb094 Mon Sep 17 00:00:00 2001 From: gongyixiao <5620765+gongyixiao@users.noreply.github.com> Date: Thu, 16 Jul 2020 13:47:17 -0400 Subject: [PATCH 1/2] better handling for no mutation input maf add header to empty maf file and empty .all_neoantigen_predictions.txt --- neoantigen.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/neoantigen.py b/neoantigen.py index 4464cf6..1d51390 100644 --- a/neoantigen.py +++ b/neoantigen.py @@ -295,9 +295,22 @@ def main(): # create empty neoantigens.maf file if there are no mutations if n_muts == 0: - logger.info('No mutations in this tumor. Creating empty .neoantigens.maf file') + logger.info('No mutations in this tumor. Creating empty .neoantigens.maf and .all_neoantigen_predictions.txt file') logger.info('Exiting neoantigen pipeline') - execute_cmd('touch ' + sample_path_pfx + '.neoantigens.maf') + maf_df_empty = maf_df + maf_df_empty['neo_maf_identifier_key'] = '' + maf_df_empty['neo_best_icore_peptide'] = '' + maf_df_empty['neo_best_rank'] = '' + maf_df_empty['neo_best_binding_affinity'] = '' + maf_df_empty['neo_best_binder_class'] = '' + maf_df_empty['neo_best_is_in_wt_peptidome'] = '' + maf_df_empty['neo_best_algorithm'] = '' + maf_df_empty['neo_best_hla_allele'] = '' + maf_df_empty['neo_n_peptides_evaluated'] = '' + maf_df_empty['neo_n_strong_binders'] = '' + maf_df_empty['neo_n_weak_binders'] = '' + maf_df_empty.to_csv(sample_path_pfx + '.neoantigens.maf' , sep='\t', index=False) + execute_cmd('touch ' + sample_path_pfx + '.all_neoantigen_predictions.txt') exit(1) except Exception: From 945d26b0e7289e2ed3b4a4cb1866a1f27443ff2d Mon Sep 17 00:00:00 2001 From: gongyixiao <5620765+gongyixiao@users.noreply.github.com> Date: Thu, 16 Jul 2020 13:50:29 -0400 Subject: [PATCH 2/2] change exit code to 0 --- neoantigen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neoantigen.py b/neoantigen.py index 1d51390..e798c68 100644 --- a/neoantigen.py +++ b/neoantigen.py @@ -311,7 +311,7 @@ def main(): maf_df_empty['neo_n_weak_binders'] = '' maf_df_empty.to_csv(sample_path_pfx + '.neoantigens.maf' , sep='\t', index=False) execute_cmd('touch ' + sample_path_pfx + '.all_neoantigen_predictions.txt') - exit(1) + exit(0) except Exception: logger.error('Error while generating mutated peptides')