diff --git a/nextflow_schema.json b/nextflow_schema.json index 3c5cf149..afc10d1f 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -135,6 +135,12 @@ "fa_icon": "far fa-file-code", "description": "Path to arriba output" }, + "ctatsplicing_ref": { + "type": "string", + "format": "directory-path", + "fa_icon": "far fa-file-code", + "description": "Path to ctatsplicing references" + }, "download_refs": { "type": "boolean", "fa_icon": "far fa-file-code", diff --git a/subworkflows/local/build_references/main.nf b/subworkflows/local/build_references/main.nf index a7e9e859..77422d78 100644 --- a/subworkflows/local/build_references/main.nf +++ b/subworkflows/local/build_references/main.nf @@ -146,7 +146,10 @@ workflow BUILD_REFERENCES { def ch_starfusion_ref = Channel.empty() if (tools.intersect(["starfusion", "ctatsplicing", "fusioninspector"])) { - if (!exists_not_empty(params.starfusion_ref)) { + if (exists_not_empty(params.starfusion_ref)) { + ch_starfusion_ref = Channel.fromPath(params.starfusion_ref).map { it -> [[id:it.name], it] } + } + else { if(!params.fusion_annot_lib) { error("Expected --fusion_annot_lib to be specified when using StarFusion or any tools that depend on it") } @@ -178,19 +181,14 @@ workflow BUILD_REFERENCES { STARFUSION_BUILD(ch_fasta, ch_gtf, params.fusion_annot_lib, params.species, pfam_file, dfam_urls_ch, params.annot_filter_url) ch_versions = ch_versions.mix(STARFUSION_BUILD.out.versions) - if (tools.contains("ctatsplicing")) { - CTATSPLICING_PREPGENOMELIB( - STARFUSION_BUILD.out.reference, - params.ctatsplicing_cancer_introns - ) - ch_versions = ch_versions.mix(CTATSPLICING_PREPGENOMELIB.out.versions) - ch_starfusion_ref = CTATSPLICING_PREPGENOMELIB.out.reference - } else { - ch_starfusion_ref = STARFUSION_BUILD.out.reference - } } - else { - ch_starfusion_ref = Channel.fromPath(params.starfusion_ref).map { it -> [[id:it.name], it] } + if (tools.contains("ctatsplicing") && !exists_not_empty(params.ctatsplicing_ref)) { + CTATSPLICING_PREPGENOMELIB( + ch_starfusion_ref, + params.ctatsplicing_cancer_introns + ) + ch_versions = ch_versions.mix(CTATSPLICING_PREPGENOMELIB.out.versions) + ch_starfusion_ref = CTATSPLICING_PREPGENOMELIB.out.reference } }