Skip to content

Commit

Permalink
Merge branch 'dev' into remove_starfusion_download
Browse files Browse the repository at this point in the history
  • Loading branch information
atrigila authored Dec 23, 2024
2 parents 3d82388 + dba1d63 commit 37a5483
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add nf-test to local module: `STARFUSION_DETECT`. [#586](https://github.com/nf-core/rnafusion/pull/586)
- Added a new module `CTATSPLICING_STARTOCANCERINTRONS` and a new parameter `--ctatsplicing`. This options creates reports on cancer splicing abberations and requires one or both of `--arriba` and `--starfusion` to be given. [#587](https://github.com/nf-core/rnafusion/pull/587)
- Add parameter `--references_only` when no data should be analysed, but only the references should be built [#505](https://github.com/nf-core/rnafusion/pull/505)
- Add nf-test to local subworkflow: `STARFUSION_WORKFLOW`. [#597](https://github.com/nf-core/rnafusion/pull/597)

### Changed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_STARFUSION } from '../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_STARFUSION_CRAM } from '../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_VIEW as SAMTOOLS_VIEW_FOR_STARFUSION } from '../../modules/nf-core/samtools/view/main'
include { STAR_ALIGN as STAR_FOR_STARFUSION } from '../../modules/nf-core/star/align/main'
include { STARFUSION } from '../../modules/local/starfusion/detect/main'

include { CTATSPLICING_WORKFLOW } from './ctatsplicing_workflow'
include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_STARFUSION } from '../../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_STARFUSION_CRAM } from '../../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_VIEW as SAMTOOLS_VIEW_FOR_STARFUSION } from '../../../modules/nf-core/samtools/view/main'
include { STAR_ALIGN as STAR_FOR_STARFUSION } from '../../../modules/nf-core/star/align/main'
include { STARFUSION } from '../../../modules/local/starfusion/detect/main'
include { CTATSPLICING_WORKFLOW } from '../ctatsplicing_workflow'

workflow STARFUSION_WORKFLOW {
take:
Expand All @@ -29,7 +28,8 @@ workflow STARFUSION_WORKFLOW {
} else {
STAR_FOR_STARFUSION( reads, ch_starindex_ref, ch_gtf, params.star_ignore_sjdbgtf, '', params.seq_center ?: '')
ch_versions = ch_versions.mix(STAR_FOR_STARFUSION.out.versions)
ch_align = STAR_FOR_STARFUSION.out.bam_sorted
ch_align = STAR_FOR_STARFUSION.out.bam_sorted // TODO: This does not seem to be captured and used as the output is bam_sorted_aligned and not bam_sorted


SAMTOOLS_INDEX_FOR_STARFUSION(STAR_FOR_STARFUSION.out.bam_sorted)
ch_versions = ch_versions.mix(SAMTOOLS_INDEX_FOR_STARFUSION.out.versions)
Expand Down
115 changes: 115 additions & 0 deletions subworkflows/local/starfusion_workflow/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
nextflow_workflow {

name "Test Subworkflow STARFUSION_WORKFLOW"
script "../main.nf"
workflow "STARFUSION_WORKFLOW"
tag "subworkflow"
tag "star"
tag "star/genomegenerate"
tag "star/align"


test("STARFUSION_WORKFLOW - Homo sapiens - FASTQs minigenome") {
config './nextflow.config'

setup {
run("STAR_GENOMEGENERATE") {
script "../../../../modules/nf-core/star/genomegenerate/main.nf"
process {
"""
// FASTA
input[0] = Channel.fromPath(
"https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.fa", checkIfExists: true
)
.map{ [[id: it.getName() ], it ]}
// GTF
input[1] = Channel.fromPath(
"https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.gtf", checkIfExists: true
)
.map{ [[id: it.getName() ], it ]}
"""
}
}

run("STARFUSION_BUILD") {
script "../../../../modules/local/starfusion/build/main.nf"
process {
"""
input[0] = [
[ id:'minigenome fasta' ],
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.fa")
]
input[1] = [
[ id:'minigenome gtf' ],
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.gtf")
]
input [2] = file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/CTAT_HumanFusionLib.mini.dat.gz")
input [3] = "human"
"""
}
}
}

when {
workflow {
"""
// ch_reads
input[0] = Channel.of(
[
[ id: "test_fastqs" ],
[
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_1.fastq.gz", checkIfExists: true),
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_2.fastq.gz", checkIfExists: true)
]
] )
// ch_gtf
input[1] =
Channel.fromPath(
"https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.gtf", checkIfExists: true
)
.map{ [ [ id: it.name ], it ] }
// ch_starindex_ref
input[2] = STAR_GENOMEGENERATE.out.index
// ch_fasta
input[3] =
Channel.fromPath(
"https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.fa", checkIfExists: true
)
.map{ [ [ id: it.name ], it ] }
// ch_starfusion_ref
input[4] = STARFUSION_BUILD.out.reference
"""
}
params {
starfusion = true
cram = 'starfusion'
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.fusions,
file(workflow.out.star_stats[0][1]).name,
workflow.out.star_gene_count,
workflow.out.ch_bam_sorted,
workflow.out.ch_bam_sorted_indexed,
workflow.out.versions
).match() }
)
}
}




}
38 changes: 38 additions & 0 deletions subworkflows/local/starfusion_workflow/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"STARFUSION_WORKFLOW - Homo sapiens - FASTQs minigenome": {
"content": [
[
[
{
"id": "test_fastqs"
},
"test_fastqs.starfusion.fusion_predictions.tsv:md5,abe17134a231642edf9351e4964e8a97"
]
],
"test_fastqs.Log.final.out",
[
[
{
"id": "test_fastqs"
},
"test_fastqs.ReadsPerGene.out.tab:md5,8e0d42deeea09924d5c7ba3147bbfd78"
]
],
[

],
[

],
[
"versions.yml:md5,afde4f2fd6056df81e322b3c35ab7a8a",
"versions.yml:md5,e53f1ec32bc78a33f99892e42274833a"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2024-12-23T18:25:52.838411738"
}
}
37 changes: 37 additions & 0 deletions subworkflows/local/starfusion_workflow/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process {
withName: 'STAR_FOR_STARFUSION' {
ext.args = '--twopassMode Basic \
--outReadsUnmapped None \
--readFilesCommand zcat \
--outSAMtype BAM SortedByCoordinate \
--outSAMstrandField intronMotif \
--outSAMunmapped Within \
--chimSegmentMin 12 \
--chimJunctionOverhangMin 8 \
--chimOutJunctionFormat 1 \
--alignSJDBoverhangMin 10 \
--alignMatesGapMax 100000 \
--alignIntronMax 100000 \
--alignSJstitchMismatchNmax 5 -1 5 5 \
--chimMultimapScoreRange 3 \
--chimScoreJunctionNonGTAG -4 \
--chimMultimapNmax 20 \
--chimNonchimScoreDropMin 10 \
--peOverlapNbasesMin 12 \
--peOverlapMMp 0.1 \
--alignInsertionFlush Right \
--alignSplicedMateMapLminOverLmate 0 \
--alignSplicedMateMapLmin 30 \
--chimOutType Junctions \
--quantMode GeneCounts'
}

withName: 'SAMTOOLS_INDEX_FOR_STARFUSION_CRAM' {
ext.prefix = { "${meta.id}.star_for_starfusion.Aligned.sortedByCoord.out" }
}

withName: 'SAMTOOLS_VIEW_FOR_STARFUSION' {
ext.args = { "--output-fmt cram" }
ext.prefix = { "${meta.id}.star_for_starfusion.Aligned.sortedByCoord.out" }
}
}

0 comments on commit 37a5483

Please sign in to comment.