diff --git a/src/protect/mutation_translation.py b/src/protect/mutation_translation.py index b9c84206..68e76221 100644 --- a/src/protect/mutation_translation.py +++ b/src/protect/mutation_translation.py @@ -139,5 +139,11 @@ def run_transgene(job, snpeffed_file, rna_bam, univ_options, transgene_options, os.rename('transgened_transgened.vcf', 'mutations.vcf') export_results(job, job.fileStore.writeGlobalFile('mutations.vcf'), 'mutations.vcf', univ_options, subfolder='mutations/transgened') + if fusion_calls: + # There won't be an output bedpe if there's no input + os.rename('transgened_transgened.bedpe', 'fusions.bedpe') + export_results(job, job.fileStore.writeGlobalFile('fusions.bedpe'), 'fusions.bedpe', + univ_options, subfolder='mutations/transgened') + job.fileStore.logToMaster('Ran transgene on %s successfully' % univ_options['patient']) return output_files diff --git a/src/protect/test/ci/test_protect.py b/src/protect/test/ci/test_protect.py index 869adcb6..2fb3eae8 100644 --- a/src/protect/test/ci/test_protect.py +++ b/src/protect/test/ci/test_protect.py @@ -140,9 +140,12 @@ def _test_ran_successfully(self, expected_dirs): 'snpeffed': ('/mnt/ephemeral/done/TEST/mutations/snpeffed', [], ['mutations.vcf']), - 'transgened': ('/mnt/ephemeral/done/TEST/mutations/transgened', - [], - ['mutations.vcf']), + 'transgened_f': ('/mnt/ephemeral/done/TEST/mutations/transgened', + [], + ['fusions.bedpe', 'mutations.vcf']), + 'transgened_v': ('/mnt/ephemeral/done/TEST/mutations/transgened', + [], + ['mutations.vcf']), }, 'peptides': ('/mnt/ephemeral/done/TEST/peptides', [], @@ -185,6 +188,13 @@ def _test_ran_successfully(self, expected_dirs): contents_per_dir['mutations']['strelka']['indel'] expected_contents['mutations_strelka_3'] = \ contents_per_dir['mutations']['strelka']['snv'] + elif caller == 'transgened': + if 'fusions' in dir['mutations']: + expected_contents['mutations_' + caller] = \ + contents_per_dir['mutations'][caller + '_f'] + else: + expected_contents['mutations_' + caller] = \ + contents_per_dir['mutations'][caller + '_v'] else: expected_contents['mutations_' + caller] = \ contents_per_dir['mutations'][caller]