Skip to content

Commit

Permalink
Merge pull request #12 from taylor-lab/empty-maf-output
Browse files Browse the repository at this point in the history
better handling for no mutation input maf
  • Loading branch information
cband authored Jul 16, 2020
2 parents 9aa879f + 945d26b commit 31eb2c1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions neoantigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,23 @@ 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')
exit(1)
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(0)

except Exception:
logger.error('Error while generating mutated peptides')
Expand Down

0 comments on commit 31eb2c1

Please sign in to comment.