Skip to content

Commit 101565a

Browse files
authored
Merge pull request #282 from /issues/281-export-transgene-fusions
Export transgene fusions (resolves #281)
2 parents ee863ba + 42bdd24 commit 101565a

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/protect/mutation_translation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,11 @@ def run_transgene(job, snpeffed_file, rna_bam, univ_options, transgene_options,
139139
os.rename('transgened_transgened.vcf', 'mutations.vcf')
140140
export_results(job, job.fileStore.writeGlobalFile('mutations.vcf'), 'mutations.vcf',
141141
univ_options, subfolder='mutations/transgened')
142+
if fusion_calls:
143+
# There won't be an output bedpe if there's no input
144+
os.rename('transgened_transgened.bedpe', 'fusions.bedpe')
145+
export_results(job, job.fileStore.writeGlobalFile('fusions.bedpe'), 'fusions.bedpe',
146+
univ_options, subfolder='mutations/transgened')
147+
142148
job.fileStore.logToMaster('Ran transgene on %s successfully' % univ_options['patient'])
143149
return output_files

src/protect/test/ci/test_protect.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ def _test_ran_successfully(self, expected_dirs):
140140
'snpeffed': ('/mnt/ephemeral/done/TEST/mutations/snpeffed',
141141
[],
142142
['mutations.vcf']),
143-
'transgened': ('/mnt/ephemeral/done/TEST/mutations/transgened',
144-
[],
145-
['mutations.vcf']),
143+
'transgened_f': ('/mnt/ephemeral/done/TEST/mutations/transgened',
144+
[],
145+
['fusions.bedpe', 'mutations.vcf']),
146+
'transgened_v': ('/mnt/ephemeral/done/TEST/mutations/transgened',
147+
[],
148+
['mutations.vcf']),
146149
},
147150
'peptides': ('/mnt/ephemeral/done/TEST/peptides',
148151
[],
@@ -185,6 +188,13 @@ def _test_ran_successfully(self, expected_dirs):
185188
contents_per_dir['mutations']['strelka']['indel']
186189
expected_contents['mutations_strelka_3'] = \
187190
contents_per_dir['mutations']['strelka']['snv']
191+
elif caller == 'transgened':
192+
if 'fusions' in dir['mutations']:
193+
expected_contents['mutations_' + caller] = \
194+
contents_per_dir['mutations'][caller + '_f']
195+
else:
196+
expected_contents['mutations_' + caller] = \
197+
contents_per_dir['mutations'][caller + '_v']
188198
else:
189199
expected_contents['mutations_' + caller] = \
190200
contents_per_dir['mutations'][caller]

0 commit comments

Comments
 (0)