diff --git a/conf/modules.config b/conf/modules.config index 967e820a..cf6b381b 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -121,7 +121,6 @@ process { } withName: 'FUSIONREPORT' { - ext.when = { !params.skip_vis } ext.args = { {params.no_cosmic} ? "--no-cosmic" : "" } ext.args2 = "--export csv" publishDir = [ @@ -211,7 +210,7 @@ process { withName: 'SALMON_INDEX' { publishDir = [ - path: { "${params.genomes_base}/salmon" }, + path: { "${params.genomes_base}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] @@ -360,7 +359,7 @@ process { ] } - withName: 'NFCORE_RNAFUSION:BUILD_REFERENCES:STARFUSION_BUILD' { + withName: 'NFCORE_RNAFUSION:RNAFUSION:BUILD_REFERENCES:STARFUSION_BUILD' { cpus = { 24 * task.attempt } memory = { 100.GB * task.attempt } time = { 2.d * task.attempt } @@ -385,7 +384,4 @@ process { ext.when = { {!params.fusioninspector_only} && {!params.skip_vcf} } } - withName: '.*' { - ext.when = { !params.references_only || task.process.contains('BUILD_REFERENCES') } - } } diff --git a/modules/local/fusioncatcher/build/main.nf b/modules/local/fusioncatcher/build/main.nf index db1c7210..b79adff7 100644 --- a/modules/local/fusioncatcher/build/main.nf +++ b/modules/local/fusioncatcher/build/main.nf @@ -2,10 +2,7 @@ process FUSIONCATCHER_BUILD { tag "fusioncatcher_build" label 'process_medium' - conda "${projectDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d5/d53f36e9e01d14a0ae8e15f8046f52b2883c970c27fe43fdfbd9440a55f5403f/data' : - 'community.wave.seqera.io/library/fusioncatcher:1.33--4733482b637ef92f' }" + container "docker.io/clinicalgenomics/fusioncatcher:1.33" input: val genome_gencode_version diff --git a/modules/local/fusioncatcher/detect/main.nf b/modules/local/fusioncatcher/detect/main.nf index 7980439f..122da95f 100644 --- a/modules/local/fusioncatcher/detect/main.nf +++ b/modules/local/fusioncatcher/detect/main.nf @@ -2,10 +2,7 @@ process FUSIONCATCHER_DETECT { tag "$meta.id" label 'process_high' - conda "${projectDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d5/d53f36e9e01d14a0ae8e15f8046f52b2883c970c27fe43fdfbd9440a55f5403f/data' : - 'community.wave.seqera.io/library/fusioncatcher:1.33--4733482b637ef92f' }" + container "docker.io/clinicalgenomics/fusioncatcher:1.33" input: tuple val(meta), path(fastqs, stageAs: "input/*") diff --git a/modules/local/gencode_download/main.nf b/modules/local/gencode_download/main.nf index 1f466d26..40b27cef 100644 --- a/modules/local/gencode_download/main.nf +++ b/modules/local/gencode_download/main.nf @@ -37,8 +37,8 @@ process GENCODE_DOWNLOAD { stub: """ - touch Homo_sapiens.${genome}.${genome_gencode_version}_dna_primary_assembly.fa - touch Homo_sapiens.${genome}.${genome_gencode_version}.gtf + touch Homo_sapiens_${genome}_${genome_gencode_version}_dna_primary_assembly.fa + touch Homo_sapiens_${genome}_${genome_gencode_version}.gtf cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/nextflow.config b/nextflow.config index f1e66fa4..ebab99b1 100644 --- a/nextflow.config +++ b/nextflow.config @@ -11,6 +11,7 @@ params { // Input options input = 'https://raw.githubusercontent.com/nf-core/test-datasets/rnafusion/testdata/human/samplesheet_valid.csv' + outdir = null references_only = false cosmic_username = null cosmic_passwd = null @@ -77,7 +78,7 @@ params { fai = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}_dna_primary_assembly.fa.fai" gtf = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf" refflat = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf.refflat" - rrna_intervals = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.interval_list" + rrna_intervals = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf.interval_list" gencode_ref = "${params.genomes_base}/gencode" no_cosmic = false arriba_ref_blacklist = "${params.genomes_base}/arriba/blacklist_hg38_GRCh38_v2.4.0.tsv.gz" @@ -87,14 +88,14 @@ params { fusioncatcher_ref = "${params.genomes_base}/fusioncatcher/human_v${params.genome_gencode_version}" hgnc_ref = "${params.genomes_base}/hgnc/hgnc_complete_set.txt" hgnc_date = "${params.genomes_base}/hgnc/HGNC-DB-timestamp.txt" - salmon_index = "${params.genomes_base}/salmon/salmon" + salmon_index = "${params.genomes_base}/salmon" starfusion_ref = "${params.genomes_base}/starfusion/ctat_genome_lib_build_dir" starindex_ref = "${params.genomes_base}/star" fusionreport_ref = "${params.genomes_base}/fusion_report_db" // Internal file presence checks - salmon_index_stub_check = "${params.genomes_base}/salmon/salmon/complete_ref_lens.bin" + salmon_index_stub_check = "${params.genomes_base}/salmon/complete_ref_lens.bin" starindex_ref_stub_check = "${params.genomes_base}/star/star/Genome" fusionreport_ref_stub_check = "${params.genomes_base}/fusion_report_db/mitelman.db" fusioncatcher_ref_stub_check = "${params.genomes_base}/fusioncatcher/human_v${params.genome_gencode_version}/ensembl_fully_overlapping_genes.txt" diff --git a/subworkflows/local/build_references.nf b/subworkflows/local/build_references.nf index 56fd8eb2..8f50112a 100644 --- a/subworkflows/local/build_references.nf +++ b/subworkflows/local/build_references.nf @@ -87,7 +87,7 @@ workflow BUILD_REFERENCES { } if (!file(params.salmon_index).exists() || file(params.salmon_index).isEmpty() || - !file(params.salmon_index_stub_check).exists() || file(params.salmon_index_stub_check).isEmpty()){ // add condition for qc + !file(params.salmon_index_stub_check).exists() || file(params.salmon_index_stub_check).isEmpty()){ GFFREAD(ch_gtf, ch_fasta.map{ it -> it[1] }) ch_versions = ch_versions.mix(GFFREAD.out.versions) SALMON_INDEX(ch_fasta.map{ it -> it[1] }, GFFREAD.out.gffread_fasta.map{ it -> it[1] }) @@ -149,7 +149,7 @@ workflow BUILD_REFERENCES { } - if ((params.fusionreport || params.all) && + if ((params.fusionreport || params.all || params.fusioncatcher || params.arriba || params.starfusion) && (!file(params.fusionreport_ref).exists() || file(params.fusionreport_ref).isEmpty() || !file(params.fusionreport_ref_stub_check).exists() || file(params.fusionreport_ref_stub_check).isEmpty())) { if (!params.no_cosmic && (!params.cosmic_username || !params.cosmic_passwd)) { exit 1, 'COSMIC username and/or password missing' } diff --git a/subworkflows/local/fusioncatcher_workflow/main.nf b/subworkflows/local/fusioncatcher_workflow/main.nf index fd9ce34b..59614b61 100644 --- a/subworkflows/local/fusioncatcher_workflow/main.nf +++ b/subworkflows/local/fusioncatcher_workflow/main.nf @@ -9,7 +9,7 @@ workflow FUSIONCATCHER_WORKFLOW { take: reads // channel [ meta, [ fastqs ] ] fusioncatcher_ref // channel [ meta, path ] - run_fusioncatcher // boolean + fusioncatcher // boolean all // boolean fusioninspector_only // boolean fusioncatcher_fusions // path, string @@ -18,7 +18,7 @@ workflow FUSIONCATCHER_WORKFLOW { ch_versions = Channel.empty() ch_dummy_file = file("$baseDir/assets/dummy_file_fusioncatcher.txt", checkIfExists: true) - if (( run_fusioncatcher || all) && !fusioninspector_only ) { + if (( fusioncatcher || all) && !fusioninspector_only ) { if (fusioncatcher_fusions){ ch_fusioncatcher_fusions = reads.combine(Channel.value(file(fusioncatcher_fusions, checkIfExists:true))) diff --git a/subworkflows/local/fusionreport_workflow/main.nf b/subworkflows/local/fusionreport_workflow/main.nf index eac40e32..ff92dac0 100644 --- a/subworkflows/local/fusionreport_workflow/main.nf +++ b/subworkflows/local/fusionreport_workflow/main.nf @@ -13,7 +13,6 @@ workflow FUSIONREPORT_WORKFLOW { ch_versions = Channel.empty() ch_report = Channel.empty() ch_csv = Channel.empty() - if (!params.fusioninspector_only) { reads_fusions = reads .join(arriba_fusions, failOnMismatch:true, failOnDuplicate:true) diff --git a/workflows/rnafusion.nf b/workflows/rnafusion.nf index ddd006ba..1d886877 100644 --- a/workflows/rnafusion.nf +++ b/workflows/rnafusion.nf @@ -48,7 +48,7 @@ workflow RNAFUSION { BUILD_REFERENCES() ch_versions = ch_versions.mix(BUILD_REFERENCES.out.versions) - if (!params.references_only) { // TODO: Remove this temporary parameter when we have a full-working GitHub nf-test + if (!params.references_only) { // // QC from FASTQ files @@ -118,16 +118,16 @@ workflow RNAFUSION { - //Run fusioncatcher - FUSIONCATCHER_WORKFLOW ( - ch_reads, - BUILD_REFERENCES.out.ch_fusioncatcher_ref, // channel [ meta, path ] - params.run_fusioncatcher, - params.all, - params.fusioninspector_only, - params.fusioncatcher_fusions - ) - ch_versions = ch_versions.mix(FUSIONCATCHER_WORKFLOW.out.versions) + //Run fusioncatcher + FUSIONCATCHER_WORKFLOW ( + ch_reads, + BUILD_REFERENCES.out.ch_fusioncatcher_ref, // channel [ meta, path ] + params.fusioncatcher, + params.all, + params.fusioninspector_only, + params.fusioncatcher_fusions + ) + ch_versions = ch_versions.mix(FUSIONCATCHER_WORKFLOW.out.versions) //Run stringtie @@ -139,31 +139,35 @@ workflow RNAFUSION { //Run fusion-report - FUSIONREPORT_WORKFLOW ( - ch_reads, - BUILD_REFERENCES.out.ch_fusionreport_ref, - ARRIBA_WORKFLOW.out.fusions, - STARFUSION_WORKFLOW.out.fusions, - FUSIONCATCHER_WORKFLOW.out.fusions - ) - ch_versions = ch_versions.mix(FUSIONREPORT_WORKFLOW.out.versions) + if (params.fusioncatcher || params.starfusion || params.arriba || params.all) { + FUSIONREPORT_WORKFLOW ( + ch_reads, + BUILD_REFERENCES.out.ch_fusionreport_ref, + ARRIBA_WORKFLOW.out.fusions, + STARFUSION_WORKFLOW.out.fusions, + FUSIONCATCHER_WORKFLOW.out.fusions + ) + ch_versions = ch_versions.mix(FUSIONREPORT_WORKFLOW.out.versions) + } //Run fusionInpector - FUSIONINSPECTOR_WORKFLOW ( - ch_reads, - FUSIONREPORT_WORKFLOW.out.fusion_list, - FUSIONREPORT_WORKFLOW.out.fusion_list_filtered, - FUSIONREPORT_WORKFLOW.out.report, - FUSIONREPORT_WORKFLOW.out.csv, - STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed, - BUILD_REFERENCES.out.ch_gtf, - BUILD_REFERENCES.out.ch_arriba_ref_protein_domains, - BUILD_REFERENCES.out.ch_arriba_ref_cytobands, - BUILD_REFERENCES.out.ch_hgnc_ref, - BUILD_REFERENCES.out.ch_hgnc_date - ) - ch_versions = ch_versions.mix(FUSIONINSPECTOR_WORKFLOW.out.versions) - + if (params.fusioncatcher || params.starfusion || params.arriba || params.all) { + FUSIONINSPECTOR_WORKFLOW ( + ch_reads, + FUSIONREPORT_WORKFLOW.out.fusion_list, + FUSIONREPORT_WORKFLOW.out.fusion_list_filtered, + FUSIONREPORT_WORKFLOW.out.report, + FUSIONREPORT_WORKFLOW.out.csv, + STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed, + BUILD_REFERENCES.out.ch_gtf, + BUILD_REFERENCES.out.ch_arriba_ref_protein_domains, + BUILD_REFERENCES.out.ch_arriba_ref_cytobands, + BUILD_REFERENCES.out.ch_hgnc_ref, + BUILD_REFERENCES.out.ch_hgnc_date + ) + ch_multiqc_files = ch_multiqc_files.mix(FUSIONINSPECTOR_WORKFLOW.out.ch_arriba_visualisation.collect{it[1]}.ifEmpty([])) + ch_versions = ch_versions.mix(FUSIONINSPECTOR_WORKFLOW.out.versions) + } //QC QC_WORKFLOW ( @@ -175,7 +179,19 @@ workflow RNAFUSION { ) ch_versions = ch_versions.mix(QC_WORKFLOW.out.versions) + + ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_html.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_json.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastqc_trimmed.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_stats.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_gene_count.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.rnaseq_metrics.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.duplicate_metrics.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.insertsize_metrics.collect{it[1]}.ifEmpty([])) + } + // // Collate and save software versions // @@ -219,19 +235,6 @@ workflow RNAFUSION { ) ) - if (!params.references_only) { // TODO: Remove this temporary parameter when we have a full-working GitHub nf-test - ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_html.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_json.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastqc_trimmed.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_stats.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_gene_count.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.rnaseq_metrics.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.duplicate_metrics.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.insertsize_metrics.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(FUSIONINSPECTOR_WORKFLOW.out.ch_arriba_visualisation.collect{it[1]}.ifEmpty([])) - } - MULTIQC ( ch_multiqc_files.collect(), ch_multiqc_config.toList(), @@ -241,8 +244,6 @@ workflow RNAFUSION { [] ) - - emit: multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ]