Skip to content

Commit

Permalink
Merge pull request #388 from nf-core/fix_no_fusions
Browse files Browse the repository at this point in the history
add branch in case of no fusions
  • Loading branch information
rannick committed Sep 4, 2023
2 parents c8b98c7 + 72ee2ec commit 4bab85b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Set html files as optional in fusionreport [#380](https://github.com/nf-core/rnafusion/pull/380)
- Provide gene count file by default when running STAR_FOR_STARFUSION [#385](https://github.com/nf-core/rnafusion/pull/385)
- Fix fusion-report issue with MACOXS directories [#386](https://github.com/nf-core/rnafusion/pull/386)
- The fusion lists is updated to contain two branches, one in case no fusions are detected and one for if fusions are detected, that will be used to feed to fusioninspector, megafusion, arriba visualisation [#388](https://github.com/nf-core/rnafusion/pull/388)

### Removed

Expand Down
12 changes: 8 additions & 4 deletions subworkflows/local/fusioninspector_workflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ workflow FUSIONINSPECTOR_WORKFLOW {
main:
ch_versions = Channel.empty()
index ="${params.starfusion_ref}"
ch_fusion_list = params.fusioninspector_filter ? fusion_list_filtered : fusion_list
ch_fusion_list = ( params.fusioninspector_filter ? fusion_list_filtered : fusion_list )
.branch{
no_fusions: it[1].size() == 0
fusions: it[1].size() > 0
}

if (params.whitelist) {
ch_whitelist = ch_fusion_list.combine(Channel.value(file(params.whitelist, checkIfExists:true)))
ch_whitelist = ch_fusion_list.fusions.combine(Channel.value(file(params.whitelist, checkIfExists:true)))
.map { meta, fusions, whitelist -> [ meta, [fusions, whitelist] ] }

CAT_CAT(ch_whitelist) // fusioninspector takes care of possible duplicates
ch_versions = ch_versions.mix(CAT_CAT.out.versions)

ch_fusion_list = CAT_CAT.out.file_out
ch_fusion_list.fusions = CAT_CAT.out.file_out
}

reads_fusion = reads.join(ch_fusion_list )
reads_fusion = reads.join(ch_fusion_list.fusions )

FUSIONINSPECTOR( reads_fusion, index)
ch_versions = ch_versions.mix(FUSIONINSPECTOR.out.versions)
Expand Down

0 comments on commit 4bab85b

Please sign in to comment.