Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cancer splicing lib to starfusion ref #610

Merged
merged 12 commits into from
Mar 25, 2025
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add nf-test to local subworkflow: `FUSIONCATCHER_WORKFLOW` [#591](https://github.com/nf-core/rnafusion/pull/591)
- Add nf-test to local subworkflow: `STARFUSION_WORKFLOW`. [#597](https://github.com/nf-core/rnafusion/pull/597)
- Add nf-test to local module: `FUSIONINSPECTOR`. [#601](https://github.com/nf-core/rnafusion/pull/601)
- Added `CTATSPLICING_PREPGENOMELIB` to update the starfusion genome library directory with a cancer splicing index. [#610](https://github.com/nf-core/rnafusion/pull/610)
- Add nf-test to local subworkflow: `FUSIONREPORT_WORKFLOW`. [#607](https://github.com/nf-core/rnafusion/pull/607)
- Add nf-test to local module: `ARRIBA_VISUALISATION`. [#625](https://github.com/nf-core/rnafusion/pull/625)

Expand Down
13 changes: 12 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,21 @@ process {
]
}

withName: 'NFCORE_RNAFUSION:BUILD_REFERENCES:STARFUSION_BUILD' {
withName: 'STARFUSION_BUILD' {
cpus = { 24 * task.attempt }
memory = { 100.GB * task.attempt }
time = { 2.d * task.attempt }
publishDir = [
enabled: !params.ctatsplicing && !params.all,
path: { "${params.genomes_base}/starfusion" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: 'CTATSPLICING_PREPGENOMELIB' {
cpus = { 1 * task.attempt }
memory = { 20.GB * task.attempt }
publishDir = [
path: { "${params.genomes_base}/starfusion" },
mode: params.publish_dir_mode,
Expand Down
44 changes: 44 additions & 0 deletions modules/local/ctatsplicing/prepgenomelib/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
process CTATSPLICING_PREPGENOMELIB {
tag "$meta.id"
label 'process_single'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://data.broadinstitute.org/Trinity/CTAT_SINGULARITY/CTAT-SPLICING/ctat_splicing.v0.0.2.simg' :
'docker.io/trinityctat/ctat_splicing:0.0.2' }"

input:
tuple val(meta), path(genome_lib)
path(cancer_intron_tsv)

output:
tuple val(meta), path(genome_lib, includeInputs:true), emit: reference
path "versions.yml" , emit: versions

script:
def VERSION = '0.0.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
/usr/local/src/CTAT-SPLICING/prep_genome_lib/ctat-splicing-lib-integration.py \\
--cancer_introns_tsv cancer_introns.*.tsv.gz \\
--genome_lib_dir $genome_lib

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ctat-splicing: $VERSION
END_VERSIONS
"""

stub:
def VERSION = '0.0.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch $genome_lib/refGene.bed
echo | gzip > $genome_lib/refGene.sort.bed.gz
touch $genome_lib/refGene.sort.bed.gz.tbi
mkdir $genome_lib/cancer_splicing_lib
touch $genome_lib/cancer_splicing_lib/cancer_splicing.idx

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ctat-splicing: $VERSION
END_VERSIONS
"""
}
77 changes: 77 additions & 0 deletions modules/local/ctatsplicing/prepgenomelib/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
nextflow_process {

name "Test Process CTATSPLICING_PREPGENOMELIB"
script "../main.nf"
process "CTATSPLICING_PREPGENOMELIB"

setup {
run("STARFUSION_BUILD") {
script "../../../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"
"""
}
}
}

test("test") {

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = STARFUSION_BUILD.out.reference
input[1] = [
file("https://data.broadinstitute.org/Trinity/CTAT_RESOURCE_LIB/CANCER_SPLICING_LIB_SUPPLEMENT/cancer_introns.GRCh38.Jun232020.tsv.gz", checkIfExists:true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.findAll { key, value -> !key.isNumber() }).match() }
)
}
}

test("test - stub") {

options "-stub"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = STARFUSION_BUILD.out.reference
input[1] = [
file("https://data.broadinstitute.org/Trinity/CTAT_RESOURCE_LIB/CANCER_SPLICING_LIB_SUPPLEMENT/cancer_introns.GRCh38.Jun232020.tsv.gz", checkIfExists:true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.findAll { key, value -> !key.isNumber() }).match() }
)
}
}
}
Loading