diff --git a/README.md b/README.md index 13005bb..10c8b8c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/viralintegration/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.7783480-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.7783480) +[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) diff --git a/docs/usage.md b/docs/usage.md index 0714edf..aaa89d7 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -61,7 +61,7 @@ By default, the pipeline uses the [CTAT-VIF human virus database](https://github The typical command for running the pipeline is as follows: ```bash -nextflow run nf-core/viralintegration --input ./samplesheet.csv --outdir ./results --genome GRCh37 -profile docker +nextflow run nf-core/viralintegration --input ./samplesheet.csv --outdir ./results --genome GRCh38 -profile docker ``` This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. @@ -92,7 +92,8 @@ with `params.yaml` containing: ```yaml input: './samplesheet.csv' outdir: './results/' -genome: 'GRCh37' +genome: 'GRCh38' +input: 'data' <...> ``` diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index ab84a4a..811a4eb 100755 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -4,6 +4,8 @@ import nextflow.Nextflow +import nextflow.Nextflow + class WorkflowMain { // diff --git a/lib/WorkflowViralintegration.groovy b/lib/WorkflowViralintegration.groovy index eef1368..5847c49 100755 --- a/lib/WorkflowViralintegration.groovy +++ b/lib/WorkflowViralintegration.groovy @@ -12,6 +12,7 @@ class WorkflowViralintegration { // public static void initialise(params, log) { + genomeExistsError(params, log) diff --git a/modules.json b/modules.json index 1266e31..872f325 100644 --- a/modules.json +++ b/modules.json @@ -7,44 +7,44 @@ "nf-core": { "custom/dumpsoftwareversions": { "branch": "master", - "git_sha": "76cc4938c1f6ea5c7d83fed1eeffc146787f9543", + "git_sha": "bba7e362e4afead70653f84d8700588ea28d0f9e", "installed_by": ["modules"] }, "fastqc": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "f2d63bd5b68925f98f572eed70993d205cc694b7", + "git_sha": "1537442a7be4a78efa3d1ff700a923c627bbda5d", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "5394565c5fe4c760e5b35977ec7607c62e81d1f8", "installed_by": ["modules"] }, "samtools/sort": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, "star/align": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "9f6b233518f7d9ecdcf24b798b7e491db5424273", "installed_by": ["modules"], "patch": "modules/nf-core/star/align/star-align.diff" }, "star/genomegenerate": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "0e98289b5bec6e3f8f588a8a9d05e8aacc1179a0", "installed_by": ["modules"], "patch": "modules/nf-core/star/genomegenerate/star-genomegenerate.diff" }, "trimmomatic": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"], "patch": "modules/nf-core/trimmomatic/trimmomatic.diff" } diff --git a/modules/nf-core/custom/dumpsoftwareversions/environment.yml b/modules/nf-core/custom/dumpsoftwareversions/environment.yml new file mode 100644 index 0000000..f0c63f6 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/environment.yml @@ -0,0 +1,7 @@ +name: custom_dumpsoftwareversions +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::multiqc=1.17 diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf index 800a609..7685b33 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/main.nf +++ b/modules/nf-core/custom/dumpsoftwareversions/main.nf @@ -2,10 +2,10 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { label 'process_single' // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container - conda "bioconda::multiqc=1.14" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : - 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.17--pyhdfd78af_0' : + 'biocontainers/multiqc:1.17--pyhdfd78af_0' }" input: path versions diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml index c32657d..5f15a5f 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/meta.yml +++ b/modules/nf-core/custom/dumpsoftwareversions/meta.yml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: custom_dumpsoftwareversions description: Custom module used to dump software versions within the nf-core pipeline template keywords: @@ -16,7 +16,6 @@ input: type: file description: YML file containing software versions pattern: "*.yml" - output: - yml: type: file @@ -30,7 +29,9 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@drpatelh" - "@grst" +maintainers: + - "@drpatelh" + - "@grst" diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py index e55b8d4..da03340 100755 --- a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py +++ b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py @@ -4,11 +4,10 @@ """Provide functions to merge multiple versions.yml files.""" +import yaml import platform from textwrap import dedent -import yaml - def _make_versions_html(versions): """Generate a tabular HTML output of all versions for MultiQC.""" diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test new file mode 100644 index 0000000..64c11f4 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test @@ -0,0 +1,38 @@ +nextflow_process { + + name "Test Process CUSTOM_DUMPSOFTWAREVERSIONS" + script "modules/nf-core/custom/dumpsoftwareversions/main.nf" + process "CUSTOM_DUMPSOFTWAREVERSIONS" + tag "modules" + tag "modules_nfcore" + tag "custom" + tag "dumpsoftwareversions" + tag "custom/dumpsoftwareversions" + + test("Should run without failures") { + when { + process { + """ + def tool1_version = ''' + TOOL1: + tool1: 0.11.9 + '''.stripIndent() + + def tool2_version = ''' + TOOL2: + tool2: 1.9 + '''.stripIndent() + + input[0] = Channel.of(tool1_version, tool2_version).collectFile() + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap new file mode 100644 index 0000000..9692ae4 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap @@ -0,0 +1,27 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + "software_versions.yml:md5,0fa1d12894759924e39ab0d596bdb520" + ], + "1": [ + "software_versions_mqc.yml:md5,f30be68a8e770ae315c5d9b0353d9810" + ], + "2": [ + "versions.yml:md5,3843ac526e762117eedf8825b40683df" + ], + "mqc_yml": [ + "software_versions_mqc.yml:md5,f30be68a8e770ae315c5d9b0353d9810" + ], + "versions": [ + "versions.yml:md5,3843ac526e762117eedf8825b40683df" + ], + "yml": [ + "software_versions.yml:md5,0fa1d12894759924e39ab0d596bdb520" + ] + } + ], + "timestamp": "2023-11-29T17:13:55+0000" + } +} \ No newline at end of file diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml new file mode 100644 index 0000000..405aa24 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml @@ -0,0 +1,2 @@ +custom/dumpsoftwareversions: + - modules/nf-core/custom/dumpsoftwareversions/** diff --git a/modules/nf-core/fastqc/environment.yml b/modules/nf-core/fastqc/environment.yml new file mode 100644 index 0000000..1787b38 --- /dev/null +++ b/modules/nf-core/fastqc/environment.yml @@ -0,0 +1,7 @@ +name: fastqc +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::fastqc=0.12.1 diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 9ae5838..50e59f2 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -2,10 +2,10 @@ process FASTQC { tag "$meta.id" label 'process_medium' - conda "bioconda::fastqc=0.11.9" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' : - 'quay.io/biocontainers/fastqc:0.11.9--0' }" + 'https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0' : + 'biocontainers/fastqc:0.12.1--hdfd78af_0' }" input: tuple val(meta), path(reads) @@ -29,7 +29,11 @@ process FASTQC { printf "%s %s\\n" $rename_to | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name done - fastqc $args --threads $task.cpus $renamed_files + + fastqc \\ + $args \\ + --threads $task.cpus \\ + $renamed_files cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index 4da5bb5..ee5507e 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -50,3 +50,8 @@ authors: - "@grst" - "@ewels" - "@FelixKrueger" +maintainers: + - "@drpatelh" + - "@grst" + - "@ewels" + - "@FelixKrueger" diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test new file mode 100644 index 0000000..08f5f53 --- /dev/null +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -0,0 +1,41 @@ +nextflow_process { + + name "Test Process FASTQC" + script "modules/nf-core/fastqc/main.nf" + process "FASTQC" + tag "modules" + tag "modules_nfcore" + tag "fastqc" + + test("Single-Read") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id: 'test', single_end:true ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. + // looks like this:
Mon 2 Oct 2023
test.gz
+ // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 + { assert process.out.html.get(0).get(1) ==~ ".*/test_fastqc.html" }, + { assert path(process.out.html.get(0).get(1)).getText().contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match("versions") }, + { assert process.out.zip.get(0).get(1) ==~ ".*/test_fastqc.zip" } + ) + } + } +} diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap new file mode 100644 index 0000000..636a32c --- /dev/null +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -0,0 +1,10 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "timestamp": "2023-10-09T23:40:54+0000" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastqc/tests/tags.yml b/modules/nf-core/fastqc/tests/tags.yml new file mode 100644 index 0000000..7834294 --- /dev/null +++ b/modules/nf-core/fastqc/tests/tags.yml @@ -0,0 +1,2 @@ +fastqc: + - modules/nf-core/fastqc/** diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml new file mode 100644 index 0000000..bc0bdb5 --- /dev/null +++ b/modules/nf-core/multiqc/environment.yml @@ -0,0 +1,7 @@ +name: multiqc +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::multiqc=1.18 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 4b60474..00cc48d 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -1,10 +1,10 @@ process MULTIQC { label 'process_single' - conda "bioconda::multiqc=1.14" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : - 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.18--pyhdfd78af_0' : + 'biocontainers/multiqc:1.18--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" @@ -25,12 +25,14 @@ process MULTIQC { def args = task.ext.args ?: '' def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' + def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : '' """ multiqc \\ --force \\ $args \\ $config \\ $extra_config \\ + $logo \\ . cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index f93b5ee..f1aa660 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,5 +1,5 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json -name: MultiQC +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: multiqc description: Aggregate results from bioinformatics analyses across many samples into a single report keywords: - QC @@ -13,7 +13,6 @@ tools: homepage: https://multiqc.info/ documentation: https://multiqc.info/docs/ licence: ["GPL-3.0-or-later"] - input: - multiqc_files: type: file @@ -31,7 +30,6 @@ input: type: file description: Optional logo file for MultiQC pattern: "*.{png}" - output: - report: type: file @@ -54,3 +52,8 @@ authors: - "@bunop" - "@drpatelh" - "@jfy133" +maintainers: + - "@abhi18av" + - "@bunop" + - "@drpatelh" + - "@jfy133" diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test new file mode 100644 index 0000000..dd6bad5 --- /dev/null +++ b/modules/nf-core/multiqc/tests/main.nf.test @@ -0,0 +1,91 @@ +nextflow_process { + + name "Test Process MULTIQC" + script "modules/nf-core/multiqc/main.nf" + process "MULTIQC" + tag "modules" + tag "modules_nfcore" + tag "multiqc" + + test("MULTIQC: FASTQC") { + + setup { + run("FASTQC") { + script "../../fastqc/main.nf" + process { + """ + input[0] = Channel.of([ + [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = FASTQC.out.zip.collect { it[1] } + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.report.get(0)).exists() }, + { assert path(process.out.data.get(0)).exists() }, + { assert path(process.out.versions.get(0)).getText().contains("multiqc") } + ) + } + + } + + test("MULTIQC: FASTQC and a config file") { + + setup { + run("FASTQC") { + script "../../fastqc/main.nf" + process { + """ + input[0] = Channel.of([ + [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = FASTQC.out.zip.collect { it[1] } + input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.report.get(0)).exists() }, + { assert path(process.out.data.get(0)).exists() }, + { assert path(process.out.versions.get(0)).getText().contains("multiqc") } + ) + } + + } +} diff --git a/modules/nf-core/multiqc/tests/tags.yml b/modules/nf-core/multiqc/tests/tags.yml new file mode 100644 index 0000000..bea6c0d --- /dev/null +++ b/modules/nf-core/multiqc/tests/tags.yml @@ -0,0 +1,2 @@ +multiqc: + - modules/nf-core/multiqc/** diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml new file mode 100644 index 0000000..3c6f95b --- /dev/null +++ b/modules/nf-core/samtools/index/environment.yml @@ -0,0 +1,7 @@ +name: samtools_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.17 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index 8b95687..256bd7c 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda "bioconda::samtools=1.16.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index e5cadbc..01a4ee0 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -12,7 +12,7 @@ tools: short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. These files are generated as output by short read aligners like BWA. homepage: http://www.htslib.org/ - documentation: hhttp://www.htslib.org/doc/samtools.html + documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] input: @@ -51,3 +51,7 @@ authors: - "@drpatelh" - "@ewels" - "@maxulysse" +maintainers: + - "@drpatelh" + - "@ewels" + - "@maxulysse" diff --git a/modules/nf-core/samtools/index/tests/csi.nextflow.config b/modules/nf-core/samtools/index/tests/csi.nextflow.config new file mode 100644 index 0000000..0ed260e --- /dev/null +++ b/modules/nf-core/samtools/index/tests/csi.nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_INDEX { + ext.args = '-c' + } + +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test new file mode 100644 index 0000000..2d3d9e5 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process SAMTOOLS_INDEX" + script "modules/nf-core/samtools/index/main.nf" + process "SAMTOOLS_INDEX" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/index" + + test("sarscov2 [BAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.bai).match("bai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CRAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.crai).match("crai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CSI]") { + + config "./csi.nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert path(process.out.csi.get(0).get(1)).exists() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap new file mode 100644 index 0000000..b3baee7 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "crai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ] + ], + "timestamp": "2023-11-15T15:17:37.30801" + }, + "bai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ] + ], + "timestamp": "2023-11-15T15:17:30.869234" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/index/tests/tags.yml b/modules/nf-core/samtools/index/tests/tags.yml new file mode 100644 index 0000000..e0f58a7 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/index: + - modules/nf-core/samtools/index/** diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml new file mode 100644 index 0000000..508659f --- /dev/null +++ b/modules/nf-core/samtools/sort/environment.yml @@ -0,0 +1,7 @@ +name: samtools_sort +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.17 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 84c167c..60f0c63 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_SORT { tag "$meta.id" label 'process_medium' - conda "bioconda::samtools=1.16.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(bam) @@ -23,7 +23,13 @@ process SAMTOOLS_SORT { def prefix = task.ext.prefix ?: "${meta.id}" if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ - samtools sort $args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam + samtools sort \\ + $args \\ + -@ $task.cpus \\ + -o ${prefix}.bam \\ + -T $prefix \\ + $bam + cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml index 0928975..2200de7 100644 --- a/modules/nf-core/samtools/sort/meta.yml +++ b/modules/nf-core/samtools/sort/meta.yml @@ -12,7 +12,7 @@ tools: short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. These files are generated as output by short read aligners like BWA. homepage: http://www.htslib.org/ - documentation: hhttp://www.htslib.org/doc/samtools.html + documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] input: @@ -46,3 +46,6 @@ output: authors: - "@drpatelh" - "@ewels" +maintainers: + - "@drpatelh" + - "@ewels" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test new file mode 100644 index 0000000..c690581 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test @@ -0,0 +1,70 @@ +nextflow_process { + + name "Test Process SAMTOOLS_SORT" + script "modules/nf-core/samtools/sort/main.nf" + process "SAMTOOLS_SORT" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/sort" + + test("test_samtools_sort") { + + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_samtools_sort_stub") { + + config "./nextflow.config" + options "-stub-run" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test.snap b/modules/nf-core/samtools/sort/tests/main.nf.test.snap new file mode 100644 index 0000000..a43566d --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test.snap @@ -0,0 +1,39 @@ +{ + "test_samtools_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,a29570e7607d217c2fa4d75829e09cd7" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,46f7a36082fa1f68285fe30d689244e8" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,a29570e7607d217c2fa4d75829e09cd7" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,46f7a36082fa1f68285fe30d689244e8" + ] + } + ], + "timestamp": "2023-10-17T17:21:46.5427968" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/sort/tests/nextflow.config b/modules/nf-core/samtools/sort/tests/nextflow.config new file mode 100644 index 0000000..d0f3508 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/modules/nf-core/samtools/sort/tests/tags.yml b/modules/nf-core/samtools/sort/tests/tags.yml new file mode 100644 index 0000000..cd63ea2 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/tags.yml @@ -0,0 +1,3 @@ +samtools/sort: + - modules/nf-core/samtools/sort/** + - tests/modules/nf-core/samtools/sort/** diff --git a/modules/nf-core/star/align/environment.yml b/modules/nf-core/star/align/environment.yml new file mode 100644 index 0000000..6db2098 --- /dev/null +++ b/modules/nf-core/star/align/environment.yml @@ -0,0 +1,9 @@ +name: star_align +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::star=2.7.10a + - bioconda::samtools=1.16.1 + - conda-forge::gawk=5.1.0 diff --git a/modules/nf-core/star/align/star-align.diff b/modules/nf-core/star/align/star-align.diff index 9e56c72..6ba86af 100644 --- a/modules/nf-core/star/align/star-align.diff +++ b/modules/nf-core/star/align/star-align.diff @@ -1,31 +1,134 @@ Changes in module 'nf-core/star/align' +--- modules/nf-core/star/align/meta.yml ++++ modules/nf-core/star/align/meta.yml +@@ -25,33 +25,10 @@ + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. +- - meta2: +- type: map +- description: | +- Groovy Map containing reference information +- e.g. [ id:'test' ] + - index: + type: directory + description: STAR genome index + pattern: "star" +- - meta3: +- type: map +- description: | +- Groovy Map containing reference information +- e.g. [ id:'test' ] +- - gtf: +- type: file +- description: Annotation GTF file +- pattern: "*.{gtf}" +- - star_ignore_sjdbgtf: +- type: boolean +- description: Ignore annotation GTF file +- - seq_platform: +- type: string +- description: Sequencing platform +- - seq_center: +- type: string +- description: Sequencing center + output: + - bam: + type: file +@@ -97,19 +74,8 @@ + type: file + description: STAR chimeric junction output file (optional) + pattern: "*.out.junction" +- - wig: +- type: file +- description: STAR output wiggle format file(s) (optional) +- pattern: "*.wig" +- - bedgraph: +- type: file +- description: STAR output bedGraph format file(s) (optional) +- pattern: "*.bg" ++ + authors: + - "@kevinmenden" + - "@drpatelh" + - "@praveenraj2018" +-maintainers: +- - "@kevinmenden" +- - "@drpatelh" +- - "@praveenraj2018" + --- modules/nf-core/star/align/main.nf +++ modules/nf-core/star/align/main.nf -@@ -2,15 +2,16 @@ +@@ -2,37 +2,34 @@ tag "$meta.id" label 'process_high' -- conda "bioconda::star=2.7.10a bioconda::samtools=1.16.1 conda-forge::gawk=5.1.0" +- conda "${moduleDir}/environment.yml" + // Note: 2.7X indices incompatible with AWS iGenomes. + conda "bioconda::star=2.7.9a" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? -- 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' : -- 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" +- 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:019f262d90511939dce2dca4b7c868fc108f73db-0' : +- 'biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:019f262d90511939dce2dca4b7c868fc108f73db-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' }" input: - tuple val(meta), path(reads) -- path index -- path gtf +- tuple val(meta), path(reads, stageAs: "input*/*") +- tuple val(meta2), path(index) +- tuple val(meta3), path(gtf) ++ tuple val(meta), path(reads) + path index + path gtf val star_ignore_sjdbgtf val seq_platform val seq_center -@@ -51,9 +52,7 @@ + + output: ++ tuple val(meta), path('*d.out.bam') , emit: bam + tuple val(meta), path('*Log.final.out') , emit: log_final + tuple val(meta), path('*Log.out') , emit: log_out + tuple val(meta), path('*Log.progress.out'), emit: log_progress + path "versions.yml" , emit: versions + +- tuple val(meta), path('*d.out.bam') , optional:true, emit: bam + tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted + tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript + tuple val(meta), path('*Aligned.unsort.out.bam') , optional:true, emit: bam_unsorted + tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq + tuple val(meta), path('*.tab') , optional:true, emit: tab +- tuple val(meta), path('*.SJ.out.tab') , optional:true, emit: spl_junc_tab +- tuple val(meta), path('*.ReadsPerGene.out.tab') , optional:true, emit: read_per_gene_tab + tuple val(meta), path('*.out.junction') , optional:true, emit: junction + tuple val(meta), path('*.out.sam') , optional:true, emit: sam +- tuple val(meta), path('*.wig') , optional:true, emit: wig +- tuple val(meta), path('*.bg') , optional:true, emit: bedgraph + + when: + task.ext.when == null || task.ext.when +@@ -40,27 +37,22 @@ + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" +- def reads1 = [], reads2 = [] +- meta.single_end ? [reads].flatten().each{reads1 << it} : reads.eachWithIndex{ v, ix -> ( ix & 1 ? reads2 : reads1) << v } + def ignore_gtf = star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" + def seq_platform = seq_platform ? "'PL:$seq_platform'" : "" +- def seq_center = seq_center ? "'CN:$seq_center'" : "" +- def attrRG = args.contains("--outSAMattrRGline") ? "" : "--outSAMattrRGline 'ID:$prefix' $seq_center 'SM:$prefix' $seq_platform" ++ def seq_center = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix' $seq_platform " : "--outSAMattrRGline ID:$prefix 'SM:$prefix' $seq_platform " + def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' + def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' + """ + STAR \\ + --genomeDir $index \\ +- --readFilesIn ${reads1.join(",")} ${reads2.join(",")} \\ ++ --readFilesIn $reads \\ + --runThreadN $task.cpus \\ + --outFileNamePrefix $prefix. \\ + $out_sam_type \\ $ignore_gtf \\ - $seq_center \\ +- $attrRG \\ ++ $seq_center \\ $args - $mv_unsorted_bam @@ -33,7 +136,7 @@ Changes in module 'nf-core/star/align' if [ -f ${prefix}.Unmapped.out.mate1 ]; then mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq gzip ${prefix}.unmapped_1.fastq -@@ -62,36 +61,9 @@ +@@ -69,41 +61,9 @@ mv ${prefix}.Unmapped.out.mate2 ${prefix}.unmapped_2.fastq gzip ${prefix}.unmapped_2.fastq fi @@ -56,11 +159,16 @@ Changes in module 'nf-core/star/align' - touch ${prefix}.sortedByCoord.out.bam - touch ${prefix}.toTranscriptome.out.bam - touch ${prefix}.Aligned.unsort.out.bam +- touch ${prefix}.Aligned.sortedByCoord.out.bam - touch ${prefix}.unmapped_1.fastq.gz - touch ${prefix}.unmapped_2.fastq.gz - touch ${prefix}.tab +- touch ${prefix}.SJ.out.tab +- touch ${prefix}.ReadsPerGene.out.tab - touch ${prefix}.Chimeric.out.junction - touch ${prefix}.out.sam +- touch ${prefix}.Signal.UniqueMultiple.str1.out.wig +- touch ${prefix}.Signal.UniqueMultiple.str1.out.bg - - cat <<-END_VERSIONS > versions.yml - "${task.process}": diff --git a/modules/nf-core/star/align/tests/main.nf.test b/modules/nf-core/star/align/tests/main.nf.test new file mode 100644 index 0000000..a4687d3 --- /dev/null +++ b/modules/nf-core/star/align/tests/main.nf.test @@ -0,0 +1,339 @@ +nextflow_process { + + name "Test Process STAR_ALIGN" + script "modules/nf-core/star/align/main.nf" + process "STAR_ALIGN" + tag "modules" + tag "modules_nfcore" + tag "star" + tag "star/align" + + test("homo_sapiens - single_end") { + config "./nextflow.config" + + setup { + run("STAR_GENOMEGENERATE") { + script "../../../star/genomegenerate/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true) ] + ]) + input[1] = STAR_GENOMEGENERATE.out.index + input[2] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + input[3] = false + input[4] = 'illumina' + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log_final[0][1]).name).match("homo_sapiens - single_end - log_final") }, + { assert snapshot(file(process.out.log_out[0][1]).name).match("homo_sapiens - single_end - log_out") }, + { assert snapshot(process.out.bam).match("homo_sapiens - single_end - bam") }, + { assert snapshot(process.out.bam_sorted).match("homo_sapiens - single_end - bam_sorted") }, + { assert snapshot(process.out.bam_transcript).match("homo_sapiens - single_end - bam_transcript") }, + { assert snapshot(process.out.bam_unsorted).match("homo_sapiens - single_end - bam_unsorted") }, + { assert snapshot(process.out.bedgraph).match("homo_sapiens - single_end - bedgraph") }, + { assert snapshot(process.out.fastq).match("homo_sapiens - single_end - fastq") }, + { assert snapshot(process.out.junction).match("homo_sapiens - single_end - junction") }, + { assert snapshot(process.out.log_progress).match("homo_sapiens - single_end - log_progress") }, + { assert snapshot(process.out.read_per_gene_tab).match("homo_sapiens - single_end - read_per_gene_tab") }, + { assert snapshot(process.out.sam).match("homo_sapiens - single_end - sam") }, + { assert snapshot(process.out.spl_junc_tab).match("homo_sapiens - single_end - spl_junc_tab") }, + { assert snapshot(process.out.tab).match("homo_sapiens - single_end - tab") }, + { assert snapshot(process.out.wig).match("homo_sapiens - single_end - wig") }, + { assert snapshot(process.out.versions).match("homo_sapiens - single_end - versions") } + ) + } + } + + test("homo_sapiens - paired_end") { + config "./nextflow.config" + + setup { + run("STAR_GENOMEGENERATE") { + script "../../../star/genomegenerate/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true) + ] + ]) + input[1] = STAR_GENOMEGENERATE.out.index + input[2] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + input[3] = false + input[4] = 'illumina' + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log_final[0][1]).name).match("homo_sapiens - paired_end - log_final") }, + { assert snapshot(file(process.out.log_out[0][1]).name).match("homo_sapiens - paired_end - log_out") }, + { assert snapshot(process.out.bam).match("homo_sapiens - paired_end - bam") }, + { assert snapshot(process.out.bam_sorted).match("homo_sapiens - paired_end - bam_sorted") }, + { assert snapshot(process.out.bam_transcript).match("homo_sapiens - paired_end - bam_transcript") }, + { assert snapshot(process.out.bam_unsorted).match("homo_sapiens - paired_end - bam_unsorted") }, + { assert snapshot(process.out.bedgraph).match("homo_sapiens - paired_end - bedgraph") }, + { assert snapshot(process.out.fastq).match("homo_sapiens - paired_end - fastq") }, + { assert snapshot(process.out.junction).match("homo_sapiens - paired_end - junction") }, + { assert snapshot(process.out.log_progress).match("homo_sapiens - paired_end - log_progress") }, + { assert snapshot(process.out.read_per_gene_tab).match("homo_sapiens - paired_end - read_per_gene_tab") }, + { assert snapshot(process.out.sam).match("homo_sapiens - paired_end - sam") }, + { assert snapshot(process.out.spl_junc_tab).match("homo_sapiens - paired_end - spl_junc_tab") }, + { assert snapshot(process.out.tab).match("homo_sapiens - paired_end - tab") }, + { assert snapshot(process.out.wig).match("homo_sapiens - paired_end - wig") }, + { assert snapshot(process.out.versions).match("homo_sapiens - paired_end - versions") } + ) + } + } + + test("homo_sapiens - paired_end - arriba") { + config "./nextflow.arriba.config" + + setup { + run("STAR_GENOMEGENERATE") { + script "../../../star/genomegenerate/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true) + ] + ]) + input[1] = STAR_GENOMEGENERATE.out.index + input[2] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + input[3] = false + input[4] = 'illumina' + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log_final[0][1]).name).match("homo_sapiens - paired_end - arriba - log_final") }, + { assert snapshot(file(process.out.log_out[0][1]).name).match("homo_sapiens - paired_end - arriba - log_out") }, + { assert snapshot(file(process.out.log_progress[0][1]).name).match("homo_sapiens - paired_end - arriba - log_progress") }, + { assert snapshot(process.out.bam).match("homo_sapiens - paired_end - arriba - bam") }, + { assert snapshot(process.out.bam_sorted).match("homo_sapiens - paired_end - arriba - bam_sorted") }, + { assert snapshot(process.out.bam_transcript).match("homo_sapiens - paired_end - arriba - bam_transcript") }, + { assert snapshot(process.out.bam_unsorted).match("homo_sapiens - paired_end - arriba - bam_unsorted") }, + { assert snapshot(process.out.bedgraph).match("homo_sapiens - paired_end - arriba - bedgraph") }, + { assert snapshot(process.out.fastq).match("homo_sapiens - paired_end - arriba - fastq") }, + { assert snapshot(process.out.junction).match("homo_sapiens - paired_end - arriba - junction") }, + { assert snapshot(process.out.read_per_gene_tab).match("homo_sapiens - paired_end - arriba - read_per_gene_tab") }, + { assert snapshot(process.out.sam).match("homo_sapiens - paired_end - arriba - sam") }, + { assert snapshot(process.out.spl_junc_tab).match("homo_sapiens - paired_end - arriba - spl_junc_tab") }, + { assert snapshot(process.out.tab).match("homo_sapiens - paired_end - arriba - tab") }, + { assert snapshot(process.out.wig).match("homo_sapiens - paired_end - arriba - wig") }, + { assert snapshot(process.out.versions).match("homo_sapiens - paired_end - arriba - versions") } + ) + } + } + + test("homo_sapiens - paired_end - starfusion") { + config "./nextflow.starfusion.config" + + setup { + run("STAR_GENOMEGENERATE") { + script "../../../star/genomegenerate/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true) + ] + ]) + input[1] = STAR_GENOMEGENERATE.out.index + input[2] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + input[3] = false + input[4] = 'illumina' + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log_final[0][1]).name).match("homo_sapiens - paired_end - starfusion - log_final") }, + { assert snapshot(file(process.out.log_out[0][1]).name).match("homo_sapiens - paired_end - starfusion - log_out") }, + { assert snapshot(file(process.out.log_progress[0][1]).name).match("homo_sapiens - paired_end - starfusion - log_progress") }, + { assert snapshot(process.out.bam).match("homo_sapiens - paired_end - starfusion - bam") }, + { assert snapshot(process.out.bam_sorted).match("homo_sapiens - paired_end - starfusion - bam_sorted") }, + { assert snapshot(process.out.bam_transcript).match("homo_sapiens - paired_end - starfusion - bam_transcript") }, + { assert snapshot(process.out.bam_unsorted).match("homo_sapiens - paired_end - starfusion - bam_unsorted") }, + { assert snapshot(process.out.bedgraph).match("homo_sapiens - paired_end - starfusion - bedgraph") }, + { assert snapshot(process.out.fastq).match("homo_sapiens - paired_end - starfusion - fastq") }, + { assert snapshot(process.out.junction).match("homo_sapiens - paired_end - starfusion - junction") }, + { assert snapshot(process.out.read_per_gene_tab).match("homo_sapiens - paired_end - starfusion - read_per_gene_tab") }, + { assert snapshot(process.out.sam).match("homo_sapiens - paired_end - starfusion - sam") }, + { assert snapshot(process.out.spl_junc_tab).match("homo_sapiens - paired_end - starfusion - spl_junc_tab") }, + { assert snapshot(process.out.tab).match("homo_sapiens - paired_end - starfusion - tab") }, + { assert snapshot(process.out.wig).match("homo_sapiens - paired_end - starfusion - wig") }, + { assert snapshot(process.out.versions).match("homo_sapiens - paired_end - starfusion - versions") } + ) + } + } + + test("homo_sapiens - paired_end - multiple") { + config "./nextflow.config" + + setup { + run("STAR_GENOMEGENERATE") { + script "../../../star/genomegenerate/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true) + ] + ]) + input[1] = STAR_GENOMEGENERATE.out.index + input[2] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + input[3] = false + input[4] = 'illumina' + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log_final[0][1]).name).match("homo_sapiens - paired_end - multiple - log_final") }, + { assert snapshot(file(process.out.log_out[0][1]).name).match("homo_sapiens - paired_end - multiple - log_out") }, + { assert snapshot(file(process.out.log_progress[0][1]).name).match("homo_sapiens - paired_end - multiple - log_progress") }, + { assert snapshot(process.out.bam).match("homo_sapiens - paired_end - multiple - bam") }, + { assert snapshot(process.out.bam_sorted).match("homo_sapiens - paired_end - multiple - bam_sorted") }, + { assert snapshot(process.out.bam_transcript).match("homo_sapiens - paired_end - multiple - bam_transcript") }, + { assert snapshot(process.out.bam_unsorted).match("homo_sapiens - paired_end - multiple - bam_unsorted") }, + { assert snapshot(process.out.bedgraph).match("homo_sapiens - paired_end - multiple - bedgraph") }, + { assert snapshot(process.out.fastq).match("homo_sapiens - paired_end - multiple - fastq") }, + { assert snapshot(process.out.junction).match("homo_sapiens - paired_end - multiple - junction") }, + { assert snapshot(process.out.read_per_gene_tab).match("homo_sapiens - paired_end - multiple - read_per_gene_tab") }, + { assert snapshot(process.out.sam).match("homo_sapiens - paired_end - multiple - sam") }, + { assert snapshot(process.out.spl_junc_tab).match("homo_sapiens - paired_end - multiple - spl_junc_tab") }, + { assert snapshot(process.out.tab).match("homo_sapiens - paired_end - multiple - tab") }, + { assert snapshot(process.out.wig).match("homo_sapiens - paired_end - multiple - wig") }, + { assert snapshot(process.out.versions).match("homo_sapiens - paired_end - multiple - versions") } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/star/align/tests/main.nf.test.snap b/modules/nf-core/star/align/tests/main.nf.test.snap new file mode 100644 index 0000000..59b735d --- /dev/null +++ b/modules/nf-core/star/align/tests/main.nf.test.snap @@ -0,0 +1,769 @@ +{ + "homo_sapiens - paired_end - multiple - bam_sorted": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.sortedByCoord.out.bam:md5,ab07c21d63ab0a6c07d171d213c81d5a" + ] + ] + ], + "timestamp": "2023-11-23T13:29:01.19639" + }, + "homo_sapiens - paired_end - multiple - wig": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.857804" + }, + "homo_sapiens - paired_end - arriba - tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,5155c9fd1f787ad6d7d80987fb06219c" + ] + ] + ], + "timestamp": "2023-11-23T13:25:07.396223" + }, + "homo_sapiens - single_end - wig": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.24701" + }, + "homo_sapiens - paired_end - sam": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.383818" + }, + "homo_sapiens - paired_end - arriba - versions": { + "content": [ + [ + "versions.yml:md5,452ef035aacbc68d47041e86279a9333" + ] + ], + "timestamp": "2023-11-23T13:25:07.494015" + }, + "homo_sapiens - paired_end - multiple - bedgraph": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.Signal.Unique.str1.out.bg:md5,d7bf8b70b436ca048a62513e1d0ece3a", + "test.Signal.UniqueMultiple.str1.out.bg:md5,686d58493b9eb445b56ace4d67f76ef6" + ] + ] + ] + ], + "timestamp": "2023-11-23T13:29:01.396383" + }, + "homo_sapiens - paired_end - read_per_gene_tab": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.368841" + }, + "homo_sapiens - paired_end - arriba - bedgraph": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.102537" + }, + "homo_sapiens - single_end - junction": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.185369" + }, + "homo_sapiens - paired_end - arriba - spl_junc_tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,5155c9fd1f787ad6d7d80987fb06219c" + ] + ] + ], + "timestamp": "2023-11-23T13:25:07.348239" + }, + "homo_sapiens - single_end - sam": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.216183" + }, + "homo_sapiens - paired_end - fastq": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.327236" + }, + "homo_sapiens - single_end - versions": { + "content": [ + [ + "versions.yml:md5,452ef035aacbc68d47041e86279a9333" + ] + ], + "timestamp": "2023-11-23T13:22:55.259282" + }, + "homo_sapiens - paired_end - multiple - log_out": { + "content": [ + "test.Log.out" + ], + "timestamp": "2023-11-23T13:29:01.022176" + }, + "homo_sapiens - paired_end - arriba - fastq": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.15277" + }, + "homo_sapiens - paired_end - multiple - junction": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.52923" + }, + "homo_sapiens - paired_end - multiple - spl_junc_tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,069877e053714e23010fe4e1c003b4a2" + ] + ] + ], + "timestamp": "2023-11-23T13:29:01.729175" + }, + "homo_sapiens - paired_end - starfusion - log_final": { + "content": [ + "test.Log.final.out" + ], + "timestamp": "2023-11-23T13:27:55.905883" + }, + "homo_sapiens - paired_end - starfusion - fastq": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.192302" + }, + "homo_sapiens - paired_end - multiple - sam": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.661837" + }, + "homo_sapiens - paired_end - multiple - log_final": { + "content": [ + "test.Log.final.out" + ], + "timestamp": "2023-11-23T13:29:00.966417" + }, + "homo_sapiens - paired_end - starfusion - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.out.bam:md5,bcad07b838f6762fc01eea52b5cd3f84" + ] + ] + ], + "timestamp": "2023-11-23T13:27:56.003675" + }, + "homo_sapiens - paired_end - arriba - junction": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.202776" + }, + "homo_sapiens - single_end - bedgraph": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "test.Signal.Unique.str1.out.bg:md5,c56fc1472776fb927eaf62d973da5f9a", + "test.Signal.UniqueMultiple.str1.out.bg:md5,e93373cf6f2a2a9506e2efdb260cdd4f" + ] + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.163495" + }, + "homo_sapiens - paired_end - arriba - read_per_gene_tab": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.251962" + }, + "homo_sapiens - paired_end - starfusion - bam_sorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.040843" + }, + "homo_sapiens - single_end - bam_unsorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.154172" + }, + "homo_sapiens - paired_end - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.sortedByCoord.out.bam:md5,b9ee1c607e07323bc1652ef3babb543f" + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.265265" + }, + "homo_sapiens - paired_end - arriba - bam_transcript": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:06.998817" + }, + "homo_sapiens - paired_end - log_out": { + "content": [ + "test.Log.out" + ], + "timestamp": "2023-11-23T13:23:33.259699" + }, + "homo_sapiens - paired_end - arriba - log_out": { + "content": [ + "test.Log.out" + ], + "timestamp": "2023-11-23T13:25:06.849451" + }, + "homo_sapiens - paired_end - multiple - versions": { + "content": [ + [ + "versions.yml:md5,452ef035aacbc68d47041e86279a9333" + ] + ], + "timestamp": "2023-11-23T13:29:01.937182" + }, + "homo_sapiens - paired_end - starfusion - bam_transcript": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.082408" + }, + "homo_sapiens - paired_end - starfusion - tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,19c3faa1bfa9a0cc5e4c45f17065b53a" + ] + ] + ], + "timestamp": "2023-11-23T13:27:56.379367" + }, + "homo_sapiens - single_end - fastq": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.175307" + }, + "homo_sapiens - paired_end - tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,844af19ab0fc8cd9a3f75228445aca0d" + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.413683" + }, + "homo_sapiens - paired_end - starfusion - bedgraph": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.155413" + }, + "homo_sapiens - single_end - bam_transcript": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.144852" + }, + "homo_sapiens - paired_end - versions": { + "content": [ + [ + "versions.yml:md5,452ef035aacbc68d47041e86279a9333" + ] + ], + "timestamp": "2023-11-23T13:23:33.445323" + }, + "homo_sapiens - paired_end - multiple - tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,069877e053714e23010fe4e1c003b4a2" + ] + ] + ], + "timestamp": "2023-11-23T13:29:01.793129" + }, + "homo_sapiens - single_end - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.Aligned.sortedByCoord.out.bam:md5,c6cfaccaf91bc7fdabed3cfe236d4535" + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.128568" + }, + "homo_sapiens - paired_end - arriba - wig": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.444214" + }, + "homo_sapiens - paired_end - log_progress": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Log.progress.out:md5,b2bd061d6cbaaf3d6d3b1fed547f69b8" + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.354416" + }, + "homo_sapiens - paired_end - arriba - log_final": { + "content": [ + "test.Log.final.out" + ], + "timestamp": "2023-11-23T13:25:06.829799" + }, + "homo_sapiens - paired_end - bam_unsorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.300509" + }, + "homo_sapiens - paired_end - arriba - sam": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.300383" + }, + "homo_sapiens - paired_end - multiple - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.sortedByCoord.out.bam:md5,ab07c21d63ab0a6c07d171d213c81d5a" + ] + ] + ], + "timestamp": "2023-11-23T13:29:01.13168" + }, + "homo_sapiens - paired_end - multiple - fastq": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.462257" + }, + "homo_sapiens - single_end - bam_sorted": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.Aligned.sortedByCoord.out.bam:md5,c6cfaccaf91bc7fdabed3cfe236d4535" + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.134799" + }, + "homo_sapiens - paired_end - arriba - bam_sorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:06.94699" + }, + "homo_sapiens - paired_end - starfusion - junction": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Chimeric.out.junction:md5,c10ef219f4a30e83711b995bc5e40dba" + ] + ] + ], + "timestamp": "2023-11-23T13:27:56.228327" + }, + "homo_sapiens - single_end - tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.SJ.out.tab:md5,75a516ab950fb958f40b29996474949c" + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.236346" + }, + "homo_sapiens - paired_end - starfusion - versions": { + "content": [ + [ + "versions.yml:md5,452ef035aacbc68d47041e86279a9333" + ] + ], + "timestamp": "2023-11-23T13:27:56.460903" + }, + "homo_sapiens - paired_end - multiple - bam_unsorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.330463" + }, + "homo_sapiens - paired_end - arriba - log_progress": { + "content": [ + "test.Log.progress.out" + ], + "timestamp": "2023-11-23T13:25:06.86866" + }, + "homo_sapiens - paired_end - bedgraph": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.Signal.Unique.str1.out.bg:md5,d7bf8b70b436ca048a62513e1d0ece3a", + "test.Signal.UniqueMultiple.str1.out.bg:md5,686d58493b9eb445b56ace4d67f76ef6" + ] + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.313258" + }, + "homo_sapiens - paired_end - starfusion - bam_unsorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.118974" + }, + "homo_sapiens - paired_end - starfusion - read_per_gene_tab": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.264699" + }, + "homo_sapiens - paired_end - multiple - log_progress": { + "content": [ + "test.Log.progress.out" + ], + "timestamp": "2023-11-23T13:29:01.076947" + }, + "homo_sapiens - paired_end - arriba - bam_unsorted": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:25:07.050409" + }, + "homo_sapiens - paired_end - bam_sorted": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.sortedByCoord.out.bam:md5,b9ee1c607e07323bc1652ef3babb543f" + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.274809" + }, + "homo_sapiens - single_end - spl_junc_tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.SJ.out.tab:md5,75a516ab950fb958f40b29996474949c" + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.226143" + }, + "homo_sapiens - paired_end - starfusion - spl_junc_tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,19c3faa1bfa9a0cc5e4c45f17065b53a" + ] + ] + ], + "timestamp": "2023-11-23T13:27:56.337072" + }, + "homo_sapiens - single_end - log_out": { + "content": [ + "test.Log.out" + ], + "timestamp": "2023-11-23T13:22:55.126286" + }, + "homo_sapiens - paired_end - log_final": { + "content": [ + "test.Log.final.out" + ], + "timestamp": "2023-11-23T13:23:33.253884" + }, + "homo_sapiens - single_end - log_final": { + "content": [ + "test.Log.final.out" + ], + "timestamp": "2023-11-23T13:22:55.11799" + }, + "homo_sapiens - paired_end - bam_transcript": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.287684" + }, + "homo_sapiens - paired_end - starfusion - log_progress": { + "content": [ + "test.Log.progress.out" + ], + "timestamp": "2023-11-23T13:27:55.971484" + }, + "homo_sapiens - paired_end - multiple - bam_transcript": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.264176" + }, + "homo_sapiens - paired_end - multiple - read_per_gene_tab": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:29:01.596406" + }, + "homo_sapiens - single_end - read_per_gene_tab": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:22:55.205936" + }, + "homo_sapiens - paired_end - junction": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.340653" + }, + "homo_sapiens - paired_end - spl_junc_tab": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.SJ.out.tab:md5,844af19ab0fc8cd9a3f75228445aca0d" + ] + ] + ], + "timestamp": "2023-11-23T13:23:33.398603" + }, + "homo_sapiens - paired_end - starfusion - sam": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.300637" + }, + "homo_sapiens - paired_end - arriba - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.Aligned.out.bam:md5,c1b1747f5873f2d17762725636e891d5" + ] + ] + ], + "timestamp": "2023-11-23T13:25:06.887604" + }, + "homo_sapiens - single_end - log_progress": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.Log.progress.out:md5,b2bd061d6cbaaf3d6d3b1fed547f69b8" + ] + ] + ], + "timestamp": "2023-11-23T13:22:55.195544" + }, + "homo_sapiens - paired_end - starfusion - wig": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:27:56.422018" + }, + "homo_sapiens - paired_end - wig": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-23T13:23:33.429457" + }, + "homo_sapiens - paired_end - starfusion - log_out": { + "content": [ + "test.Log.out" + ], + "timestamp": "2023-11-23T13:27:55.93945" + } +} \ No newline at end of file diff --git a/modules/nf-core/star/align/tests/nextflow.arriba.config b/modules/nf-core/star/align/tests/nextflow.arriba.config new file mode 100644 index 0000000..2324b9e --- /dev/null +++ b/modules/nf-core/star/align/tests/nextflow.arriba.config @@ -0,0 +1,14 @@ +process { + + withName: STAR_GENOMEGENERATE { + ext.args = '--genomeSAindexNbases 9' + } + + withName: STAR_ALIGN { + ext.args = '--readFilesCommand zcat --outSAMtype BAM Unsorted --outSAMunmapped Within --outBAMcompression 0 --outFilterMultimapNmax 50 --peOverlapNbasesMin 10 --alignSplicedMateMapLminOverLmate 0.5 --alignSJstitchMismatchNmax 5 -1 5 5 --chimSegmentMin 10 --chimOutType WithinBAM HardClip --chimJunctionOverhangMin 10 --chimScoreDropMax 30 --chimScoreJunctionNonGTAG 0 --chimScoreSeparation 1 --chimSegmentReadGapMax 3 --chimMultimapNmax 50' + } + +} + +// Fix chown issue for the output star folder +docker.runOptions = '--platform=linux/amd64 -u $(id -u):$(id -g)' diff --git a/modules/nf-core/star/align/tests/nextflow.config b/modules/nf-core/star/align/tests/nextflow.config new file mode 100644 index 0000000..c4ac580 --- /dev/null +++ b/modules/nf-core/star/align/tests/nextflow.config @@ -0,0 +1,14 @@ +process { + + withName: STAR_GENOMEGENERATE { + ext.args = '--genomeSAindexNbases 9' + } + + withName: STAR_ALIGN { + ext.args = '--readFilesCommand zcat --outSAMtype BAM SortedByCoordinate --outWigType bedGraph --outWigStrand Unstranded' + } + +} + +// Fix chown issue for the output star folder +docker.runOptions = '--platform=linux/amd64 -u $(id -u):$(id -g)' diff --git a/modules/nf-core/star/align/tests/nextflow.starfusion.config b/modules/nf-core/star/align/tests/nextflow.starfusion.config new file mode 100644 index 0000000..467b649 --- /dev/null +++ b/modules/nf-core/star/align/tests/nextflow.starfusion.config @@ -0,0 +1,14 @@ +process { + + withName: STAR_GENOMEGENERATE { + ext.args = '--genomeSAindexNbases 9' + } + + withName: STAR_ALIGN { + ext.args = '--readFilesCommand zcat --outSAMtype BAM Unsorted --outReadsUnmapped None --twopassMode Basic --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' + } + +} + +// Fix chown issue for the output star folder +docker.runOptions = '--platform=linux/amd64 -u $(id -u):$(id -g)' diff --git a/modules/nf-core/star/align/tests/tags.yml b/modules/nf-core/star/align/tests/tags.yml new file mode 100644 index 0000000..8beace1 --- /dev/null +++ b/modules/nf-core/star/align/tests/tags.yml @@ -0,0 +1,2 @@ +star/align: + - modules/nf-core/star/align/** diff --git a/modules/nf-core/star/genomegenerate/environment.yml b/modules/nf-core/star/genomegenerate/environment.yml new file mode 100644 index 0000000..0b35ff5 --- /dev/null +++ b/modules/nf-core/star/genomegenerate/environment.yml @@ -0,0 +1,9 @@ +name: star_genomegenerate +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::star=2.7.10a + - bioconda::samtools=1.16.1 + - conda-forge::gawk=5.1.0 diff --git a/modules/nf-core/star/genomegenerate/star-genomegenerate.diff b/modules/nf-core/star/genomegenerate/star-genomegenerate.diff index 329cdc1..6099098 100644 --- a/modules/nf-core/star/genomegenerate/star-genomegenerate.diff +++ b/modules/nf-core/star/genomegenerate/star-genomegenerate.diff @@ -1,26 +1,72 @@ Changes in module 'nf-core/star/genomegenerate' +--- modules/nf-core/star/genomegenerate/meta.yml ++++ modules/nf-core/star/genomegenerate/meta.yml +@@ -15,28 +15,14 @@ + doi: 10.1093/bioinformatics/bts635 + licence: ["MIT"] + input: +- - meta: +- type: map +- description: | +- Groovy Map containing sample information +- e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Fasta file of the reference genome +- - meta2: +- type: map +- description: | +- Groovy Map containing reference information +- e.g. [ id:'test' ] + - gtf: + type: file + description: GTF file of the reference genome ++ + output: +- - meta: +- type: map +- description: | +- Groovy Map containing sample information +- e.g. [ id:'test', single_end:false ] + - index: + type: directory + description: Folder containing the star index files +@@ -45,9 +31,7 @@ + type: file + description: File containing software versions + pattern: "versions.yml" ++ + authors: + - "@kevinmenden" + - "@drpatelh" +-maintainers: +- - "@kevinmenden" +- - "@drpatelh" + --- modules/nf-core/star/genomegenerate/main.nf +++ modules/nf-core/star/genomegenerate/main.nf @@ -2,18 +2,19 @@ tag "$fasta" label 'process_high' -- conda "bioconda::star=2.7.10a bioconda::samtools=1.16.1 conda-forge::gawk=5.1.0" +- conda "${moduleDir}/environment.yml" + // Note: 2.7X indices incompatible with AWS iGenomes. + conda "bioconda::star=2.7.9a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? -- 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' : -- 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" +- 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:019f262d90511939dce2dca4b7c868fc108f73db-0' : +- 'biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:019f262d90511939dce2dca4b7c868fc108f73db-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' }" input: - path fasta - path gtf +- tuple val(meta), path(fasta) +- tuple val(meta2), path(gtf) ++ path fasta ++ path gtf output: -- path "star" , emit: index -- path "versions.yml", emit: versions +- tuple val(meta), path("star") , emit: index +- path "versions.yml" , emit: versions + path "star" , emit: index + path "versions.yml" , emit: versions diff --git a/modules/nf-core/star/genomegenerate/tests/main.nf.test b/modules/nf-core/star/genomegenerate/tests/main.nf.test new file mode 100644 index 0000000..64450a3 --- /dev/null +++ b/modules/nf-core/star/genomegenerate/tests/main.nf.test @@ -0,0 +1,38 @@ +nextflow_process { + + name "Test Process STAR_GENOMEGENERATE" + script "modules/nf-core/star/genomegenerate/main.nf" + process "STAR_GENOMEGENERATE" + tag "modules" + tag "modules_nfcore" + tag "star" + tag "star/genomegenerate" + + test("homo_sapiens") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test_fasta' ], + [file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + ]) + input[1] = Channel.of([ + [ id:'test_gtf' ], + [file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.index[0][1]).name).match("index") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/star/genomegenerate/tests/main.nf.test.snap b/modules/nf-core/star/genomegenerate/tests/main.nf.test.snap new file mode 100644 index 0000000..bd4e0ca --- /dev/null +++ b/modules/nf-core/star/genomegenerate/tests/main.nf.test.snap @@ -0,0 +1,16 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,9c11319b80fdedc90dadce4e0fb42ded" + ] + ], + "timestamp": "2023-11-23T11:18:14.835118" + }, + "index": { + "content": [ + "star" + ], + "timestamp": "2023-11-23T11:31:47.560528" + } +} \ No newline at end of file diff --git a/modules/nf-core/star/genomegenerate/tests/tags.yml b/modules/nf-core/star/genomegenerate/tests/tags.yml new file mode 100644 index 0000000..79f619b --- /dev/null +++ b/modules/nf-core/star/genomegenerate/tests/tags.yml @@ -0,0 +1,2 @@ +star/genomegenerate: + - modules/nf-core/star/genomegenerate/** diff --git a/modules/nf-core/trimmomatic/environment.yml b/modules/nf-core/trimmomatic/environment.yml new file mode 100644 index 0000000..91145bb --- /dev/null +++ b/modules/nf-core/trimmomatic/environment.yml @@ -0,0 +1,7 @@ +name: trimmomatic +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::trimmomatic=0.39 diff --git a/modules/nf-core/trimmomatic/tests/main.nf.test b/modules/nf-core/trimmomatic/tests/main.nf.test new file mode 100644 index 0000000..99a7653 --- /dev/null +++ b/modules/nf-core/trimmomatic/tests/main.nf.test @@ -0,0 +1,95 @@ +nextflow_process { + + name "Test Process TRIMMOMATIC" + script "modules/nf-core/trimmomatic/main.nf" + process "TRIMMOMATIC" + tag "modules" + tag "modules_nfcore" + tag "trimmomatic" + + test("Single-Read") { + config "./nextflow_SE.config" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id: 'test', single_end:true ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert process.out.trimmed_reads != null }, + { assert process.out.trimmed_reads.get(0).get(1) ==~ ".*.SE.paired.trim.fastq.gz" }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(process.out).match() } + ) + } + } + + test("Paired-Reads") { + config "./nextflow_PE.config" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id: 'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert process.out.trimmed_reads != null }, + { assert process.out.trimmed_reads.get(0).get(1).get(0) ==~ ".*.paired.trim_1.fastq.gz" }, + { assert process.out.trimmed_reads.get(0).get(1).get(1) ==~ ".*.paired.trim_2.fastq.gz" }, + { assert snapshot(process.out).match() }, + { assert snapshot(process.out.versions).match("versions") }, + ) + } + } + + test("No Adaptors") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id: 'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.failed } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/trimmomatic/tests/main.nf.test.snap b/modules/nf-core/trimmomatic/tests/main.nf.test.snap new file mode 100644 index 0000000..f1519f0 --- /dev/null +++ b/modules/nf-core/trimmomatic/tests/main.nf.test.snap @@ -0,0 +1,180 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,14413a048f088a147fb04f3d59c6c604" + ] + ], + "timestamp": "2023-10-18T12:15:39.464478" + }, + "Single-Read": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.SE.paired.trim.fastq.gz:md5,089a57f61d7197566b8a3ce71df79113" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.log:md5,e4c3f619e9b0e26847f8f3e3d9af319b" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary:md5,24c973237557a1439c775ca19a5deaa5" + ] + ], + "4": [ + "versions.yml:md5,14413a048f088a147fb04f3d59c6c604" + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.log:md5,e4c3f619e9b0e26847f8f3e3d9af319b" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary:md5,24c973237557a1439c775ca19a5deaa5" + ] + ], + "trimmed_reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.SE.paired.trim.fastq.gz:md5,089a57f61d7197566b8a3ce71df79113" + ] + ], + "unpaired_reads": [ + + ], + "versions": [ + "versions.yml:md5,14413a048f088a147fb04f3d59c6c604" + ] + } + ], + "timestamp": "2023-10-18T12:15:39.471788" + }, + "Paired-Reads": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.trim_1.fastq.gz:md5,575355b98cb5ef9071fad8014c702f4a", + "test.paired.trim_2.fastq.gz:md5,73fb54874d01b2854640266d12cc534a" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.unpaired.trim_1.fastq.gz:md5,2f7b5a15cc4e73a6fb4af1fa01f575cd", + "test.unpaired.trim_2.fastq.gz:md5,096ad7f876b6b704ef7f9f2c5af3cf74" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,9629761761a34576b3484bf4174f681f" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.summary:md5,9698e5e5c060bbe64588998fe35f8d71" + ] + ], + "4": [ + "versions.yml:md5,14413a048f088a147fb04f3d59c6c604" + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,9629761761a34576b3484bf4174f681f" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": false + }, + "test.summary:md5,9698e5e5c060bbe64588998fe35f8d71" + ] + ], + "trimmed_reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.trim_1.fastq.gz:md5,575355b98cb5ef9071fad8014c702f4a", + "test.paired.trim_2.fastq.gz:md5,73fb54874d01b2854640266d12cc534a" + ] + ] + ], + "unpaired_reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.unpaired.trim_1.fastq.gz:md5,2f7b5a15cc4e73a6fb4af1fa01f575cd", + "test.unpaired.trim_2.fastq.gz:md5,096ad7f876b6b704ef7f9f2c5af3cf74" + ] + ] + ], + "versions": [ + "versions.yml:md5,14413a048f088a147fb04f3d59c6c604" + ] + } + ], + "timestamp": "2023-10-18T12:15:44.677305" + } +} \ No newline at end of file diff --git a/modules/nf-core/trimmomatic/tests/nextflow_PE.config b/modules/nf-core/trimmomatic/tests/nextflow_PE.config new file mode 100644 index 0000000..3f8fdfe --- /dev/null +++ b/modules/nf-core/trimmomatic/tests/nextflow_PE.config @@ -0,0 +1,6 @@ +process { + + withName: TRIMMOMATIC { + ext.args = 'ILLUMINACLIP:TruSeq3-PE.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36' + } +} diff --git a/modules/nf-core/trimmomatic/tests/nextflow_SE.config b/modules/nf-core/trimmomatic/tests/nextflow_SE.config new file mode 100644 index 0000000..af777fd --- /dev/null +++ b/modules/nf-core/trimmomatic/tests/nextflow_SE.config @@ -0,0 +1,6 @@ +process { + + withName: TRIMMOMATIC { + ext.args = 'ILLUMINACLIP:TruSeq3-SE:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36' + } +} diff --git a/modules/nf-core/trimmomatic/tests/tags.yml b/modules/nf-core/trimmomatic/tests/tags.yml new file mode 100644 index 0000000..68c5af6 --- /dev/null +++ b/modules/nf-core/trimmomatic/tests/tags.yml @@ -0,0 +1,2 @@ +trimmomatic: + - modules/nf-core/trimmomatic/** diff --git a/modules/nf-core/trimmomatic/trimmomatic.diff b/modules/nf-core/trimmomatic/trimmomatic.diff index c128d21..543c257 100644 --- a/modules/nf-core/trimmomatic/trimmomatic.diff +++ b/modules/nf-core/trimmomatic/trimmomatic.diff @@ -1,21 +1,81 @@ Changes in module 'nf-core/trimmomatic' +--- modules/nf-core/trimmomatic/meta.yml ++++ modules/nf-core/trimmomatic/meta.yml +@@ -4,13 +4,16 @@ + - trimming + - adapter trimming + - quality trimming ++ + tools: + - "trimmomatic": + description: "A flexible read trimming tool for Illumina NGS data" + homepage: "http://www.usadellab.org/cms/?page=trimmomatic" + documentation: "https://github.com/usadellab/Trimmomatic" ++ tool_dev_url: "None" + doi: "10.1093/bioinformatics/btu170" + licence: "['GPL v3']" ++ + input: + - meta: + type: map +@@ -22,6 +25,7 @@ + description: | + Input FastQ files of size 1 or 2 for single-end and paired-end data, respectively. + pattern: "*.fastq.gz" ++ + output: + - meta: + type: map +@@ -40,15 +44,10 @@ + type: file + description: trimmomatic log file + pattern: "*.log" +- - summary: +- type: file +- description: trimmomatic summary file of surviving and dropped reads +- pattern: "*.summary" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" ++ + authors: + - "@alyssa-ab" +-maintainers: +- - "@alyssa-ab" + --- modules/nf-core/trimmomatic/main.nf +++ modules/nf-core/trimmomatic/main.nf -@@ -13,7 +13,8 @@ +@@ -2,10 +2,10 @@ + tag "$meta.id" + label 'process_medium' + +- conda "${moduleDir}/environment.yml" ++ conda "bioconda::trimmomatic=0.39" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/trimmomatic:0.39--hdfd78af_2': +- 'biocontainers/trimmomatic:0.39--hdfd78af_2' }" ++ 'quay.io/biocontainers/trimmomatic:0.39--hdfd78af_2' }" + + input: + tuple val(meta), path(reads) +@@ -13,8 +13,8 @@ output: tuple val(meta), path("*.paired.trim*.fastq.gz") , emit: trimmed_reads tuple val(meta), path("*.unpaired.trim_*.fastq.gz"), optional:true, emit: unpaired_reads - tuple val(meta), path("*.log") , emit: log +- tuple val(meta), path("*.summary") , emit: summary + tuple val(meta), path("*.trimmomatic.log") , emit: trimlog + tuple val(meta), path("*.trim_out.log") , emit: mqc_log path "versions.yml" , emit: versions when: -@@ -32,11 +33,12 @@ +@@ -33,12 +33,12 @@ trimmomatic \\ $trimmed \\ -threads $task.cpus \\ - -trimlog ${prefix}.log \\ +- -summary ${prefix}.summary \\ + -trimlog ${prefix}.trimmomatic.log \\ $reads \\ $output \\ diff --git a/nextflow.config b/nextflow.config index 8a8e195..f8f72f2 100644 --- a/nextflow.config +++ b/nextflow.config @@ -27,7 +27,7 @@ params { genome = null igenomes_base = 's3://ngi-igenomes/igenomes' igenomes_ignore = false - + // MultiQC options multiqc_config = null @@ -54,7 +54,7 @@ params { custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" config_profile_contact = null config_profile_url = null - + // Max resource options // Defaults only, expecting to be overwritten diff --git a/subworkflows/local/chimeric_reads.nf b/subworkflows/local/chimeric_reads.nf new file mode 100644 index 0000000..9bda209 --- /dev/null +++ b/subworkflows/local/chimeric_reads.nf @@ -0,0 +1,72 @@ +// +// Refine chimeric read counts and create final summary report. +// + +include { REMOVE_DUPLICATES } from '../../modules/local/remove_duplicates.nf' +include { CHIMERIC_CONTIG_EVIDENCE_ANALYZER } from '../../modules/local/chimeric_contig_evidence_analyzer.nf' +include { SUMMARY_REPORT } from '../../modules/local/summary_report.nf' + +workflow CHIMERIC_READS { + take: + bam_bai + gtf_extract + fasta_extract + filtered_abridged + genome_abundance_plot + read_counts_image + read_counts_log_image + gtf + igvjs_VIF + + main: + ch_versions = Channel.empty() + + ch_to_dupe_or_not = Channel.empty() + // Check if REMOVE_DUPLICATES.out.bam exists. + if (params.remove_duplicates) { + REMOVE_DUPLICATES ( bam_bai ) + ch_versions = ch_versions.mix(REMOVE_DUPLICATES.out.versions.first()) + ch_to_dupe_or_not = REMOVE_DUPLICATES.out.bam_bai + } else { + ch_to_dupe_or_not = bam_bai + } + + ch_to_dupe_or_not + .join(gtf_extract, by: [0]) + .set { ch_validate_bam_bai_gtf } + + CHIMERIC_CONTIG_EVIDENCE_ANALYZER ( + ch_validate_bam_bai_gtf + ) + ch_versions = ch_versions.mix(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.versions.first()) + + CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_bam + .join(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_bai, by: [0]) + .join(filtered_abridged, by: [0]) + .join(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_counts, by: [0]) + .join(gtf_extract, by: [0]) + .join(fasta_extract, by: [0]) + .join(genome_abundance_plot, by: [0]) + .join(read_counts_image, by: [0]) + .join(read_counts_log_image, by: [0]) + .set { ch_summary_report } + + SUMMARY_REPORT( + ch_summary_report, + gtf, + igvjs_VIF + ) + ch_versions = ch_versions.mix(SUMMARY_REPORT.out.versions.first()) + + + emit: + + evidence_counts = CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_counts + + html = SUMMARY_REPORT.out.html + refined_counts = SUMMARY_REPORT.out.refined_counts + refined_counts_w_genes = SUMMARY_REPORT.out.refined_counts_w_genes + genome_abundance_plot = SUMMARY_REPORT.out.genome_abundance_plot + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/local/host.nf b/subworkflows/local/host.nf new file mode 100644 index 0000000..a9a7d0e --- /dev/null +++ b/subworkflows/local/host.nf @@ -0,0 +1,63 @@ +// +// Align input reads against host genome. +// + +include { STAR_ALIGN as STAR_ALIGN_HOST } from '../../modules/nf-core/star/align/main.nf' +include { STAR_GENOMEGENERATE } from '../../modules/nf-core/star/genomegenerate/main.nf' +include { TRIMMOMATIC } from "../../modules/nf-core/trimmomatic/main.nf" +include { POLYA_STRIPPER } from '../../modules/local/polyA_stripper.nf' + +workflow HOST { + take: + reads // channel: [ val(meta), [ reads ] ] + fasta // file: /path/to/fasta/ + gtf // file: /path/to/gtf/ + + main: + ch_versions = Channel.empty() + + STAR_GENOMEGENERATE ( + fasta, + gtf + ) + ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions.first()) + ch_star_index = STAR_GENOMEGENERATE.out.index + + STAR_ALIGN_HOST ( + reads, + ch_star_index, + gtf, + false, + "illumina", + false + ) + ch_versions = ch_versions.mix(STAR_ALIGN_HOST.out.versions.first()) + + TRIMMOMATIC ( + STAR_ALIGN_HOST.out.fastq + ) + ch_versions = ch_versions.mix(TRIMMOMATIC.out.versions.first()) + + POLYA_STRIPPER ( + TRIMMOMATIC.out.trimmed_reads + ) + ch_versions = ch_versions.mix(POLYA_STRIPPER.out.versions.first()) + + + emit: + reads // channel: [ val(meta), [ reads ] ] + + index = ch_star_index + + log_final = STAR_ALIGN_HOST.out.log_final + log_out = STAR_ALIGN_HOST.out.log_out + log_progress = STAR_ALIGN_HOST.out.log_progress + fastq = STAR_ALIGN_HOST.out.fastq + + trimmed_reads = TRIMMOMATIC.out.trimmed_reads + mqc_log = TRIMMOMATIC.out.mqc_log + + polya_trimmed = POLYA_STRIPPER.out.polya_trimmed + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/local/insertion_sites.nf b/subworkflows/local/insertion_sites.nf new file mode 100644 index 0000000..22629ed --- /dev/null +++ b/subworkflows/local/insertion_sites.nf @@ -0,0 +1,76 @@ +// +// Map potential virus insertion sites and create virus infection evidence viewer. +// + +include { INSERTION_SITE_CANDIDATES } from '../../modules/local/insertion_site_candidates.nf' +include { ABRIDGED_TSV } from '../../modules/local/abridged_tsv.nf' +include { VIRUS_REPORT } from '../../modules/local/virus_report.nf' +include { EXTRACT_CHIMERIC_GENOMIC_TARGETS } from '../../modules/local/extract_chimeric_genomic_targets.nf' + +workflow INSERTION_SITES { + take: + junction // file: /path/to/junction/ + fasta // file: /path/to/fasta/ + viral_fasta // file: /path/to/viral_fasta/ + bam // file: /path/to/bam/ + bai // file: /path/to/bai/ + igvjs_VIF + + + main: + ch_versions = Channel.empty() + + INSERTION_SITE_CANDIDATES ( + junction, + fasta, + viral_fasta + ) + ch_versions = ch_versions.mix(INSERTION_SITE_CANDIDATES.out.versions.first()) + + ABRIDGED_TSV ( + INSERTION_SITE_CANDIDATES.out.full + ) + // TODO ch_versions = ch_versions.mix(ABRIDGED_TSV.out.versions.first()) + + bam + .join(bai, by: [0], remainder: true) + .join(ABRIDGED_TSV.out.filtered_abridged) + .set { ch_bam_bai_filtered } + + VIRUS_REPORT ( + ch_bam_bai_filtered, + viral_fasta, + igvjs_VIF + ) + ch_versions = ch_versions.mix(VIRUS_REPORT.out.versions.first()) + + // TODO Handle insertion_site_candidates + // File insertion_site_candidates_use = select_first([insertion_site_candidates, InsertionSiteCandidates.filtered_abridged]) + + EXTRACT_CHIMERIC_GENOMIC_TARGETS ( + ABRIDGED_TSV.out.filtered_abridged, + fasta, + viral_fasta + ) + ch_versions = ch_versions.mix(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.versions.first()) + + emit: + full = INSERTION_SITE_CANDIDATES.out.full + genome_chimeric_evidence_reads_bam = INSERTION_SITE_CANDIDATES.out.genome_chimeric_evidence_reads_bam + genome_chimeric_evidence_reads_bai = INSERTION_SITE_CANDIDATES.out.genome_chimeric_evidence_reads_bai + + filtered_abridged = ABRIDGED_TSV.out.filtered_abridged + + html = VIRUS_REPORT.out.html + genome_abundance_plot = VIRUS_REPORT.out.genome_abundance_plot + virus_alignments_bam = VIRUS_REPORT.out.virus_alignments_bam + virus_alignments_bai = VIRUS_REPORT.out.virus_alignments_bai + read_counts_summary = VIRUS_REPORT.out.read_counts_summary + read_counts_image = VIRUS_REPORT.out.read_counts_image + read_counts_log_image = VIRUS_REPORT.out.read_counts_log_image + + fasta_extract = EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.fasta_extract + gtf_extract = EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.gtf_extract + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/local/plus.nf b/subworkflows/local/plus.nf new file mode 100644 index 0000000..9cfc171 --- /dev/null +++ b/subworkflows/local/plus.nf @@ -0,0 +1,70 @@ +// +// Align filtered reads against combined host and viral reference. +// + +include { STAR_ALIGN as STAR_ALIGN_PLUS } from '../../modules/nf-core/star/align/main.nf' +include { STAR_GENOMEGENERATE } from '../../modules/nf-core/star/genomegenerate/main.nf' +include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main.nf' +include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main.nf' + +workflow PLUS { + take: + reads // channel: [ val(meta), [ reads ] ] + fasta // file: /path/to/fasta/ + gtf // file: /path/to/gtf/ + + main: + ch_versions = Channel.empty() + + STAR_GENOMEGENERATE ( + fasta, + gtf + ) + ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions.first()) + ch_star_index = STAR_GENOMEGENERATE.out.index + + STAR_ALIGN_PLUS ( + reads, + ch_star_index, + gtf, + false, + "illumina", + false + ) + ch_versions = ch_versions.mix(STAR_ALIGN_PLUS.out.versions.first()) + + SAMTOOLS_SORT ( + STAR_ALIGN_PLUS.out.bam + ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) + + SAMTOOLS_INDEX ( + SAMTOOLS_SORT.out.bam + ) + ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) + + SAMTOOLS_SORT.out.bam + .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) + .join(STAR_ALIGN_PLUS.out.junction) + .set { ch_bam_bai_junction } + + + emit: + reads // channel: [ val(meta), [ reads ] ] + + index = ch_star_index + + bam = STAR_ALIGN_PLUS.out.bam + junction = STAR_ALIGN_PLUS.out.junction + log_final = STAR_ALIGN_PLUS.out.log_final + log_out = STAR_ALIGN_PLUS.out.log_out + log_progress = STAR_ALIGN_PLUS.out.log_progress + + sam_bam = SAMTOOLS_SORT.out.bam + + bai = SAMTOOLS_INDEX.out.bai + + bam_bai_junction = ch_bam_bai_junction + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/local/validate.nf b/subworkflows/local/validate.nf new file mode 100644 index 0000000..9d92c00 --- /dev/null +++ b/subworkflows/local/validate.nf @@ -0,0 +1,47 @@ +// +// Validate potential chimeric reads. +// + +include { STAR_ALIGN_VALIDATE } from '../../modules/local/star_align_validate.nf' +include { SAMTOOLS_SORT} from '../../modules/nf-core/samtools/sort/main.nf' +include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main.nf' + +workflow VALIDATE { + take: + reads // channel: [ val(meta), [ reads ] ] + fasta_extract + index + + main: + ch_versions = Channel.empty() + + reads + .join(fasta_extract) + .set { ch_unaligned_fastq_fasta } + + STAR_ALIGN_VALIDATE ( + ch_unaligned_fastq_fasta, + index, + "illumina", + false + ) + ch_versions = ch_versions.mix(STAR_ALIGN_VALIDATE.out.versions.first()) + + SAMTOOLS_SORT ( + STAR_ALIGN_VALIDATE.out.bam + ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) + + SAMTOOLS_SORT.out.bam.join( + SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ).bai, + by: [0], remainder: true) + .set { ch_validate_bam_bai } + + + emit: + + bam_bai = ch_validate_bam_bai + log_final = STAR_ALIGN_VALIDATE.out.log_final + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/tests/pipeline/default/main.nf.test.snap b/tests/pipeline/default/main.nf.test.snap index ef24e75..603d364 100644 --- a/tests/pipeline/default/main.nf.test.snap +++ b/tests/pipeline/default/main.nf.test.snap @@ -3,12 +3,12 @@ "content": [ 33, "test.vif.prelim.refined.tsv:md5,17b26b7a86d61206154ca3e2df02fc48", - "novirus.VirusDetect.igvjs.bam:md5,1ace945eb2ce9ec48b3de1988cf26ba4", - "novirus.VirusDetect.sorted.igvjs.bam:md5,ac314f2d8b013e136c829e166806a182", - "test.VirusDetect.igvjs.bam:md5,8462d7f485afea5cd33eff2bb1611cd2", - "test.VirusDetect.sorted.igvjs.bam:md5,56f176c542e02f88779737105a864150", + "novirus.VirusDetect.igvjs.bam:md5,6bdf644f606b6259de1bf650dbaf154c", + "novirus.VirusDetect.sorted.igvjs.bam:md5,58f2479e15189b9efa988457043b9751", + "test.VirusDetect.igvjs.bam:md5,774c15742e93b439ff8c31030d0982e7", + "test.VirusDetect.sorted.igvjs.bam:md5,57208f63678c6bb9cb50445021587f7d", "test.VirusDetect.virus_read_counts_summary.tsv:md5,c051eb1a25e4741c43274589f75b80b6" ], - "timestamp": "2023-11-28T20:39:55+0000" + "timestamp": "2023-11-29T17:23:30+0000" } } diff --git a/workflows/viralintegration.nf b/workflows/viralintegration.nf index 7e5d785..7323d90 100644 --- a/workflows/viralintegration.nf +++ b/workflows/viralintegration.nf @@ -33,20 +33,17 @@ ch_igvjs_VIF = file("$projectDir/assets/igvjs_VIF.html", checkIfExis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { POLYA_STRIPPER } from '../modules/local/polyA_stripper' include { CAT_FASTA } from '../modules/local/cat_fasta' -include { INSERTION_SITE_CANDIDATES } from '../modules/local/insertion_site_candidates' -include { ABRIDGED_TSV } from '../modules/local/abridged_tsv' -include { VIRUS_REPORT } from '../modules/local/virus_report' -include { EXTRACT_CHIMERIC_GENOMIC_TARGETS } from '../modules/local/extract_chimeric_genomic_targets' -include { STAR_ALIGN_VALIDATE } from '../modules/local/star_align_validate' -include { CHIMERIC_CONTIG_EVIDENCE_ANALYZER } from '../modules/local/chimeric_contig_evidence_analyzer' -include { SUMMARY_REPORT } from '../modules/local/summary_report' -include { REMOVE_DUPLICATES } from '../modules/local/remove_duplicates' // // SUBWORKFLOW: Consisting of a mix of local and nf-core/modules // +include { HOST } from '../subworkflows/local/host' +include { PLUS } from '../subworkflows/local/plus' +include { INSERTION_SITES } from '../subworkflows/local/insertion_sites' +include { VALIDATE } from '../subworkflows/local/validate' +include { CHIMERIC_READS } from '../subworkflows/local/chimeric_reads' + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPORT NF-CORE MODULES/SUBWORKFLOWS @@ -57,17 +54,6 @@ include { REMOVE_DUPLICATES } from '../modules/local/remove_duplicates' // MODULE: Installed directly from nf-core/modules // include { FASTQC } from '../modules/nf-core/fastqc/main' -include { TRIMMOMATIC } from '../modules/nf-core/trimmomatic/main' -include { STAR_GENOMEGENERATE as STAR_GENOMEGENERATE_HOST - STAR_GENOMEGENERATE as STAR_GENOMEGENERATE_PLUS } from '../modules/nf-core/star/genomegenerate/main' -include { STAR_ALIGN as STAR_ALIGN_HOST - STAR_ALIGN as STAR_ALIGN_PLUS } from '../modules/nf-core/star/align/main' -include { SAMTOOLS_SORT as SAMTOOLS_SORT_PLUS - SAMTOOLS_SORT as SAMTOOLS_SORT_VALIDATE - SAMTOOLS_SORT as SAMTOOLS_SORT_DUPLICATES } from '../modules/nf-core/samtools/sort/main' -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_PLUS - SAMTOOLS_INDEX as SAMTOOLS_INDEX_VALIDATE - SAMTOOLS_INDEX as SAMTOOLS_INDEX_DUPLICATES } from '../modules/nf-core/samtools/index/main' include { MULTIQC } from '../modules/nf-core/multiqc/main' include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' @@ -115,32 +101,20 @@ workflow VIRALINTEGRATION { ) ch_versions = ch_versions.mix(FASTQC.out.versions.first()) - STAR_GENOMEGENERATE_HOST ( - params.fasta, - params.gtf - ) - ch_versions = ch_versions.mix(STAR_GENOMEGENERATE_HOST.out.versions) + // + // SUBWORKFLOW: Align input reads against host genome. + // - // TODO Use igenomes - STAR_ALIGN_HOST ( + HOST ( ch_fastq, - STAR_GENOMEGENERATE_HOST.out.index, - params.gtf, - false, - "illumina", - false - ) - ch_versions = ch_versions.mix(STAR_ALIGN_HOST.out.versions.first()) - - TRIMMOMATIC ( - STAR_ALIGN_HOST.out.fastq + params.fasta, + params.gtf ) - ch_versions = ch_versions.mix(TRIMMOMATIC.out.versions.first()) + ch_versions = ch_versions.mix(HOST.out.versions) - POLYA_STRIPPER ( - TRIMMOMATIC.out.trimmed_reads - ) - ch_versions = ch_versions.mix(POLYA_STRIPPER.out.versions.first()) + // + // MODULE: CAT viral and host reference fastas. + // CAT_FASTA ( params.fasta, @@ -148,129 +122,58 @@ workflow VIRALINTEGRATION { ) ch_versions = ch_versions.mix(CAT_FASTA.out.versions) - STAR_GENOMEGENERATE_PLUS ( + // + // SUBWORKFLOW: Align filtered reads against combined host and viral reference. + // + + PLUS ( + HOST.out.polya_trimmed, CAT_FASTA.out.plus_fasta, params.gtf ) - ch_versions = ch_versions.mix(STAR_GENOMEGENERATE_PLUS.out.versions) - - STAR_ALIGN_PLUS ( - POLYA_STRIPPER.out.polya_trimmed, - STAR_GENOMEGENERATE_PLUS.out.index, - params.gtf, - false, - "illumina", - false - ) - ch_versions = ch_versions.mix(STAR_ALIGN_PLUS.out.versions.first()) - - SAMTOOLS_SORT_PLUS ( - STAR_ALIGN_PLUS.out.bam - ) - ch_versions = ch_versions.mix(SAMTOOLS_SORT_PLUS.out.versions.first()) + ch_versions = ch_versions.mix(PLUS.out.versions) - SAMTOOLS_INDEX_PLUS ( - SAMTOOLS_SORT_PLUS.out.bam - ) - ch_versions = ch_versions.mix(SAMTOOLS_INDEX_PLUS.out.versions.first()) - - SAMTOOLS_SORT_PLUS.out.bam - .join(SAMTOOLS_INDEX_PLUS.out.bai, by: [0], remainder: true) - .join(STAR_ALIGN_PLUS.out.junction) - .set { ch_bam_bai_junction } + // + // SUBWORKFLOW: Map potential virus insertion sites and create virus infection evidence viewer. + // - INSERTION_SITE_CANDIDATES ( - ch_bam_bai_junction, + INSERTION_SITES ( + PLUS.out.bam_bai_junction, params.fasta, - params.viral_fasta - ) - ch_versions = ch_versions.mix(INSERTION_SITE_CANDIDATES.out.versions.first()) - - ABRIDGED_TSV ( - INSERTION_SITE_CANDIDATES.out.full - ) - // TODO ch_versions = ch_versions.mix(ABRIDGED_TSV.out.versions.first()) - - SAMTOOLS_SORT_PLUS.out.bam - .join(SAMTOOLS_INDEX_PLUS.out.bai, by: [0], remainder: true) - .join(ABRIDGED_TSV.out.filtered_abridged) - .set { ch_bam_bai_filtered } - - VIRUS_REPORT ( - ch_bam_bai_filtered, params.viral_fasta, + PLUS.out.sam_bam, + PLUS.out.bai, ch_igvjs_VIF ) - ch_versions = ch_versions.mix(VIRUS_REPORT.out.versions.first()) - - // TODO Handle insertion_site_candidates - // File insertion_site_candidates_use = select_first([insertion_site_candidates, InsertionSiteCandidates.filtered_abridged]) + ch_versions = ch_versions.mix(INSERTION_SITES.out.versions) - EXTRACT_CHIMERIC_GENOMIC_TARGETS ( - ABRIDGED_TSV.out.filtered_abridged, - params.fasta, - params.viral_fasta - ) - ch_versions = ch_versions.mix(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.versions.first()) - - STAR_ALIGN_HOST.out.fastq - .join(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.fasta_extract) - .set { ch_unaligned_fastq_fasta } - STAR_ALIGN_VALIDATE ( - ch_unaligned_fastq_fasta, - STAR_GENOMEGENERATE_PLUS.out.index, - "illumina", - false - ) - ch_versions = ch_versions.mix(STAR_ALIGN_VALIDATE.out.versions.first()) + // + // SUBWORKFLOW: Validate potential chimeric reads. + // - SAMTOOLS_SORT_VALIDATE ( - STAR_ALIGN_VALIDATE.out.bam + VALIDATE ( + HOST.out.fastq, + INSERTION_SITES.out.fasta_extract, + PLUS.out.index ) - ch_versions = ch_versions.mix(SAMTOOLS_SORT_VALIDATE.out.versions.first()) - - SAMTOOLS_SORT_VALIDATE.out.bam.join( - SAMTOOLS_INDEX_VALIDATE ( SAMTOOLS_SORT_VALIDATE.out.bam ).bai, - by: [0], remainder: true) - .set { ch_validate_bam_bai } - - - ch_to_dupe_or_not = Channel.empty() - // Check if REMOVE_DUPLICATES.out.bam exists. - if (params.remove_duplicates) { - REMOVE_DUPLICATES ( ch_validate_bam_bai ) - ch_versions = ch_versions.mix(REMOVE_DUPLICATES.out.versions.first()) - ch_to_dupe_or_not = REMOVE_DUPLICATES.out.bam_bai - } else { - ch_to_dupe_or_not = ch_validate_bam_bai - } + ch_versions = ch_versions.mix(VALIDATE.out.versions) - ch_to_dupe_or_not - .join(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.gtf_extract, by: [0]) - .set { ch_validate_bam_bai_gtf } + // + // SUBWORKFLOW: Refine chimeric read counts and create final summary report. + // - CHIMERIC_CONTIG_EVIDENCE_ANALYZER ( - ch_validate_bam_bai_gtf - ) - ch_versions = ch_versions.mix(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.versions.first()) - - CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_bam - .join(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_bai, by: [0]) - .join(ABRIDGED_TSV.out.filtered_abridged, by: [0]) - .join(CHIMERIC_CONTIG_EVIDENCE_ANALYZER.out.evidence_counts, by: [0]) - .join(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.gtf_extract, by: [0]) - .join(EXTRACT_CHIMERIC_GENOMIC_TARGETS.out.fasta_extract, by: [0]) - .join(VIRUS_REPORT.out.genome_abundance_plot, by: [0]) - .join(VIRUS_REPORT.out.read_counts_image, by: [0]) - .join(VIRUS_REPORT.out.read_counts_log_image, by: [0]) - .set { ch_summary_report } - - SUMMARY_REPORT( - ch_summary_report, + CHIMERIC_READS ( + VALIDATE.out.bam_bai, + INSERTION_SITES.out.gtf_extract, + INSERTION_SITES.out.fasta_extract, + INSERTION_SITES.out.filtered_abridged, + INSERTION_SITES.out.genome_abundance_plot, + INSERTION_SITES.out.read_counts_image, + INSERTION_SITES.out.read_counts_log_image, params.gtf, ch_igvjs_VIF ) - ch_versions = ch_versions.mix(SUMMARY_REPORT.out.versions.first()) + ch_versions = ch_versions.mix(CHIMERIC_READS.out.versions) CUSTOM_DUMPSOFTWAREVERSIONS ( ch_versions.unique().collectFile(name: 'collated_versions.yml') @@ -290,10 +193,10 @@ workflow VIRALINTEGRATION { .mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) .mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect()) .mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([])) - .mix(STAR_ALIGN_HOST.out.log_final.collect{it[1]}.ifEmpty([])) - .mix(TRIMMOMATIC.out.mqc_log.collect{it[1]}.ifEmpty([])) - .mix(STAR_ALIGN_PLUS.out.log_final.collect{it[1]}.ifEmpty([])) - .mix(STAR_ALIGN_VALIDATE.out.log_final.collect{it[1]}.ifEmpty([])) + .mix(HOST.out.log_final.collect{it[1]}.ifEmpty([])) + .mix(HOST.out.mqc_log.collect{it[1]}.ifEmpty([])) + .mix(PLUS.out.log_final.collect{it[1]}.ifEmpty([])) + .mix(VALIDATE.out.log_final.collect{it[1]}.ifEmpty([])) MULTIQC (