Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2c9f4b9
add trim_tail_fusioncatcher
rannick May 28, 2025
6690c15
add fusioncatcher_trim option
rannick May 28, 2025
a7da82c
add fusioncatcher_trim
rannick May 28, 2025
8760176
add fusioncatcher_trim
rannick May 28, 2025
7c2415d
Merge branch 'dev' into rework_trimming
rannick Jun 2, 2025
8ab02d8
add publish
rannick Jun 2, 2025
ea8f180
Merge branch 'rework_trimming' of https://github.com/nf-core/rnafusio…
rannick Jun 2, 2025
680e03d
add differentiating prefix
rannick Jun 2, 2025
f630a2b
try changing the condition
rannick Jun 2, 2025
77b1073
update memory
rannick Jun 3, 2025
8fc4ad9
change trim condition
rannick Jun 4, 2025
25b700b
link memory usage with task.memory
rannick Jun 4, 2025
c8a1471
update changelog
rannick Jun 4, 2025
ee255df
update contributors
rannick Jun 4, 2025
867f97e
reshuffle memory allocation
rannick Jun 4, 2025
e0d9840
reshuffle memory allocation
rannick Jun 4, 2025
2f0bc73
reshuffle memory allocation
rannick Jun 4, 2025
8b3dd01
update module
rannick Jun 4, 2025
c0c95dd
prettier
rannick Jun 4, 2025
732ebdd
update documentation
rannick Jun 5, 2025
f0c0108
Update docs/output.md
rannick Jun 6, 2025
b6e4c6b
use trim_tail default as 0
rannick Jun 13, 2025
04c6f75
update test
rannick Jun 16, 2025
b31306e
Merge branch 'rework_trimming' of https://github.com/nf-core/rnafusio…
rannick Jun 16, 2025
eb34f1a
remove fusioncatcher_trim, just use trim_tail_fusioncatcher
rannick Jun 19, 2025
5f4ce10
prettier
rannick Jun 19, 2025
728015e
update tests and fix issues
rannick Jun 19, 2025
2ab557d
update readme
rannick Jun 19, 2025
34f2e78
formatting
rannick Jun 19, 2025
fd23d01
add test config
rannick Jun 19, 2025
3924b81
update snapshot
rannick Jun 19, 2025
ddd90b4
update snap
rannick Jul 2, 2025
fcb7f2d
Update docs/output.md
rannick Jul 2, 2025
55cdff2
Update workflows/rnafusion.nf
rannick Jul 3, 2025
997e3e1
update snap
rannick Jul 3, 2025
7243df2
update snap
rannick Jul 3, 2025
3bf196c
update snap
rannick Jul 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `--star_limit_bam_sort_ram` to set the maximum memory for sorting the BAM files in STAR. [#668](https://github.com/nf-core/rnafusion/pull/668)
- Update STAR-Fusion to 1.15.0 and update nf-core modules [#664](https://github.com/nf-core/rnafusion/pull/664)
- Update fusionreport 4.0.0 that replaces the score of a fusion with a Fusion Indication Index [#667](https://github.com/nf-core/rnafusion/pull/667)
- Added a extra trimming step for fusioncatcher in case a different read-length is wished for this tool only [#674](https://github.com/nf-core/rnafusion/pull/674)

### Changed

Expand Down Expand Up @@ -97,6 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `FUSIONINSPECTOR` process will no longer fail when no fusions have been found. [#651](https://github.com/nf-core/rnafusion/pull/651)
- Fixed STAR-Fusion build would fail when downloading Pfam and Dfam resources behind SSL. [#653](https://github.com/nf-core/rnafusion/pull/653)
- Fix bug in argument handling for FusionInspector [#669](https://github.com/nf-core/rnafusion/pull/669)
- Fix missing memory unit for fusioncatcher [#674](https://github.com/nf-core/rnafusion/pull/674)

### Removed

Expand All @@ -118,6 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
| `--stringtie` | `--tools stringtie` |
| `--all` | `--tools all` |
| | `--fusioncatcher_download_link` |
| | `--trim_tail_fusioncatcher` |

## v3.0.2 - [2024-04-10]

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ For more details about the output files and reports, please refer to the

nf-core/rnafusion was written by Martin Proks ([@matq007](https://github.com/matq007)), Maxime Garcia ([@maxulysse](https://github.com/maxulysse)) and Annick Renevey ([@rannick](https://github.com/rannick))

We thank the following people for their help in the development of this pipeline:
## We thank the following people for their help in the development of this pipeline

- [Phil Ewels](https://github.com/ewels)
- [Rickard Hammarén](https://github.com/Hammarn)
- [Alexander Peltzer](https://github.com/apeltzer)
- [Praveen Raj](https://github.com/praveenraj2018)
- [Anabella Trigila](https://github.com/atrigila)
- [Nicolas Vannieuwkerke](https://github.com/nvnieuwk)

## Contributions and Support

Expand Down
17 changes: 16 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,22 @@ process {
}

withName: 'FASTP' {
ext.args = { params.trim_tail ? "--trim_tail1 ${params.trim_tail} --trim_tail2 ${params.trim_tail} " : '' }
ext.args = { params.trim_tail > 0 ? "--trim_tail1 ${params.trim_tail} --trim_tail2 ${params.trim_tail} " : '' }
publishDir = [
path: { "${params.outdir}/fastp" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'FASTP_FOR_FUSIONCATCHER' {
ext.args = { params.trim_tail_fusioncatcher > 0 ? "--trim_tail1 ${params.trim_tail_fusioncatcher} --trim_tail2 ${params.trim_tail_fusioncatcher} " : '' }
ext.prefix = { "${meta.id}_trimmed_for_fusioncatcher" }
publishDir = [
path: { "${params.outdir}/fastp_for_fusioncatcher" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'FASTQC' {
Expand Down
18 changes: 17 additions & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If multiple libraries or runs have been provided for the same sample in the inpu

### Fastp

If `--trim_fastp` is selected, [fastp](https://github.com/OpenGene/fastp) will filter low quality reads as well as bases at the 5' and 3' ends, trim adapters (automatically detected, but input with parameter `--adapter_fasta` is possible). 3' trimming is also possible via parameter `--trim_tail`.
If `--tools fastp` is present, [fastp](https://github.com/OpenGene/fastp) will filter low quality reads as well as bases at the 5' and 3' ends, trim adapters (automatically detected, but input with parameter `--adapter_fasta` is possible). 3' trimming is also possible via parameter `--trim_tail`.

<details markdown="1">
<summary>Output files</summary>
Expand All @@ -147,6 +147,22 @@ If `--trim_fastp` is selected, [fastp](https://github.com/OpenGene/fastp) will f

</details>

### Fastp for fusioncatcher

If `trim_tail_fusioncatcher` has any value other than 0, [fastp](https://github.com/OpenGene/fastp) will be run again as above. This allows for additional trimming of read tails before running FusionCatcher. For example if reads are 150bp, using `--trim_tail_fusioncatcher 50` will shorten reads to 100 bp by 50 bases from the 3′ end. 100 bp is the recommended read length to feed into FusionCatcher. The default for `--trim_tail_fusioncatcher` is 0 (no trimming).

<details markdown="1">
<summary>Output files</summary>

- `fastp/`
- `<sample>_trimmed_for_fusioncatcher_1.fastp.fastq.gz`
- `<sample>_trimmed_for_fusioncatcher_2.fastp.fastq.gz`
- `<sample>_trimmed_for_fusioncatcher.fastp.html`
- `<sample>_trimmed_for_fusioncatcher.fastp.json`
- `<sample>_trimmed_for_fusioncatcher.fastp.log`

</details>

### FastQC

<details markdown="1">
Expand Down
2 changes: 2 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ nextflow run nf-core/rnafusion \
--adapter_fastq <PATH/TO/ADAPTER/FASTQ> (optional)
```

The additional `--trim_tail_fusioncatcher` flag will toggle an additional `fastp` process, especially useful is reads are above 100 bp, which is not handled well by FusionCatcher. The parameter `--trim_tail_fusioncatcher`need to be provided with the number of bases to remove from the tail end.

#### Filter fusions detected by 2 or more tools

```bash
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"fusioncatcher/fusioncatcher": {
"branch": "master",
"git_sha": "2a227f75f33415f74a884ef8b33555b151e33de9",
"git_sha": "1037205706929921360f57e8042eae6819825e31",
"installed_by": ["modules"]
},
"gatk4/bedtointervallist": {
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/fusioncatcher/fusioncatcher/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ params {
tools_cutoff = 1

// Trimming
trim_tail = null
trim_tail = 0
trim_tail_fusioncatcher = 0
adapter_fasta = []

// Compression
Expand Down
8 changes: 7 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,13 @@
"trim_tail": {
"type": "integer",
"description": "The amount of bases to trim at the tail of each read, none will be trimmed by default",
"minimum": 1,
"minimum": 0,
"fa_icon": "fas fa-cut"
},
"trim_tail_fusioncatcher": {
"type": "integer",
"description": "The amount of bases to trim at the tail of each read for fusioncatcher, none will be trimmed by default",
"minimum": 0,
"fa_icon": "fas fa-cut"
},
"adapter_fasta": {
Expand Down
16 changes: 15 additions & 1 deletion subworkflows/local/fusioncatcher_workflow/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include { FUSIONCATCHER_FUSIONCATCHER } from '../../../modules/nf-core/fusioncatcher/fusioncatcher/main'
include { FASTP as FASTP_FOR_FUSIONCATCHER } from '../../../modules/nf-core/fastp/main'
include { FUSIONCATCHER_FUSIONCATCHER } from '../../../modules/nf-core/fusioncatcher/fusioncatcher/main'

// TODO: Remove fusioncatcher_fusions as parameter.
// TODO: remove dummy file. Work with Channel.empty()
Expand All @@ -7,6 +8,8 @@ include { FUSIONCATCHER_FUSIONCATCHER } from '../../../modules/nf-core/fusioncat
workflow FUSIONCATCHER_WORKFLOW {
take:
reads // channel [ meta, [ fastqs ] ]
fusioncatcher_trimming // boolean
adapter_fasta // channel [ path ]
fusioncatcher_ref // channel [ meta, path ]
fusioncatcher_fusions // path, string

Expand All @@ -18,6 +21,17 @@ workflow FUSIONCATCHER_WORKFLOW {
ch_fusioncatcher_fusions = reads.combine(Channel.value(file(fusioncatcher_fusions, checkIfExists:true)))
.map { meta, _reads, fusions -> [ meta, fusions ] }
} else {
if (fusioncatcher_trimming) {
FASTP_FOR_FUSIONCATCHER(
reads,
adapter_fasta,
false, // discard_trimmed_pass
false, // save_trimmed_fail
false // skip_qc
)
ch_versions = ch_versions.mix(FASTP_FOR_FUSIONCATCHER.out.versions)
reads = FASTP_FOR_FUSIONCATCHER.out.reads
}

FUSIONCATCHER_FUSIONCATCHER (
reads,
Expand Down
53 changes: 53 additions & 0 deletions subworkflows/local/fusioncatcher_workflow/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
nextflow_workflow {

name "Test Subworkflow FUSIONCATCHER_WORKFLOW"
script "../main.nf"
workflow "FUSIONCATCHER_WORKFLOW"

tag "subworkflow"
tag "fusioncatcher_workflow"
tag "fusioncatcher"

test("FUSIONCATCHER_WORKFLOW - Stub") {
options "-stub"

when {
workflow {
"""
// Input channels
input[0] = Channel.of(
[ [ id:'test_sample' ],
file("https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_1.fq.gz"),
file("https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_2.fq.gz") ]
)

input[1] = true

input[2] = []

input[3] = [
[ id:'fusioncatcher_ref' ],
[]
]

input[4] = []

"""
}
params {
tools = 'fusioncatcher'
trim_tail_fusioncatcher = 50
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.versions
).match() }
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"FUSIONCATCHER_WORKFLOW - Stub": {
"content": [
[
"versions.yml:md5,24a191a82bb19899f88f6493ad4f1b8c",
"versions.yml:md5,aeee6dd3b4dcf4cb11af80dfa0a7bf72"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-06-13T16:36:48.833043"
}
}
18 changes: 6 additions & 12 deletions subworkflows/local/fusionreport_workflow/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,19 @@ nextflow_workflow {
when {
workflow {
"""
// Input channels
input[0] = Channel.of(
[ [ id:'test_sample' ],
file("https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_1.fq.gz") ]
)

input[1] = FUSIONREPORT_DOWNLOAD.out.fusionreport_ref
input[0] = FUSIONREPORT_DOWNLOAD.out.fusionreport_ref

input[2] = Channel.of(
input[1] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/arriba.tsv") ]
)

input[3] = Channel.of(
input[2] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/starfusion.tsv") ]
)

input[4] = Channel.of(
input[3] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/fusioncatcher.txt") ]
)
Expand All @@ -50,12 +44,12 @@ nextflow_workflow {
}
params {
fusioninspector_only = false
tools_cutoff = 1
tools_cutoff = 1
arriba = true
starfusion = true
fusioncatcher = true
no_cosmic = true
outdir = "$outputDir"
outdir = "$outputDir"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
{
"id": "test_sample"
},
"test_sample_fusionreport_index.html:md5,3513bcaa58446399c0957db69402d3bd"
"test_sample_fusionreport_index.html:md5,9dfbf94471173bebbd8085e440515e4d"
]
],
[
[
{
"id": "test_sample"
},
"test_sample.fusions.csv:md5,49f378c2112d7e0b3b17d9095c79e6bd"
"test_sample.fusions.csv:md5,ee6c6838110d68bc75a13c19dca0a321"
]
],
[
"versions.yml:md5,90749dbf8e3e7b259c935eabb8c6ce1e"
"versions.yml:md5,5b80da331704f6d2093b7609537222e8"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
"nextflow": "25.04.2"
},
"timestamp": "2025-01-07T13:31:41.215356596"
"timestamp": "2025-06-19T11:32:39.322725"
}
}
33 changes: 33 additions & 0 deletions tests/test_stub.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,39 @@ nextflow_pipeline {
}
}

test("stub test fusioncatcher trim") {

when {
params {
outdir = "$outputDir"
tools = "fusioncatcher"
trim_tail_fusioncatcher = 50
fusion_annot_lib = 'https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/CTAT_HumanFusionLib.mini.dat.gz'

}
}
then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
// def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') //TODO uncomment once -stub is removed
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnafusion_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
// stable_path // TODO uncomment once -stub is removed
).match() }
)
}
}

test("stub test starfusion") {

when {
Expand Down
Loading