From dfbb0bc17cb6799892e1d4d2de2f4e08abae92b6 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Thu, 24 Mar 2022 10:49:17 -0600 Subject: [PATCH 01/17] update bakta to latest version (v1.4.0) (#1428) * update bakta to latest version (v1.4.0) * Update test.yml * remove empty file md5sums * bakta was rebuilt to fix dependencies on bioconda * trigger ci Co-authored-by: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> --- modules/bakta/main.nf | 6 +++--- modules/bakta/meta.yml | 2 +- tests/modules/bakta/test.yml | 11 ----------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/modules/bakta/main.nf b/modules/bakta/main.nf index a7f971ef..70b2ecdb 100644 --- a/modules/bakta/main.nf +++ b/modules/bakta/main.nf @@ -2,10 +2,10 @@ process BAKTA { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::bakta=1.3.1" : null) + conda (params.enable_conda ? "bioconda::bakta=1.4.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bakta:1.3.1--pyhdfd78af_0' : - 'quay.io/biocontainers/bakta:1.3.1--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/bakta:1.4.0--pyhdfd78af_1' : + 'quay.io/biocontainers/bakta:1.4.0--pyhdfd78af_1' }" input: tuple val(meta), path(fasta) diff --git a/modules/bakta/meta.yml b/modules/bakta/meta.yml index 2514a996..63f55ff3 100644 --- a/modules/bakta/meta.yml +++ b/modules/bakta/meta.yml @@ -78,7 +78,7 @@ output: pattern: "*.ffn" - hypotheticals_tsv: type: file - description: further information on hypothetical protein CDS as simple human readble tab separated values + description: additional information on hypothetical protein CDS as simple human readble tab separated values pattern: "*.hypotheticals.tsv" - hypotheticals_faa: type: file diff --git a/tests/modules/bakta/test.yml b/tests/modules/bakta/test.yml index dcfc32bc..1eb3d8a5 100644 --- a/tests/modules/bakta/test.yml +++ b/tests/modules/bakta/test.yml @@ -1,25 +1,14 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml bakta - name: bakta command: nextflow run ./tests/modules/bakta -entry test_bakta -c tests/config/nextflow.config -stub-run tags: - bakta files: - path: output/bakta/test.embl - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.faa - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.ffn - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.fna - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.gbff - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.gff3 - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.hypotheticals.tsv - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.hypotheticals.faa - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/bakta/test.tsv - md5sum: d41d8cd98f00b204e9800998ecf8427e From 608bb2259851beee55f997b3b7503cee674744e2 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Thu, 24 Mar 2022 12:56:32 -0600 Subject: [PATCH 02/17] Update dragonflye to latest version (#1442) * Update dragonflye to latest version * trigger ci --- modules/dragonflye/main.nf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/dragonflye/main.nf b/modules/dragonflye/main.nf index 14597143..91b009d4 100644 --- a/modules/dragonflye/main.nf +++ b/modules/dragonflye/main.nf @@ -2,10 +2,10 @@ process DRAGONFLYE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::dragonflye=1.0.4" : null) + conda (params.enable_conda ? "bioconda::dragonflye=1.0.11" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/dragonflye:1.0.4--hdfd78af_0' : - 'quay.io/biocontainers/dragonflye:1.0.4--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/dragonflye:1.0.11--hdfd78af_0' : + 'quay.io/biocontainers/dragonflye:1.0.11--hdfd78af_0' }" input: tuple val(meta), path(reads) @@ -32,6 +32,7 @@ process DRAGONFLYE { --ram $memory \\ --outdir ./ \\ --force + cat <<-END_VERSIONS > versions.yml "${task.process}": dragonflye: \$(dragonflye --version 2>&1 | sed 's/^.*dragonflye //' ) From fe088745e03f21d07477cc0c655c24ae9f72ac31 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Thu, 24 Mar 2022 14:44:31 -0500 Subject: [PATCH 03/17] style(deeptools): Indent script (#1439) --- modules/deeptools/bamcoverage/main.nf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/deeptools/bamcoverage/main.nf b/modules/deeptools/bamcoverage/main.nf index 83e3ffeb..926bf0ad 100644 --- a/modules/deeptools/bamcoverage/main.nf +++ b/modules/deeptools/bamcoverage/main.nf @@ -23,11 +23,11 @@ process DEEPTOOLS_BAMCOVERAGE { def prefix = task.ext.prefix ?: "${meta.id}.bigWig" """ - bamCoverage \ - --bam $input \ - $args \ - --numberOfProcessors ${task.cpus} \ - --outFileName ${prefix} + bamCoverage \\ + --bam $input \\ + $args \\ + --numberOfProcessors ${task.cpus} \\ + --outFileName ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": From 6806cd1de9f493ecba86960fc8a6e7d86e262d9b Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Thu, 24 Mar 2022 18:38:24 -0500 Subject: [PATCH 04/17] feat(bbmap): Initialize pileup module (#1441) * feat(bbmap): Initialize pileup module * test(bbmap): Update outputs * test(bbmap): Add pileup tags * style(bbmap): Add in when Co-authored-by: Robert A. Petit III --- modules/bbmap/pileup/main.nf | 39 ++++++++++++++++++ modules/bbmap/pileup/meta.yml | 47 ++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/bbmap/pileup/main.nf | 15 +++++++ tests/modules/bbmap/pileup/nextflow.config | 5 +++ tests/modules/bbmap/pileup/test.yml | 12 ++++++ 6 files changed, 122 insertions(+) create mode 100644 modules/bbmap/pileup/main.nf create mode 100644 modules/bbmap/pileup/meta.yml create mode 100644 tests/modules/bbmap/pileup/main.nf create mode 100644 tests/modules/bbmap/pileup/nextflow.config create mode 100644 tests/modules/bbmap/pileup/test.yml diff --git a/modules/bbmap/pileup/main.nf b/modules/bbmap/pileup/main.nf new file mode 100644 index 00000000..8d424bc2 --- /dev/null +++ b/modules/bbmap/pileup/main.nf @@ -0,0 +1,39 @@ +process BBMAP_PILEUP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bbmap=38.92 bioconda::samtools=1.13 pigz=2.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' : + 'quay.io/biocontainers/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.stats.txt"), emit: covstats + tuple val(meta), path("*.hist.txt") , emit: hist + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + pileup.sh \\ + -Xmx${task.memory.toGiga()}g \\ + in=${bam} \\ + out=${prefix}.coverage.stats.txt \\ + hist=${prefix}.coverage.hist.txt \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ +} diff --git a/modules/bbmap/pileup/meta.yml b/modules/bbmap/pileup/meta.yml new file mode 100644 index 00000000..5cd85f9a --- /dev/null +++ b/modules/bbmap/pileup/meta.yml @@ -0,0 +1,47 @@ +name: "bbmap_pileup" +description: Calculates per-scaffold or per-base coverage information from an unsorted sam or bam file. +keywords: + - fasta + - genome + - coverage +tools: + - bbmap: + description: BBMap is a short read aligner, as well as various other bioinformatic tools. + homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + tool_dev_url: "https://github.com/BioInfoTools/BBMap/blob/master/sh/pileup.sh" + doi: "" + licence: ["UC-LBL license (see package)"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - stats: + type: file + description: Per-scaffold coverage info + pattern: "*.stats.txt" + - hist: + type: file + description: "Histogram of # occurrences of each depth level" + pattern: "*.hist.txt" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Emiller88" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index d3282321..2a93a846 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -106,6 +106,10 @@ bbmap/index: - modules/bbmap/index/** - tests/modules/bbmap/index/** +bbmap/pileup: + - modules/bbmap/pileup/** + - tests/modules/bbmap/pileup/** + bcftools/annotate: - modules/bcftools/annotate/** - tests/modules/bcftools/annotate/** diff --git a/tests/modules/bbmap/pileup/main.nf b/tests/modules/bbmap/pileup/main.nf new file mode 100644 index 00000000..943df9b5 --- /dev/null +++ b/tests/modules/bbmap/pileup/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BBMAP_PILEUP } from '../../../../modules/bbmap/pileup/main.nf' + +workflow test_bbmap_pileup { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + BBMAP_PILEUP ( input ) +} diff --git a/tests/modules/bbmap/pileup/nextflow.config b/tests/modules/bbmap/pileup/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/bbmap/pileup/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/bbmap/pileup/test.yml b/tests/modules/bbmap/pileup/test.yml new file mode 100644 index 00000000..84814a7a --- /dev/null +++ b/tests/modules/bbmap/pileup/test.yml @@ -0,0 +1,12 @@ +- name: "bbmap pileup" + command: nextflow run ./tests/modules/bbmap/pileup -entry test_bbmap_pileup -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/pileup/nextflow.config + tags: + - "bbmap" + - "bbmap/pileup" + files: + - path: "output/bbmap/test.coverage.stats.txt" + md5sum: c3fc9d0681589b69e3301ca3cb27b7a4 + - path: "output/bbmap/test.coverage.hist.txt" + md5sum: 96915920ef42ddc9483457dd4585a088 + - path: output/bbmap/versions.yml + md5sum: 894acc38bdc167dc22851df15e5a8453 From d16f1ea4d75a179bb672c8e8aec5948d3ee5f0bd Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Thu, 24 Mar 2022 20:11:04 -0600 Subject: [PATCH 05/17] add module for panaroo, fix pirate tests (#1444) * add module for panaroo * update pirate test yaml * update panaroo test yaml * update pirate test yaml md5s * Update main.nf * Update main.nf * pin bioperl version --- modules/panaroo/run/main.nf | 36 +++++++++++++ modules/panaroo/run/meta.yml | 47 +++++++++++++++++ modules/pirate/main.nf | 6 +-- tests/config/pytest_modules.yml | 4 ++ tests/modules/panaroo/run/main.nf | 19 +++++++ tests/modules/panaroo/run/nextflow.config | 8 +++ tests/modules/panaroo/run/test.yml | 38 ++++++++++++++ tests/modules/pirate/main.nf | 4 -- tests/modules/pirate/test.yml | 62 +++++++++++------------ 9 files changed, 186 insertions(+), 38 deletions(-) create mode 100644 modules/panaroo/run/main.nf create mode 100644 modules/panaroo/run/meta.yml create mode 100644 tests/modules/panaroo/run/main.nf create mode 100644 tests/modules/panaroo/run/nextflow.config create mode 100644 tests/modules/panaroo/run/test.yml diff --git a/modules/panaroo/run/main.nf b/modules/panaroo/run/main.nf new file mode 100644 index 00000000..d8be0c1e --- /dev/null +++ b/modules/panaroo/run/main.nf @@ -0,0 +1,36 @@ +process PANAROO_RUN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::panaroo=1.2.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/panaroo:1.2.9--pyhdfd78af_0': + 'quay.io/biocontainers/panaroo:1.2.9--pyhdfd78af_0' }" + + input: + tuple val(meta), path(gff) + + output: + tuple val(meta), path("results/*") , emit: results + tuple val(meta), path("results/core_gene_alignment.aln"), optional: true, emit: aln + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + panaroo \\ + $args \\ + -t $task.cpus \\ + -o results \\ + -i $gff + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + panaroo: \$(echo \$(panaroo --version 2>&1) | sed 's/^.*panaroo //' )) + END_VERSIONS + """ +} diff --git a/modules/panaroo/run/meta.yml b/modules/panaroo/run/meta.yml new file mode 100644 index 00000000..eaeb41d0 --- /dev/null +++ b/modules/panaroo/run/meta.yml @@ -0,0 +1,47 @@ +name: "panaroo_run" +description: A fast and scalable tool for bacterial pangenome analysis +keywords: + - gff + - pan-genome + - alignment +tools: + - "panaroo": + description: "panaroo - an updated pipeline for pangenome investigation" + homepage: "https://gtonkinhill.github.io/panaroo/#/" + documentation: "https://gtonkinhill.github.io/panaroo/#/gettingstarted/quickstart" + tool_dev_url: "https://github.com/gtonkinhill/panaroo" + doi: "10.1186/s13059-020-02090-4" + licence: "['MIT']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gff: + type: file + description: A set of GFF3 formatted files + pattern: "*.{gff}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - results: + type: directory + description: Directory containing Panaroo result files + pattern: "*/*" + - aln: + type: file + description: Core-genome alignment produced by Panaroo (Optional) + pattern: "*.{fasta}" + +authors: + - "@rpetit3" diff --git a/modules/pirate/main.nf b/modules/pirate/main.nf index 20544a1b..ebef5b37 100644 --- a/modules/pirate/main.nf +++ b/modules/pirate/main.nf @@ -2,10 +2,10 @@ process PIRATE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::pirate=1.0.4" : null) + conda (params.enable_conda ? "bioconda::pirate=1.0.4 bioconda::perl-bioperl=1.7.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pirate:1.0.4--hdfd78af_1' : - 'quay.io/biocontainers/pirate:1.0.4--hdfd78af_1' }" + 'https://depot.galaxyproject.org/singularity/pirate:1.0.4--hdfd78af_2' : + 'quay.io/biocontainers/pirate:1.0.4--hdfd78af_2' }" input: tuple val(meta), path(gff) diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2a93a846..13bcbbd3 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1248,6 +1248,10 @@ pairtools/sort: - modules/pairtools/sort/** - tests/modules/pairtools/sort/** +panaroo/run: + - modules/panaroo/run/** + - tests/modules/panaroo/run/** + pangolin: - modules/pangolin/** - tests/modules/pangolin/** diff --git a/tests/modules/panaroo/run/main.nf b/tests/modules/panaroo/run/main.nf new file mode 100644 index 00000000..1fab62ed --- /dev/null +++ b/tests/modules/panaroo/run/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PANAROO_RUN } from '../../../../modules/panaroo/run/main.nf' + +workflow test_panaroo_run { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test1_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test2_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test3_gff'], checkIfExists: true) + ] + ] + + PANAROO_RUN ( input ) +} diff --git a/tests/modules/panaroo/run/nextflow.config b/tests/modules/panaroo/run/nextflow.config new file mode 100644 index 00000000..af23e716 --- /dev/null +++ b/tests/modules/panaroo/run/nextflow.config @@ -0,0 +1,8 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PANAROO_RUN { + ext.args = '--clean-mode strict -a core' + } +} diff --git a/tests/modules/panaroo/run/test.yml b/tests/modules/panaroo/run/test.yml new file mode 100644 index 00000000..20f0b814 --- /dev/null +++ b/tests/modules/panaroo/run/test.yml @@ -0,0 +1,38 @@ +- name: panaroo run test_panaroo_run + command: nextflow run tests/modules/panaroo/run -entry test_panaroo_run -c tests/config/nextflow.config + tags: + - panaroo/run + - panaroo + files: + - path: output/panaroo/results/combined_DNA_CDS.fasta + md5sum: 92bd4f6b9c84c84c0989d77d2558b7d1 + - path: output/panaroo/results/combined_protein_CDS.fasta + md5sum: 7a5636c4f2abc190f5dd4dfbb1da7034 + - path: output/panaroo/results/combined_protein_cdhit_out.txt + md5sum: 2164b81606712b53af2198b4d50eed08 + - path: output/panaroo/results/combined_protein_cdhit_out.txt.clstr + md5sum: aaa9fc2b797c932b6d9ff2df640113f1 + - path: output/panaroo/results/core_alignment_header.embl + contains: ["DNA", "feature", "locus_tag"] + - path: output/panaroo/results/core_gene_alignment.aln + contains: ["test1", "test2", "test3"] + - path: output/panaroo/results/final_graph.gml + contains: ["graph", "isolateNames", "test3"] + - path: output/panaroo/results/gene_data.csv + md5sum: 45df2d26ac81754b858c0e4757e834b2 + - path: output/panaroo/results/gene_presence_absence.Rtab + md5sum: 9efbed5df121dc0c4fbb58869b65c3e4 + - path: output/panaroo/results/gene_presence_absence.csv + contains: ["Gene", "unique", "test3"] + - path: output/panaroo/results/gene_presence_absence_roary.csv + contains: ["Gene", "Max", "Fragment"] + - path: output/panaroo/results/pan_genome_reference.fa + md5sum: d0b03cdfaab8965d86cb1045db3c2d20 + - path: output/panaroo/results/pre_filt_graph.gml + contains: ["graph", "node", "id"] + - path: output/panaroo/results/struct_presence_absence.Rtab + md5sum: 246017db1175f9b1683dfe60cb2e9b5b + - path: output/panaroo/results/summary_statistics.txt + md5sum: 9c73c416e1758bea06c67b4ec9fd0720 + - path: output/panaroo/versions.yml + md5sum: 909e7b046a8a87319986d34b7328641c diff --git a/tests/modules/pirate/main.nf b/tests/modules/pirate/main.nf index 05e5bdd8..45c60713 100644 --- a/tests/modules/pirate/main.nf +++ b/tests/modules/pirate/main.nf @@ -14,10 +14,6 @@ workflow test_pirate { file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test3_gff'], checkIfExists: true) ] ] - // [ file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000292685.gff", checkIfExists: true), - // file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000298385.gff", checkIfExists: true), - // file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_002849995.gff", checkIfExists: true) ] - // ] PIRATE ( input ) } diff --git a/tests/modules/pirate/test.yml b/tests/modules/pirate/test.yml index 6ef9e6e0..ffee5552 100644 --- a/tests/modules/pirate/test.yml +++ b/tests/modules/pirate/test.yml @@ -16,35 +16,35 @@ - path: output/pirate/results/PIRATE.unique_alleles.tsv contains: ["allele_name"] - path: output/pirate/results/binary_presence_absence.fasta - contains: ["GCF_000292685"] + contains: ["test1"] - path: output/pirate/results/binary_presence_absence.nwk - md5sum: 5b5d86bf97d97de37bb9db514abb7762 + md5sum: 1fcf7434911bbab39b74791259f1f989 - path: output/pirate/results/cluster_alleles.tab contains: ["g0001"] - - path: output/pirate/results/co-ords/GCF_000292685.co-ords.tab - md5sum: d5ca0f06ca7ea1f5486683d5859bc9b8 - - path: output/pirate/results/co-ords/GCF_000298385.co-ords.tab - md5sum: a24d6048b3074242bb558c7fa27a8b03 - - path: output/pirate/results/co-ords/GCF_002849995.co-ords.tab - md5sum: 0c08228585f4fa95686e9b025e0fe9c1 + - path: output/pirate/results/co-ords/test1.co-ords.tab + md5sum: f1e75c045b35bae260dadb1a2f000dfa + - path: output/pirate/results/co-ords/test2.co-ords.tab + md5sum: 953b0d2f1dfd4c3a6a6dd246c9174703 + - path: output/pirate/results/co-ords/test3.co-ords.tab + md5sum: 61f2c52ef77dc9a97a200c57b89b7d69 - path: output/pirate/results/genome2loci.tab - md5sum: bbcea5bfcdcafe14a9aa7261c8e931b8 + md5sum: 2d9cdefd5b1a7f5e20b0a70a6e5fa588 - path: output/pirate/results/genome_list.txt - md5sum: 6534b1635c258ad92b829077addc1ff5 + md5sum: c19ac63da7949b15179f42093cbf95b8 - path: output/pirate/results/link_clusters.log contains: ["parsing paralog file"] - path: output/pirate/results/loci_list.tab - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/loci_paralog_categories.tab - md5sum: 6404d2a32526a398f42d7da768a389bd - - path: output/pirate/results/modified_gffs/GCF_000292685.gff - md5sum: 2b73bda2f84dc634303dc90e641040ca - - path: output/pirate/results/modified_gffs/GCF_000298385.gff - md5sum: b1a9d6557d47e09249f08a7acdbbd618 - - path: output/pirate/results/modified_gffs/GCF_002849995.gff - md5sum: 68532fc9bb639e6d83c731a069f60cf8 + md5sum: f8c3d31f445c3cb66bd95ba77be0a7b8 + - path: output/pirate/results/modified_gffs/test1.gff + md5sum: 5dc220e472165c3b693e1017f38fc0e3 + - path: output/pirate/results/modified_gffs/test2.gff + md5sum: 975f5c7fb363caf1be9c53e5e237bb5d + - path: output/pirate/results/modified_gffs/test3.gff + md5sum: a4735a5ac75ce82aadba8a3de6cabc2e - path: output/pirate/results/pan_sequences.fasta - md5sum: ed835c77fdb20c36aa9d5208eb7ca0cb + md5sum: 0492833706f0f969b49a3555c16ec40d - path: output/pirate/results/pangenome.connected_blocks.tsv contains: ["block_number"] - path: output/pirate/results/pangenome.edges @@ -59,29 +59,29 @@ contains: ["g0091"] - path: output/pirate/results/pangenome.temp - path: output/pirate/results/pangenome_iterations/pan_sequences.50.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.60.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.70.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.80.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.90.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.95.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.98.reclustered.reinflated - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.blast.output - md5sum: 9da25d27684bfcc5488987ab2d1fd3a1 + md5sum: ffb3b5bf1ba24bf2bd0be677500139a2 - path: output/pirate/results/pangenome_iterations/pan_sequences.cdhit_clusters - contains: ["GCF_000298385_00081"] + contains: ["test1_00081"] - path: output/pirate/results/pangenome_iterations/pan_sequences.core_clusters.tab - contains: ["GCF_000298385_00242"] + contains: ["test1_00242"] - path: output/pirate/results/pangenome_iterations/pan_sequences.mcl_log.txt contains: ["chaos"] - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta - md5sum: 84668b6c65b57026a17a50b0edd02541 + md5sum: 6e483c773ed90bd50b33f2bd569343e4 - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.pdb - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.pot - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.ptf @@ -95,4 +95,4 @@ - path: output/pirate/results/representative_sequences.ffn contains: ["representative_genome"] - path: output/pirate/results/split_groups.log - contains: ["g0213"] + contains: ["g0"] From e3a5795652ae9838111b33483a80ad733e7501c4 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Thu, 24 Mar 2022 21:44:12 -0500 Subject: [PATCH 06/17] Homer/findpeaks improvements (#1436) * fix(homer): Update expected file path to improve caching * docs(homer): Update findpeaks * test(homer): Add maketagdirectory dependency Co-authored-by: Robert A. Petit III --- modules/homer/findpeaks/main.nf | 4 ++-- modules/homer/findpeaks/meta.yml | 6 ++++-- tests/config/pytest_modules.yml | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/homer/findpeaks/main.nf b/modules/homer/findpeaks/main.nf index b9947774..4858d6da 100644 --- a/modules/homer/findpeaks/main.nf +++ b/modules/homer/findpeaks/main.nf @@ -13,8 +13,8 @@ process HOMER_FINDPEAKS { tuple val(meta), path(tagDir) output: - tuple val(meta), path("*peaks.txt"), emit: txt - path "versions.yml" , emit: versions + tuple val(meta), path("*.peaks.txt"), emit: txt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/homer/findpeaks/meta.yml b/modules/homer/findpeaks/meta.yml index e7cef0cd..72eb8d0c 100644 --- a/modules/homer/findpeaks/meta.yml +++ b/modules/homer/findpeaks/meta.yml @@ -7,7 +7,9 @@ tools: - homer: description: | HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. - documentation: http://homer.ucsd.edu/homer/ + homepage: "http://homer.ucsd.edu/homer/index.html" + documentation: "http://homer.ucsd.edu/homer/" + tool_dev_url: "http://homer.ucsd.edu/homer/ngs/peaks.html" doi: 10.1016/j.molcel.2010.05.004. licence: ["GPL-3.0-or-later"] input: @@ -29,7 +31,7 @@ output: - peaks: type: file description: The found peaks - pattern: "*peaks.txt" + pattern: "*.peaks.txt" - versions: type: file description: File containing software versions diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 13bcbbd3..a211acbc 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -876,6 +876,7 @@ homer/annotatepeaks: homer/findpeaks: - modules/homer/findpeaks/** + - modules/homer/maketagdirectory/** - tests/modules/homer/findpeaks/** homer/maketagdirectory: From b5825fe6b336352024aebccd274da1d131188bfc Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 25 Mar 2022 07:46:51 +0100 Subject: [PATCH 07/17] Mpileup also likes intervals (#1445) * Mpileup also likes intervals * Also update meta yml with inclusive input and intervals Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: Maxime U. Garcia --- modules/samtools/mpileup/main.nf | 5 +++-- modules/samtools/mpileup/meta.yml | 6 +++++- tests/modules/samtools/mpileup/main.nf | 13 ++++++++++++- tests/modules/samtools/mpileup/test.yml | 19 ++++++++++++++++--- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/modules/samtools/mpileup/main.nf b/modules/samtools/mpileup/main.nf index cea40321..474a2492 100644 --- a/modules/samtools/mpileup/main.nf +++ b/modules/samtools/mpileup/main.nf @@ -8,7 +8,7 @@ process SAMTOOLS_MPILEUP { 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(input), path(intervals) path fasta output: @@ -21,12 +21,13 @@ process SAMTOOLS_MPILEUP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def intervals = intervals ? "-l ${intervals}" : "" """ samtools mpileup \\ --fasta-ref $fasta \\ --output ${prefix}.mpileup \\ $args \\ - $bam + $input cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') diff --git a/modules/samtools/mpileup/meta.yml b/modules/samtools/mpileup/meta.yml index c384f5c6..ae499e92 100644 --- a/modules/samtools/mpileup/meta.yml +++ b/modules/samtools/mpileup/meta.yml @@ -21,7 +21,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" @@ -29,6 +29,10 @@ input: type: file description: FASTA reference file pattern: "*.{fasta,fa}" + - intervals: + type: file + description: Interval FILE + pattern: "*.bed" output: - meta: type: map diff --git a/tests/modules/samtools/mpileup/main.nf b/tests/modules/samtools/mpileup/main.nf index dc58cc2c..f7fd4b43 100644 --- a/tests/modules/samtools/mpileup/main.nf +++ b/tests/modules/samtools/mpileup/main.nf @@ -6,7 +6,18 @@ include { SAMTOOLS_MPILEUP } from '../../../../modules/samtools/mpileup/main.nf' workflow test_samtools_mpileup { input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + SAMTOOLS_MPILEUP ( input, fasta ) +} + +workflow test_samtools_mpileup_intervals { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/samtools/mpileup/test.yml b/tests/modules/samtools/mpileup/test.yml index 53a9c142..405263d1 100644 --- a/tests/modules/samtools/mpileup/test.yml +++ b/tests/modules/samtools/mpileup/test.yml @@ -1,8 +1,21 @@ -- name: samtools mpileup - command: nextflow run ./tests/modules/samtools/mpileup -entry test_samtools_mpileup -c ./tests/config/nextflow.config -c ./tests/modules/samtools/mpileup/nextflow.config +- name: samtools mpileup test_samtools_mpileup + command: nextflow run tests/modules/samtools/mpileup -entry test_samtools_mpileup -c tests/config/nextflow.config tags: - samtools - samtools/mpileup files: - - path: ./output/samtools/test.mpileup + - path: output/samtools/test.mpileup md5sum: 958e6bead4103d72026f80153b6b5150 + - path: output/samtools/versions.yml + md5sum: 26350e1e145451f0b807911db029861e + +- name: samtools mpileup test_samtools_mpileup_intervals + command: nextflow run tests/modules/samtools/mpileup -entry test_samtools_mpileup_intervals -c tests/config/nextflow.config + tags: + - samtools + - samtools/mpileup + files: + - path: output/samtools/test.mpileup + md5sum: 958e6bead4103d72026f80153b6b5150 + - path: output/samtools/versions.yml + md5sum: 11d8118a558efb9db6798453862d719c From e786457fb0da9653659b921fc47985554f28273c Mon Sep 17 00:00:00 2001 From: "Maxime U. Garcia" Date: Fri, 25 Mar 2022 11:26:47 +0100 Subject: [PATCH 08/17] feat: add readgroup info + reorder samtools command line to mimic bwamem (#1447) --- modules/dragmap/align/main.nf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/dragmap/align/main.nf b/modules/dragmap/align/main.nf index 9f261cc2..ee94a9a8 100644 --- a/modules/dragmap/align/main.nf +++ b/modules/dragmap/align/main.nf @@ -24,16 +24,18 @@ process DRAGMAP_ALIGN { def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def read_group = meta.read_group ? "--RGSM ${meta.read_group}" : "" def samtools_command = sort_bam ? 'sort' : 'view' if (meta.single_end) { """ dragen-os \\ -r $hashmap \\ - -1 $reads \\ - --num-threads $task.cpus \\ $args \\ + $read_group \\ + --num-threads $task.cpus \\ + -1 $reads \\ 2> ${prefix}.dragmap.log \\ - | samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam - + | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -46,12 +48,13 @@ process DRAGMAP_ALIGN { """ dragen-os \\ -r $hashmap \\ + $args \\ + $read_group \\ + --num-threads $task.cpus \\ -1 ${reads[0]} \\ -2 ${reads[1]} \\ - --num-threads $task.cpus \\ - $args \\ 2> ${prefix}.dragmap.log \\ - | samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam - + | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml "${task.process}": From 3d31fa4d04177579e86044bf111588376e1a0c12 Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 25 Mar 2022 14:01:57 +0100 Subject: [PATCH 09/17] CAT: Use meta map and supply output file name via modules.config (#1446) * Use meta map and supply output file name via modules.config * Remove all def declarations to make it work * update tests & remove extra . * fix ze tests * update meta.yml with meta map info * add tag line now that meta is available --- modules/cat/cat/main.nf | 20 ++++++++------- modules/cat/cat/meta.yml | 9 ++++--- tests/modules/cat/cat/main.nf | 37 ++++++++++++++++----------- tests/modules/cat/cat/nextflow.config | 8 ++++++ tests/modules/cat/cat/test.yml | 4 +-- 5 files changed, 49 insertions(+), 29 deletions(-) diff --git a/modules/cat/cat/main.nf b/modules/cat/cat/main.nf index 4ee44599..25dcc652 100644 --- a/modules/cat/cat/main.nf +++ b/modules/cat/cat/main.nf @@ -1,4 +1,5 @@ process CAT_CAT { + tag "$meta.id" label 'process_low' conda (params.enable_conda ? "conda-forge::pigz=2.3.4" : null) @@ -7,12 +8,11 @@ process CAT_CAT { 'quay.io/biocontainers/pigz:2.3.4' }" input: - path files_in - val file_out + tuple val(meta), path(files_in) output: - path "${file_out}*" , emit: file_out - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}"), emit: file_out + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -29,16 +29,18 @@ process CAT_CAT { // | gzipped | ungzipped | zcat | | // | ungzipped | gzipped | cat | pigz | - def in_zip = file_list[0].endsWith('.gz') - def out_zip = file_out.endsWith('.gz') - def command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' - def command2 = (!in_zip && out_zip) ? "| pigz -c -p $task.cpus $args2" : '' + // Use input file ending as default + prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + out_zip = prefix.endsWith('.gz') + in_zip = file_list[0].endsWith('.gz') + command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' + command2 = (!in_zip && out_zip) ? "| pigz -c -p $task.cpus $args2" : '' """ $command1 \\ $args \\ ${file_list.join(' ')} \\ $command2 \\ - > $file_out + > ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/cat/cat/meta.yml b/modules/cat/cat/meta.yml index e0a6361d..5eeff5a6 100644 --- a/modules/cat/cat/meta.yml +++ b/modules/cat/cat/meta.yml @@ -12,13 +12,15 @@ tools: tool_dev_url: None licence: ["GPL-3.0-or-later"] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - files_in: type: file description: List of compressed / uncompressed files pattern: "*" - - file_out: - type: value - description: Full name of output file with or without .gz extension output: - versions: @@ -32,3 +34,4 @@ output: authors: - "@erikrikarddaniel" + - "@FriederikeHanssen" diff --git a/tests/modules/cat/cat/main.nf b/tests/modules/cat/cat/main.nf index 1fd56851..24e1d00d 100644 --- a/tests/modules/cat/cat/main.nf +++ b/tests/modules/cat/cat/main.nf @@ -2,53 +2,60 @@ nextflow.enable.dsl = 2 -include { CAT_CAT } from '../../../../modules/cat/cat/main.nf' +include { CAT_CAT } from '../../../../modules/cat/cat/main.nf' +include { CAT_CAT as CAT_UNZIPPED_ZIPPED } from '../../../../modules/cat/cat/main.nf' +include { CAT_CAT as CAT_ZIPPED_UNZIPPED } from '../../../../modules/cat/cat/main.nf' workflow test_cat_unzipped_unzipped { input = [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) ] ] - CAT_CAT ( input, 'cat.txt' ) + CAT_CAT ( input ) } workflow test_cat_zipped_zipped { input = [ - file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + [ id:'test', single_end:true ], // meta map + [file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true)] ] - CAT_CAT ( input, 'cat.txt.gz' ) + CAT_CAT ( input ) } workflow test_cat_zipped_unzipped { input = [ - file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + [ id:'test', single_end:true ], // meta map + [file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true)] ] - CAT_CAT ( input, 'cat.txt' ) + CAT_ZIPPED_UNZIPPED ( input ) } workflow test_cat_unzipped_zipped { input = [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + [ id:'test', single_end:true ], // meta map + [file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true)] ] - CAT_CAT ( input, 'cat.txt.gz' ) + CAT_UNZIPPED_ZIPPED ( input ) } workflow test_cat_one_file_unzipped_zipped { input = [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] - CAT_CAT ( input, 'cat.txt.gz' ) + CAT_UNZIPPED_ZIPPED ( input ) } diff --git a/tests/modules/cat/cat/nextflow.config b/tests/modules/cat/cat/nextflow.config index 8730f1c4..b0077a9c 100644 --- a/tests/modules/cat/cat/nextflow.config +++ b/tests/modules/cat/cat/nextflow.config @@ -2,4 +2,12 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + withName: CAT_UNZIPPED_ZIPPED { + ext.prefix = 'cat.txt.gz' + } + + withName: CAT_ZIPPED_UNZIPPED { + ext.prefix = 'cat.txt' + } } + diff --git a/tests/modules/cat/cat/test.yml b/tests/modules/cat/cat/test.yml index 1244d8d2..d6e6595e 100644 --- a/tests/modules/cat/cat/test.yml +++ b/tests/modules/cat/cat/test.yml @@ -4,7 +4,7 @@ - cat - cat/cat files: - - path: output/cat/cat.txt + - path: output/cat/test.fasta md5sum: f44b33a0e441ad58b2d3700270e2dbe2 - name: cat zipped zipped @@ -13,7 +13,7 @@ - cat - cat/cat files: - - path: output/cat/cat.txt.gz + - path: output/cat/test.gz - name: cat zipped unzipped command: nextflow run ./tests/modules/cat/cat -entry test_cat_zipped_unzipped -c ./tests/config/nextflow.config -c ./tests/modules/cat/cat/nextflow.config From 98ed71c8f6968bc689f170e2b79d0866e3f28cda Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 25 Mar 2022 08:29:36 -0500 Subject: [PATCH 10/17] feat(homer): Add pos2bed module (#1435) * feat(homer): Add pos2bed module * test(homer): Pass bed format * test(homer): Add upstream dependencies to avoid regressions * Update modules/homer/pos2bed/main.nf Co-authored-by: FriederikeHanssen --- modules/homer/pos2bed/main.nf | 33 ++++++++++++++++ modules/homer/pos2bed/meta.yml | 42 +++++++++++++++++++++ tests/config/pytest_modules.yml | 6 +++ tests/modules/homer/pos2bed/main.nf | 19 ++++++++++ tests/modules/homer/pos2bed/nextflow.config | 9 +++++ tests/modules/homer/pos2bed/test.yml | 10 +++++ 6 files changed, 119 insertions(+) create mode 100644 modules/homer/pos2bed/main.nf create mode 100644 modules/homer/pos2bed/meta.yml create mode 100644 tests/modules/homer/pos2bed/main.nf create mode 100644 tests/modules/homer/pos2bed/nextflow.config create mode 100644 tests/modules/homer/pos2bed/test.yml diff --git a/modules/homer/pos2bed/main.nf b/modules/homer/pos2bed/main.nf new file mode 100644 index 00000000..b85a30b5 --- /dev/null +++ b/modules/homer/pos2bed/main.nf @@ -0,0 +1,33 @@ +def VERSION = '4.11' // Version information not provided by tool on CLI + +process HOMER_POS2BED { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::homer=4.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + + input: + tuple val(meta), path(peaks) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + pos2bed.pl $peaks > ${prefix}.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/homer/pos2bed/meta.yml b/modules/homer/pos2bed/meta.yml new file mode 100644 index 00000000..fb75bb1f --- /dev/null +++ b/modules/homer/pos2bed/meta.yml @@ -0,0 +1,42 @@ +name: "homer_pos2bed" +description: Coverting from HOMER peak to BED file formats +keywords: + - peaks +tools: + - "homer": + description: | + HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. + homepage: "http://homer.ucsd.edu/homer/index.html" + documentation: "http://homer.ucsd.edu/homer/" + tool_dev_url: "http://homer.ucsd.edu/homer/ngs/miscellaneous.html" + doi: 10.1016/j.molcel.2010.05.004. + licence: ["GPL-3.0-or-later"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tagDir: + type: directory + description: "The 'Tag Directory'" + pattern: "tagDir" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Emiller88" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a211acbc..17a122b7 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -887,6 +887,12 @@ homer/makeucscfile: - modules/homer/makeucscfile/** - tests/modules/homer/makeucscfile/** +homer/pos2bed: + - modules/homer/pos2bed/** + - modules/homer/maketagdirectory/** + - modules/homer/findpeaks/** + - tests/modules/homer/pos2bed/** + hpsuissero: - modules/hpsuissero/** - tests/modules/hpsuissero/** diff --git a/tests/modules/homer/pos2bed/main.nf b/tests/modules/homer/pos2bed/main.nf new file mode 100644 index 00000000..bcfdc0bc --- /dev/null +++ b/tests/modules/homer/pos2bed/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' +include { HOMER_FINDPEAKS } from '../../../../modules/homer/findpeaks/main.nf' +include { HOMER_POS2BED } from '../../../../modules/homer/pos2bed/main.nf' + +workflow test_homer_pos2bed { + input = [[id:'test'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY (input, fasta) + HOMER_FINDPEAKS ( HOMER_MAKETAGDIRECTORY.out.tagdir ) + + HOMER_POS2BED ( HOMER_FINDPEAKS.out.txt ) +} diff --git a/tests/modules/homer/pos2bed/nextflow.config b/tests/modules/homer/pos2bed/nextflow.config new file mode 100644 index 00000000..a4c88475 --- /dev/null +++ b/tests/modules/homer/pos2bed/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HOMER_MAKETAGDIRECTORY { + ext.args = '-format bed' + } + +} diff --git a/tests/modules/homer/pos2bed/test.yml b/tests/modules/homer/pos2bed/test.yml new file mode 100644 index 00000000..525d61c8 --- /dev/null +++ b/tests/modules/homer/pos2bed/test.yml @@ -0,0 +1,10 @@ +- name: "homer pos2bed" + command: nextflow run ./tests/modules/homer/pos2bed -entry test_homer_pos2bed -c ./tests/config/nextflow.config -c ./tests/modules/homer/pos2bed/nextflow.config + tags: + - "homer" + - "homer/pos2bed" + files: + - path: "output/homer/test.bed" + md5sum: 0b9ebd8f06b9c820a551fbdb2d7635ee + - path: output/homer/versions.yml + md5sum: 1485f4b2d76484e8fe3310e2505de2fd From 1fb1801dcbbc556d04985bda5ba4329a4f50543f Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 25 Mar 2022 08:54:09 -0500 Subject: [PATCH 11/17] refactor(homer): Update output path for bedGraph (#1438) This allow for caching because otherwise it modifies the tag directory input --- modules/homer/makeucscfile/main.nf | 6 +++--- modules/homer/makeucscfile/meta.yml | 2 +- tests/modules/homer/makeucscfile/test.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/homer/makeucscfile/main.nf b/modules/homer/makeucscfile/main.nf index c82435ea..379fad3d 100644 --- a/modules/homer/makeucscfile/main.nf +++ b/modules/homer/makeucscfile/main.nf @@ -13,8 +13,8 @@ process HOMER_MAKEUCSCFILE { tuple val(meta), path(tagDir) output: - tuple val(meta), path("tag_dir/*ucsc.bedGraph.gz"), emit: bedGraph - path "versions.yml" , emit: versions + tuple val(meta), path("*.bedGraph.gz"), emit: bedGraph + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -25,7 +25,7 @@ process HOMER_MAKEUCSCFILE { """ makeUCSCfile \\ $tagDir \\ - -o auto \\ + -o ${prefix}.bedGraph \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/homer/makeucscfile/meta.yml b/modules/homer/makeucscfile/meta.yml index 273f456e..039fd37f 100644 --- a/modules/homer/makeucscfile/meta.yml +++ b/modules/homer/makeucscfile/meta.yml @@ -30,7 +30,7 @@ output: - bedGraph: type: file description: The UCSC bed graph - pattern: "tag_dir/*ucsc.bedGraph.gz" + pattern: "*.bedGraph.gz" - versions: type: file description: File containing software versions diff --git a/tests/modules/homer/makeucscfile/test.yml b/tests/modules/homer/makeucscfile/test.yml index cf3d1b4d..e6ccb9fa 100644 --- a/tests/modules/homer/makeucscfile/test.yml +++ b/tests/modules/homer/makeucscfile/test.yml @@ -4,4 +4,4 @@ - homer - homer/makeucscfile files: - - path: output/homer/tag_dir/tag_dir.ucsc.bedGraph.gz + - path: output/homer/test.bedGraph.gz From a0664567353fae8fdcee1162ee3f015a91271062 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Fri, 25 Mar 2022 14:25:07 +0000 Subject: [PATCH 12/17] Add tests for umitools extract and dedup (#1429) * NGSCheckMate v1 * Add some tests for UMItools * Added tests for dedup * Include pytest * Delete main.nf * Delete meta.yml * Delete main.nf * Delete nextflow.config * Delete test.yml * add prettier * Add direct test on bam * Update tests/modules/umitools/dedup/main.nf Co-authored-by: Edmund Miller * Update tests/modules/umitools/dedup/main.nf Co-authored-by: Edmund Miller * Update tests/config/pytest_modules.yml Co-authored-by: Edmund Miller * Not ignore-umi Co-authored-by: Simon Pearce Co-authored-by: Maxime U. Garcia Co-authored-by: Edmund Miller --- tests/config/pytest_modules.yml | 9 +++ tests/modules/umitools/dedup/main.nf | 56 +++++++++++++++++++ tests/modules/umitools/dedup/nextflow.config | 17 ++++++ tests/modules/umitools/dedup/test.yml | 54 ++++++++++++++++++ tests/modules/umitools/extract/main.nf | 29 ++++++++++ .../modules/umitools/extract/nextflow.config | 9 +++ tests/modules/umitools/extract/test.yml | 27 +++++++++ 7 files changed, 201 insertions(+) create mode 100644 tests/modules/umitools/dedup/main.nf create mode 100644 tests/modules/umitools/dedup/nextflow.config create mode 100644 tests/modules/umitools/dedup/test.yml create mode 100644 tests/modules/umitools/extract/main.nf create mode 100644 tests/modules/umitools/extract/nextflow.config create mode 100644 tests/modules/umitools/extract/test.yml diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 17a122b7..78c3fe56 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1763,6 +1763,15 @@ ultra/pipeline: - modules/ultra/pipeline/** - tests/modules/ultra/pipeline/** +umitools/dedup: + - modules/umitools/dedup/** + - modules/umitools/extract/** + - tests/modules/umitools/dedup/** + +umitools/extract: + - modules/umitools/extract/** + - tests/modules/umitools/extract/** + unicycler: - modules/unicycler/** - tests/modules/unicycler/** diff --git a/tests/modules/umitools/dedup/main.nf b/tests/modules/umitools/dedup/main.nf new file mode 100644 index 00000000..f89ba935 --- /dev/null +++ b/tests/modules/umitools/dedup/main.nf @@ -0,0 +1,56 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UMITOOLS_EXTRACT } from '../../../../modules/umitools/extract/main.nf' +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_MEM } from '../../../../modules/bwa/mem/main.nf' +include { SAMTOOLS_INDEX } from '../../../../modules/samtools/index/main.nf' +include { UMITOOLS_DEDUP } from '../../../../modules/umitools/dedup/main.nf' + +// +// Test with no UMI +// +workflow test_umitools_dedup_no_umi { + input = [ [ id:'test'], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + + UMITOOLS_DEDUP ( input ) +} + +// +// Test with single-end data +// +workflow test_umitools_dedup_single_end { + input = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + UMITOOLS_EXTRACT ( input ) + BWA_INDEX ( fasta ) + BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) + SAMTOOLS_INDEX (BWA_MEM.out.bam) + UMITOOLS_DEDUP(BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0])) +} + +// +// Test with paired-end data +// +workflow test_umitools_dedup_paired_end { + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + UMITOOLS_EXTRACT ( input ) + BWA_INDEX ( fasta ) + BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) + SAMTOOLS_INDEX (BWA_MEM.out.bam) + UMITOOLS_DEDUP(BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0])) +} diff --git a/tests/modules/umitools/dedup/nextflow.config b/tests/modules/umitools/dedup/nextflow.config new file mode 100644 index 00000000..4a7533ef --- /dev/null +++ b/tests/modules/umitools/dedup/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } + + withName: UMITOOLS_DEDUP { + ext.args = '' + ext.prefix = 'dedup' + } + + withName: BWA_MEM { + ext.args2 = '' + } +} diff --git a/tests/modules/umitools/dedup/test.yml b/tests/modules/umitools/dedup/test.yml new file mode 100644 index 00000000..2ba9073b --- /dev/null +++ b/tests/modules/umitools/dedup/test.yml @@ -0,0 +1,54 @@ +- name: umitools dedup test_umitools_dedup_no_umi + command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_no_umi -c tests/config/nextflow.config + tags: + - umitools/dedup + - umitools + files: + - path: output/umitools/dedup.bam + md5sum: 53b4edc399db81b87d2343e78af73cf0 + - path: output/umitools/dedup_edit_distance.tsv + md5sum: 65186b0964e2f8d970cc04d736d8b119 + - path: output/umitools/dedup_per_umi.tsv + md5sum: 8e6783a4a79437b095f095f2aefe7c01 + - path: output/umitools/dedup_per_umi_per_position.tsv + md5sum: 9386db4a104b8e4e32f3ca4a84efa4ac + - path: output/umitools/versions.yml + md5sum: 4aaaa33565bcd9a984255139933d6446 + +- name: umitools dedup test_umitools_dedup_single_end + command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_single_end -c tests/config/nextflow.config + tags: + - umitools + - umitools/dedup + files: + - path: output/bwa/test.bam + md5sum: ea41a3cdca1856b22845e1067fd31f37 + - path: output/bwa/versions.yml + md5sum: ce4d987f2c53f4c01b31d210c357b24a + - path: output/samtools/test.bam.bai + md5sum: 095af0ad3921212597ffd7c342ecd5a0 + - path: output/samtools/versions.yml + md5sum: 69b7cde627c9b4e8403dfc125db71cc7 + - path: output/umitools/dedup.bam + md5sum: d95df177063432748ff33f473910cb1e + - path: output/umitools/versions.yml + md5sum: 730e768dd199d2f5bfb6fd0850446344 + +- name: umitools dedup test_umitools_dedup_paired_end + command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_paired_end -c tests/config/nextflow.config + tags: + - umitools + - umitools/dedup + files: + - path: output/bwa/test.bam + md5sum: 1ad786cae0ff2254c655e3a206929617 + - path: output/bwa/versions.yml + md5sum: b524c5ddf61c20f4a0a93ae8fc78b851 + - path: output/samtools/test.bam.bai + md5sum: 7496f4056a8e86327ca93e350f282fc2 + - path: output/samtools/versions.yml + md5sum: 72fc2ab934fd4bca0f7f14a705530d34 + - path: output/umitools/dedup.bam + md5sum: e8d1eae2aacef76254948c5568e94555 + - path: output/umitools/versions.yml + md5sum: fd39e05042d354b3d8de49b617d3183d diff --git a/tests/modules/umitools/extract/main.nf b/tests/modules/umitools/extract/main.nf new file mode 100644 index 00000000..3baac16a --- /dev/null +++ b/tests/modules/umitools/extract/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UMITOOLS_EXTRACT } from '../../../../modules/umitools/extract/main.nf' + +// +// Test with single-end data +// +workflow test_umitools_extract_single_end { + input = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + UMITOOLS_EXTRACT ( input ) +} + +// +// Test with paired-end data +// +workflow test_umitools_extract_paired_end { + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + + UMITOOLS_EXTRACT ( input ) +} + diff --git a/tests/modules/umitools/extract/nextflow.config b/tests/modules/umitools/extract/nextflow.config new file mode 100644 index 00000000..628f5fcd --- /dev/null +++ b/tests/modules/umitools/extract/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } + +} diff --git a/tests/modules/umitools/extract/test.yml b/tests/modules/umitools/extract/test.yml new file mode 100644 index 00000000..336cd122 --- /dev/null +++ b/tests/modules/umitools/extract/test.yml @@ -0,0 +1,27 @@ +- name: umitools extract test_umitools_extract_single_end + command: nextflow run tests/modules/umitools/extract -entry test_umitools_extract_single_end -c tests/config/nextflow.config + tags: + - umitools/extract + - umitools + files: + - path: output/umitools/test.umi_extract.fastq.gz + should_exist: true + - path: output/umitools/test.umi_extract.log + contains: ["job finished in"] + - path: output/umitools/versions.yml + md5sum: 397e6972343f9d7b8eae387fc18c12c7 + +- name: umitools extract test_umitools_extract_paired_end + command: nextflow run tests/modules/umitools/extract -entry test_umitools_extract_paired_end -c tests/config/nextflow.config + tags: + - umitools/extract + - umitools + files: + - path: output/umitools/test.umi_extract.log + contains: ["job finished in"] + - path: output/umitools/test.umi_extract_1.fastq.gz + should_exist: true + - path: output/umitools/test.umi_extract_2.fastq.gz + should_exist: true + - path: output/umitools/versions.yml + md5sum: 0aec6f919d62b7b79f6d0c5d79411464 From 7111e571cc5b6069de4673cd6165af680f17b4d7 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 25 Mar 2022 12:11:40 -0500 Subject: [PATCH 13/17] Split preseq lcextrap and ccurve (#1440) * fix(preseq): Update lcextrap file name * chore(preseq): Bump lcextrap image * feat: Initialize preseq c_curve * docs(preseq): Update documentation --- modules/preseq/ccurve/main.nf | 40 +++++++++++++++++ modules/preseq/ccurve/meta.yml | 48 +++++++++++++++++++++ modules/preseq/lcextrap/main.nf | 12 +++--- modules/preseq/lcextrap/meta.yml | 9 ++-- tests/config/pytest_modules.yml | 4 ++ tests/modules/preseq/ccurve/main.nf | 25 +++++++++++ tests/modules/preseq/ccurve/nextflow.config | 5 +++ tests/modules/preseq/ccurve/test.yml | 19 ++++++++ tests/modules/preseq/lcextrap/test.yml | 4 +- 9 files changed, 154 insertions(+), 12 deletions(-) create mode 100644 modules/preseq/ccurve/main.nf create mode 100644 modules/preseq/ccurve/meta.yml create mode 100644 tests/modules/preseq/ccurve/main.nf create mode 100644 tests/modules/preseq/ccurve/nextflow.config create mode 100644 tests/modules/preseq/ccurve/test.yml diff --git a/modules/preseq/ccurve/main.nf b/modules/preseq/ccurve/main.nf new file mode 100644 index 00000000..febf83cc --- /dev/null +++ b/modules/preseq/ccurve/main.nf @@ -0,0 +1,40 @@ +process PRESEQ_CCURVE { + tag "$meta.id" + label 'process_medium' + label 'error_ignore' + + conda (params.enable_conda ? "bioconda::preseq=3.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h445547b_2': + 'quay.io/biocontainers/preseq:3.1.2--h445547b_2' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.c_curve.txt"), emit: c_curve + tuple val(meta), path("*.log") , emit: log + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def paired_end = meta.single_end ? '' : '-pe' + """ + preseq \\ + c_curve \\ + $args \\ + $paired_end \\ + -output ${prefix}.c_curve.txt \\ + $bam + cp .command.err ${prefix}.command.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + preseq: \$(echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//') + END_VERSIONS + """ +} diff --git a/modules/preseq/ccurve/meta.yml b/modules/preseq/ccurve/meta.yml new file mode 100644 index 00000000..86ed6296 --- /dev/null +++ b/modules/preseq/ccurve/meta.yml @@ -0,0 +1,48 @@ +name: preseq_ccurve +description: Software for predicting library complexity and genome coverage in high-throughput sequencing +keywords: + - preseq + - library + - complexity +tools: + - preseq: + description: Software for predicting library complexity and genome coverage in high-throughput sequencing + homepage: http://smithlabresearch.org/software/preseq/ + documentation: http://smithlabresearch.org/wp-content/uploads/manual.pdf + tool_dev_url: https://github.com/smithlabcode/preseq + doi: "" + licence: ["GPL"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - ccurve: + type: file + description: File containing output of Preseq c curve + pattern: "*.{c_curve.txt}" + - log: + type: file + description: Log file containing stderr produced by Preseq + pattern: "*.{log}" + +authors: + - "@drpatelh" + - "@Emiller88" diff --git a/modules/preseq/lcextrap/main.nf b/modules/preseq/lcextrap/main.nf index d6dd19e2..97261557 100644 --- a/modules/preseq/lcextrap/main.nf +++ b/modules/preseq/lcextrap/main.nf @@ -5,16 +5,16 @@ process PRESEQ_LCEXTRAP { conda (params.enable_conda ? "bioconda::preseq=3.1.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h06ef8b0_1' : - 'quay.io/biocontainers/preseq:3.1.2--h06ef8b0_1' }" + 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h445547b_2': + 'quay.io/biocontainers/preseq:3.1.2--h445547b_2' }" input: tuple val(meta), path(bam) output: - tuple val(meta), path("*.ccurve.txt"), emit: ccurve - tuple val(meta), path("*.log") , emit: log - path "versions.yml" , emit: versions + tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap + tuple val(meta), path("*.log") , emit: log + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -28,7 +28,7 @@ process PRESEQ_LCEXTRAP { lc_extrap \\ $args \\ $paired_end \\ - -output ${prefix}.ccurve.txt \\ + -output ${prefix}.lc_extrap.txt \\ $bam cp .command.err ${prefix}.command.log diff --git a/modules/preseq/lcextrap/meta.yml b/modules/preseq/lcextrap/meta.yml index 0e33df25..f1be05a2 100755 --- a/modules/preseq/lcextrap/meta.yml +++ b/modules/preseq/lcextrap/meta.yml @@ -8,8 +8,8 @@ tools: - preseq: description: Software for predicting library complexity and genome coverage in high-throughput sequencing homepage: http://smithlabresearch.org/software/preseq/ - documentation: None - tool_dev_url: None + documentation: http://smithlabresearch.org/wp-content/uploads/manual.pdf + tool_dev_url: https://github.com/smithlabcode/preseq doi: "" licence: ["GPL"] @@ -34,10 +34,10 @@ output: type: file description: File containing software versions pattern: "versions.yml" - - ccurve: + - lc_extrap: type: file description: File containing output of Preseq lcextrap - pattern: "*.{ccurve.txt}" + pattern: "*.{lc_extrap.txt}" - log: type: file description: Log file containing stderr produced by Preseq @@ -45,3 +45,4 @@ output: authors: - "@drpatelh" + - "@Emiller88" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 78c3fe56..183708dc 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1367,6 +1367,10 @@ porechop: - modules/porechop/** - tests/modules/porechop/** +preseq/ccurve: + - modules/preseq/ccurve/** + - tests/modules/preseq/ccurve/** + preseq/lcextrap: - modules/preseq/lcextrap/** - tests/modules/preseq/lcextrap/** diff --git a/tests/modules/preseq/ccurve/main.nf b/tests/modules/preseq/ccurve/main.nf new file mode 100644 index 00000000..59149563 --- /dev/null +++ b/tests/modules/preseq/ccurve/main.nf @@ -0,0 +1,25 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PRESEQ_CCURVE } from '../../../../modules/preseq/ccurve/main.nf' + +workflow test_preseq_ccurve_single_end { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + PRESEQ_CCURVE ( input ) +} + +workflow test_preseq_ccurve_paired_end { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + PRESEQ_CCURVE ( input ) +} diff --git a/tests/modules/preseq/ccurve/nextflow.config b/tests/modules/preseq/ccurve/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/preseq/ccurve/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/preseq/ccurve/test.yml b/tests/modules/preseq/ccurve/test.yml new file mode 100644 index 00000000..c94dc978 --- /dev/null +++ b/tests/modules/preseq/ccurve/test.yml @@ -0,0 +1,19 @@ +- name: preseq ccurve single-end + command: nextflow run ./tests/modules/preseq/ccurve -entry test_preseq_ccurve_single_end -c ./tests/config/nextflow.config -c ./tests/modules/preseq/ccurve/nextflow.config + tags: + - preseq + - preseq/ccurve + files: + - path: output/preseq/test.c_curve.txt + md5sum: cf4743abdd355595d6ec1fb3f38e66e5 + - path: output/preseq/test.command.log + +- name: preseq ccurve paired-end + command: nextflow run ./tests/modules/preseq/ccurve -entry test_preseq_ccurve_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/preseq/ccurve/nextflow.config + tags: + - preseq + - preseq/ccurve + files: + - path: output/preseq/test.c_curve.txt + md5sum: cf4743abdd355595d6ec1fb3f38e66e5 + - path: output/preseq/test.command.log diff --git a/tests/modules/preseq/lcextrap/test.yml b/tests/modules/preseq/lcextrap/test.yml index ecd1d046..f5b5aea4 100644 --- a/tests/modules/preseq/lcextrap/test.yml +++ b/tests/modules/preseq/lcextrap/test.yml @@ -4,7 +4,7 @@ - preseq - preseq/lcextrap files: - - path: output/preseq/test.ccurve.txt + - path: output/preseq/test.lc_extrap.txt md5sum: 1fa5cdd601079329618f61660bee00de - path: output/preseq/test.command.log @@ -14,6 +14,6 @@ - preseq - preseq/lcextrap files: - - path: output/preseq/test.ccurve.txt + - path: output/preseq/test.lc_extrap.txt md5sum: 10e5ea860e87fb6f5dc10f4f20c62040 - path: output/preseq/test.command.log From 27936729f21245558c0425b3284c8bdfd4b805aa Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 25 Mar 2022 12:13:30 -0500 Subject: [PATCH 14/17] Add samtools to homer/maketagdirectory to use bam files (#1437) * fix(homer): Update dependancies for maketagdirectory Closes #1363 * test(homer): Add tests for bam usage * style(homer): Rename meta test * fix(homer): Update args order and add missing \\ * docs(homer): Add DESeq2 and edgeR Co-authored-by: FriederikeHanssen * test(homer): Update md5sum * test(homer): bam => sam * fix(homer): Use nextflow conda recipe instead of biocontainers with commas Co-authored-by: FriederikeHanssen --- modules/homer/maketagdirectory/main.nf | 13 ++++---- modules/homer/maketagdirectory/meta.yml | 33 +++++++++++++++++-- tests/modules/homer/maketagdirectory/main.nf | 23 +++++++++---- .../homer/maketagdirectory/nextflow.config | 6 +++- tests/modules/homer/maketagdirectory/test.yml | 29 ++++++++++++---- 5 files changed, 81 insertions(+), 23 deletions(-) diff --git a/modules/homer/maketagdirectory/main.nf b/modules/homer/maketagdirectory/main.nf index 262998d5..0ab855da 100644 --- a/modules/homer/maketagdirectory/main.nf +++ b/modules/homer/maketagdirectory/main.nf @@ -4,13 +4,13 @@ process HOMER_MAKETAGDIRECTORY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::homer=4.11=pl526hc9558a2_3" : null) + conda (params.enable_conda ? "bioconda::homer=4.11 bioconda::samtools=1.11 conda-forge::r-base=4.0.2 bioconda::bioconductor-deseq2=1.30.0 bioconda::bioconductor-edger=3.32.0 anaconda::perl=5.26.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : - 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-29293b111ffe5b4c1d1e14c711264aaed6b97b4a:594338b771cacf1623bd27772b5e12825f8835f2-0' : + 'quay.io/biocontainers/mulled-v2-29293b111ffe5b4c1d1e14c711264aaed6b97b4a:594338b771cacf1623bd27772b5e12825f8835f2-0' }" input: - tuple val(meta), path(bed) + tuple val(meta), path(bam) path fasta output: @@ -26,13 +26,14 @@ process HOMER_MAKETAGDIRECTORY { """ makeTagDirectory \\ tag_dir \\ + -genome $fasta \\ $args \\ - $bed \\ - -genome $fasta + $bam cat <<-END_VERSIONS > versions.yml "${task.process}": homer: $VERSION + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/homer/maketagdirectory/meta.yml b/modules/homer/maketagdirectory/meta.yml index 2472e0f0..31d59ee7 100644 --- a/modules/homer/maketagdirectory/meta.yml +++ b/modules/homer/maketagdirectory/meta.yml @@ -3,6 +3,8 @@ description: Create a tag directory with the HOMER suite keywords: - peaks - bed + - bam + - sam tools: - homer: description: | @@ -10,16 +12,41 @@ tools: documentation: http://homer.ucsd.edu/homer/ doi: 10.1016/j.molcel.2010.05.004. licence: ["GPL-3.0-or-later"] + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + 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 + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] + - DESeq2: + description: | + Differential gene expression analysis based on the negative binomial distribution + homepage: "https://bioconductor.org/packages/DESeq2" + documentation: "https://bioconductor.org/packages/DESeq2" + tool_dev_url: "https://github.com/mikelove/DESeq2" + doi: 10.18129/B9.bioc.DESeq2 + licence: ["LGPL-3.0-or-later"] + - edgeR: + description: | + Empirical Analysis of Digital Gene Expression Data in R + homepage: "https://bioinf.wehi.edu.au/edgeR" + documentation: "https://bioconductor.org/packages/edgeR" + tool_dev_url: " https://git.bioconductor.org/packages/edgeR" + doi: 10.18129/B9.bioc.edgeR + licence: ["GPL >=2"] input: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bed: + - bam: type: file - description: The peak files in bed format - pattern: "*.bed" + description: BAM/BED/SAM file + pattern: "*.{bam,bed,sam}" - fasta: type: file description: Fasta file of reference genome diff --git a/tests/modules/homer/maketagdirectory/main.nf b/tests/modules/homer/maketagdirectory/main.nf index 766aff0d..7de693e6 100644 --- a/tests/modules/homer/maketagdirectory/main.nf +++ b/tests/modules/homer/maketagdirectory/main.nf @@ -2,19 +2,22 @@ nextflow.enable.dsl = 2 -include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' +include { + HOMER_MAKETAGDIRECTORY as HOMER_MAKETAGDIRECTORY_BED + HOMER_MAKETAGDIRECTORY as HOMER_MAKETAGDIRECTORY_BAM +} from '../../../../modules/homer/maketagdirectory/main.nf' -workflow test_homer_maketagdirectory { +workflow test_homer_maketagdirectory_bed { input = [[id:'test'], [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - HOMER_MAKETAGDIRECTORY (input, fasta) + HOMER_MAKETAGDIRECTORY_BED (input, fasta) } -workflow test_homer_meta_maketagdirectory { +workflow test_homer_maketagdirectory_meta { input = [[[ id:'test1'], [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)]], @@ -25,8 +28,14 @@ workflow test_homer_meta_maketagdirectory { meta_input = [[id: 'meta_test']] + [ input.collect{it[1]}.flatten() ] - HOMER_MAKETAGDIRECTORY (meta_input, fasta) + HOMER_MAKETAGDIRECTORY_BED (meta_input, fasta) } -// TODO Make a failing bam test -// TODO Make a pass bam test that feeds the bam through samtools first +workflow test_homer_maketagdirectory_bam { + input = [[id:'test'], + [file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY_BAM (input, fasta) +} diff --git a/tests/modules/homer/maketagdirectory/nextflow.config b/tests/modules/homer/maketagdirectory/nextflow.config index 81587d69..9d7a3f9f 100644 --- a/tests/modules/homer/maketagdirectory/nextflow.config +++ b/tests/modules/homer/maketagdirectory/nextflow.config @@ -2,8 +2,12 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: HOMER_MAKETAGDIRECTORY { + withName: HOMER_MAKETAGDIRECTORY_BED { ext.args = '-format bed' } + withName: HOMER_MAKETAGDIRECTORY_BAM { + ext.args = '-format sam' + } + } diff --git a/tests/modules/homer/maketagdirectory/test.yml b/tests/modules/homer/maketagdirectory/test.yml index 746c6ef6..28e74c32 100644 --- a/tests/modules/homer/maketagdirectory/test.yml +++ b/tests/modules/homer/maketagdirectory/test.yml @@ -1,5 +1,5 @@ -- name: homer maketagdirectory - command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_maketagdirectory -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config +- name: homer maketagdirectory bed + command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_maketagdirectory_bed -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config tags: - homer - homer/maketagdirectory @@ -11,12 +11,12 @@ - path: output/homer/tag_dir/tagCountDistribution.txt md5sum: fd4ee7ce7c5dfd7c9d739534b8180578 - path: output/homer/tag_dir/tagInfo.txt - md5sum: 816baa642c946f8284eaa465638e9abb + md5sum: ff56f30411b221b847aa4e6e9a6098a1 - path: output/homer/tag_dir/tagLengthDistribution.txt md5sum: e5aa2b9843ca9c04ace297280aed6af4 -- name: homer meta maketagdirectory - command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_meta_maketagdirectory -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config +- name: homer maketagdirectory meta + command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_maketagdirectory_meta -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config tags: - homer - homer/maketagdirectory @@ -28,6 +28,23 @@ - path: output/homer/tag_dir/tagCountDistribution.txt md5sum: fd4ee7ce7c5dfd7c9d739534b8180578 - path: output/homer/tag_dir/tagInfo.txt - md5sum: 816baa642c946f8284eaa465638e9abb + md5sum: ff56f30411b221b847aa4e6e9a6098a1 - path: output/homer/tag_dir/tagLengthDistribution.txt md5sum: e5aa2b9843ca9c04ace297280aed6af4 + +- name: homer maketagdirectory bam + command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_maketagdirectory_bam -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config + tags: + - homer + - homer/maketagdirectory + files: + - path: output/homer/tag_dir/MT192765.1.tags.tsv + md5sum: 365808c4751ef6dd7085ac52037a22bc + - path: output/homer/tag_dir/tagAutocorrelation.txt + md5sum: 8b396f2aef1cdd3af4fab57b142d3250 + - path: output/homer/tag_dir/tagCountDistribution.txt + md5sum: afc6d007096c3872bbe84c9dc8edb832 + - path: output/homer/tag_dir/tagInfo.txt + md5sum: fbaf46eeb8a0723fa8b5eabd93f9d821 + - path: output/homer/tag_dir/tagLengthDistribution.txt + md5sum: 44f231adb2a705ae81950808c55cf248 From 4efa8da5c5bd8b68d667ddade7ed398e16c145f6 Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 25 Mar 2022 18:22:17 +0100 Subject: [PATCH 15/17] controlfreec significance (#1451) * controlfreec significance * move freec files to own subfolder * Fix meta.yml naming * Fix meta.yml naming * Fix linting * Forgot to refactor * forgot more refactoring * Too much refactoring on output paths * Too little refactoring here * update checksum --- .../controlfreec/assesssignificance/main.nf | 30 +++++++++++ .../controlfreec/assesssignificance/meta.yml | 50 +++++++++++++++++++ modules/controlfreec/{ => freec}/main.nf | 2 +- modules/controlfreec/{ => freec}/meta.yml | 4 +- tests/config/pytest_modules.yml | 10 ++-- .../controlfreec/assesssignificance/main.nf | 42 ++++++++++++++++ .../{ => assesssignificance}/nextflow.config | 2 +- .../controlfreec/assesssignificance/test.yml | 10 ++++ .../modules/controlfreec/{ => freec}/main.nf | 27 +++++----- .../controlfreec/freec/nextflow.config | 26 ++++++++++ .../modules/controlfreec/{ => freec}/test.yml | 7 +-- 11 files changed, 187 insertions(+), 23 deletions(-) create mode 100644 modules/controlfreec/assesssignificance/main.nf create mode 100644 modules/controlfreec/assesssignificance/meta.yml rename modules/controlfreec/{ => freec}/main.nf (99%) rename modules/controlfreec/{ => freec}/meta.yml (99%) create mode 100644 tests/modules/controlfreec/assesssignificance/main.nf rename tests/modules/controlfreec/{ => assesssignificance}/nextflow.config (96%) create mode 100644 tests/modules/controlfreec/assesssignificance/test.yml rename tests/modules/controlfreec/{ => freec}/main.nf (66%) create mode 100644 tests/modules/controlfreec/freec/nextflow.config rename tests/modules/controlfreec/{ => freec}/test.yml (78%) diff --git a/modules/controlfreec/assesssignificance/main.nf b/modules/controlfreec/assesssignificance/main.nf new file mode 100644 index 00000000..dc9c6e86 --- /dev/null +++ b/modules/controlfreec/assesssignificance/main.nf @@ -0,0 +1,30 @@ +process CONTROLFREEC_ASSESSSIGNIFICANCE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(cnvs), path(ratio) + + output: + tuple val(meta), path("*.p.value.txt"), emit: bam + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + END_VERSIONS + """ +} diff --git a/modules/controlfreec/assesssignificance/meta.yml b/modules/controlfreec/assesssignificance/meta.yml new file mode 100644 index 00000000..0451cca3 --- /dev/null +++ b/modules/controlfreec/assesssignificance/meta.yml @@ -0,0 +1,50 @@ +name: controlfreec_assesssignificance +description: Add both Wilcoxon test and Kolmogorov-Smirnov test p-values to each CNV output of FREEC +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec/assesssignificance: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cnvs: + type: file + description: _CNVs file generated by FREEC + pattern: "*._CNVs" + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - p_value_txt: + type: file + description: CNV file containing p_values for each call + pattern: "*.p.value.txt" + +authors: + - "@FriederikeHanssen" diff --git a/modules/controlfreec/main.nf b/modules/controlfreec/freec/main.nf similarity index 99% rename from modules/controlfreec/main.nf rename to modules/controlfreec/freec/main.nf index 21084f64..ba48ea1e 100644 --- a/modules/controlfreec/main.nf +++ b/modules/controlfreec/freec/main.nf @@ -1,4 +1,4 @@ -process CONTROLFREEC { +process CONTROLFREEC_FREEC { tag "$meta.id" label 'process_low' diff --git a/modules/controlfreec/meta.yml b/modules/controlfreec/freec/meta.yml similarity index 99% rename from modules/controlfreec/meta.yml rename to modules/controlfreec/freec/meta.yml index b2a6772b..a9a7375e 100644 --- a/modules/controlfreec/meta.yml +++ b/modules/controlfreec/freec/meta.yml @@ -1,4 +1,4 @@ -name: controlfreec +name: controlfreec_freec description: Copy number and genotype annotation from whole genome and whole exome sequencing data keywords: - cna @@ -7,7 +7,7 @@ keywords: - single - tumor-only tools: - - controlfreec: + - controlfreec/freec: description: Copy number and genotype annotation from whole genome and whole exome sequencing data. homepage: http://boevalab.inf.ethz.ch/FREEC documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 183708dc..20d9ad1d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -419,9 +419,13 @@ cnvkit/batch: - modules/cnvkit/batch/** - tests/modules/cnvkit/batch/** -controlfreec: - - modules/controlfreec/** - - tests/modules/controlfreec/** +controlfreec/assesssignificance: + - modules/controlfreec/assesssignificance/** + - tests/modules/controlfreec/assesssignificance/** + +controlfreec/freec: + - modules/controlfreec/freec/** + - tests/modules/controlfreec/freec/** cooler/cload: - modules/cooler/cload/** diff --git a/tests/modules/controlfreec/assesssignificance/main.nf b/tests/modules/controlfreec/assesssignificance/main.nf new file mode 100644 index 00000000..f8d8aa1d --- /dev/null +++ b/tests/modules/controlfreec/assesssignificance/main.nf @@ -0,0 +1,42 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CONTROLFREEC_ASSESSSIGNIFICANCE } from '../../../../modules/controlfreec/assesssignificance/main.nf' +include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf' +include { UNTAR } from '../../../../modules/untar/main.nf' + +workflow test_controlfreec_assesssignificance { + + input = [ + [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_mpileup'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true), + [],[],[],[] + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + + dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true) + dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true) + + chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ] + target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + + UNTAR(chrfiles) + CONTROLFREEC_FREEC (input, + fasta, + fai, + [], + dbsnp, + dbsnp_tbi, + UNTAR.out.untar.map{ it[1] }, + [], + target_bed, + [] + ) + + sig_in = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio) + CONTROLFREEC_ASSESSSIGNIFICANCE ( sig_in ) +} diff --git a/tests/modules/controlfreec/nextflow.config b/tests/modules/controlfreec/assesssignificance/nextflow.config similarity index 96% rename from tests/modules/controlfreec/nextflow.config rename to tests/modules/controlfreec/assesssignificance/nextflow.config index 5c4250be..65273dea 100644 --- a/tests/modules/controlfreec/nextflow.config +++ b/tests/modules/controlfreec/assesssignificance/nextflow.config @@ -2,7 +2,7 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName:CONTROLFREEC{ + withName:CONTROLFREEC_FREEC{ ext.args = { [ "sample":[ inputformat: 'pileup', diff --git a/tests/modules/controlfreec/assesssignificance/test.yml b/tests/modules/controlfreec/assesssignificance/test.yml new file mode 100644 index 00000000..58f83f43 --- /dev/null +++ b/tests/modules/controlfreec/assesssignificance/test.yml @@ -0,0 +1,10 @@ +- name: controlfreec assesssignificance test_controlfreec_assesssignificance + command: nextflow run tests/modules/controlfreec/assesssignificance -entry test_controlfreec_assesssignificance -c tests/config/nextflow.config + tags: + - controlfreec/assesssignificance + - controlfreec + files: + - path: output/controlfreec/test2.mpileup.gz_CNVs.p.value.txt + md5sum: 44e23b916535fbc1a3f47b57fad292df + - path: output/controlfreec/versions.yml + md5sum: 0aa42fed10d61e4570fe1e0e83ffe932 diff --git a/tests/modules/controlfreec/main.nf b/tests/modules/controlfreec/freec/main.nf similarity index 66% rename from tests/modules/controlfreec/main.nf rename to tests/modules/controlfreec/freec/main.nf index 247f9887..d14c8f65 100644 --- a/tests/modules/controlfreec/main.nf +++ b/tests/modules/controlfreec/freec/main.nf @@ -2,9 +2,10 @@ nextflow.enable.dsl = 2 -include { CONTROLFREEC } from '../../../modules/controlfreec/main.nf' -include { UNTAR } from '../../../modules/untar/main.nf' -workflow test_controlfreec { +include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf' +include { UNTAR } from '../../../../modules/untar/main.nf' + +workflow test_controlfreec_freec { input = [ [ id:'test', single_end:false, sex:'XX' ], // meta map @@ -23,15 +24,15 @@ workflow test_controlfreec { target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) UNTAR(chrfiles) - CONTROLFREEC ( input, - fasta, - fai, - [], - dbsnp, - dbsnp_tbi, - UNTAR.out.untar.map{ it[1] }, - [], - target_bed, - [] + CONTROLFREEC_FREEC (input, + fasta, + fai, + [], + dbsnp, + dbsnp_tbi, + UNTAR.out.untar.map{ it[1] }, + [], + target_bed, + [] ) } diff --git a/tests/modules/controlfreec/freec/nextflow.config b/tests/modules/controlfreec/freec/nextflow.config new file mode 100644 index 00000000..65273dea --- /dev/null +++ b/tests/modules/controlfreec/freec/nextflow.config @@ -0,0 +1,26 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/tests/modules/controlfreec/test.yml b/tests/modules/controlfreec/freec/test.yml similarity index 78% rename from tests/modules/controlfreec/test.yml rename to tests/modules/controlfreec/freec/test.yml index 14c30205..d50fc063 100644 --- a/tests/modules/controlfreec/test.yml +++ b/tests/modules/controlfreec/freec/test.yml @@ -1,7 +1,8 @@ -- name: controlfreec test_controlfreec - command: nextflow run tests/modules/controlfreec -entry test_controlfreec -c tests/config/nextflow.config +- name: controlfreec test_controlfreec_freec + command: nextflow run tests/modules/controlfreec/freec -entry test_controlfreec_freec -c tests/config/nextflow.config tags: - controlfreec + - controlfreec/freec files: - path: output/controlfreec/config.txt - path: output/controlfreec/test.mpileup.gz_control.cpn @@ -19,4 +20,4 @@ - path: output/controlfreec/test2.mpileup.gz_sample.cpn md5sum: c80dad58a77b1d7ba6d273999f4b4b4b - path: output/controlfreec/versions.yml - md5sum: ff93f6466d4686aab708425782c6c848 + md5sum: 3ab250a2ab3be22628124c7c65324651 From 8a64e73af29a8096e1996e0496df4ae8c449c40b Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 25 Mar 2022 20:31:52 +0100 Subject: [PATCH 16/17] add freec2bed script (#1453) --- modules/controlfreec/freec2bed/main.nf | 31 +++++++++++++ modules/controlfreec/freec2bed/meta.yml | 45 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/controlfreec/freec2bed/main.nf | 41 +++++++++++++++++ .../controlfreec/freec2bed/nextflow.config | 27 +++++++++++ tests/modules/controlfreec/freec2bed/test.yml | 8 ++++ 6 files changed, 156 insertions(+) create mode 100644 modules/controlfreec/freec2bed/main.nf create mode 100644 modules/controlfreec/freec2bed/meta.yml create mode 100644 tests/modules/controlfreec/freec2bed/main.nf create mode 100644 tests/modules/controlfreec/freec2bed/nextflow.config create mode 100644 tests/modules/controlfreec/freec2bed/test.yml diff --git a/modules/controlfreec/freec2bed/main.nf b/modules/controlfreec/freec2bed/main.nf new file mode 100644 index 00000000..880e4716 --- /dev/null +++ b/modules/controlfreec/freec2bed/main.nf @@ -0,0 +1,31 @@ +process CONTROLFREEC_FREEC2BED { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(ratio) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + freec2bed.pl -f ${ratio} ${args} > ${prefix}.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + END_VERSIONS + """ +} diff --git a/modules/controlfreec/freec2bed/meta.yml b/modules/controlfreec/freec2bed/meta.yml new file mode 100644 index 00000000..47fff8ab --- /dev/null +++ b/modules/controlfreec/freec2bed/meta.yml @@ -0,0 +1,45 @@ +name: controlfreec_freec2bed +description: Plot Freec output +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bed: + type: file + description: Bed file + pattern: "*.bed" + +authors: + - "@FriederikeHanssen" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 20d9ad1d..0c77497d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -427,6 +427,10 @@ controlfreec/freec: - modules/controlfreec/freec/** - tests/modules/controlfreec/freec/** +controlfreec/freec2bed: + - modules/controlfreec/freec2bed/** + - tests/modules/controlfreec/freec2bed/** + cooler/cload: - modules/cooler/cload/** - tests/modules/cooler/cload/** diff --git a/tests/modules/controlfreec/freec2bed/main.nf b/tests/modules/controlfreec/freec2bed/main.nf new file mode 100644 index 00000000..df121832 --- /dev/null +++ b/tests/modules/controlfreec/freec2bed/main.nf @@ -0,0 +1,41 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CONTROLFREEC_FREEC2BED } from '../../../../modules/controlfreec/freec2bed/main.nf' +include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf' +include { UNTAR } from '../../../../modules/untar/main.nf' + +workflow test_controlfreec_freec2bed { + + input = [ + [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_mpileup'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true), + [],[],[],[] + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + + dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true) + dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true) + + chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ] + target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + + UNTAR(chrfiles) + CONTROLFREEC_FREEC (input, + fasta, + fai, + [], + dbsnp, + dbsnp_tbi, + UNTAR.out.untar.map{ it[1] }, + [], + target_bed, + [] + ) + + CONTROLFREEC_FREEC2BED ( CONTROLFREEC_FREEC.out.ratio ) +} diff --git a/tests/modules/controlfreec/freec2bed/nextflow.config b/tests/modules/controlfreec/freec2bed/nextflow.config new file mode 100644 index 00000000..8c2f77eb --- /dev/null +++ b/tests/modules/controlfreec/freec2bed/nextflow.config @@ -0,0 +1,27 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } + +} diff --git a/tests/modules/controlfreec/freec2bed/test.yml b/tests/modules/controlfreec/freec2bed/test.yml new file mode 100644 index 00000000..0198bac6 --- /dev/null +++ b/tests/modules/controlfreec/freec2bed/test.yml @@ -0,0 +1,8 @@ +- name: controlfreec freec2bed test_controlfreec_freec2bed + command: nextflow run tests/modules/controlfreec/freec2bed -entry test_controlfreec_freec2bed -c tests/config/nextflow.config + tags: + - controlfreec/freec2bed + - controlfreec + files: + - path: output/controlfreec/test.bed + md5sum: abe10b7ce94ba903503e697394c17297 From 28e5211b3513d80f198beb7090f57242165cc030 Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 25 Mar 2022 20:49:08 +0100 Subject: [PATCH 17/17] add makegraph script (#1452) * add makegraph script * allow renaming of output files * allow renaming of output files --- .../controlfreec/assesssignificance/main.nf | 5 +- modules/controlfreec/makegraph/main.nf | 40 +++++++++++++ modules/controlfreec/makegraph/meta.yml | 58 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ .../controlfreec/assesssignificance/test.yml | 2 +- tests/modules/controlfreec/makegraph/main.nf | 42 ++++++++++++++ .../controlfreec/makegraph/nextflow.config | 30 ++++++++++ tests/modules/controlfreec/makegraph/test.yml | 12 ++++ 8 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 modules/controlfreec/makegraph/main.nf create mode 100644 modules/controlfreec/makegraph/meta.yml create mode 100644 tests/modules/controlfreec/makegraph/main.nf create mode 100644 tests/modules/controlfreec/makegraph/nextflow.config create mode 100644 tests/modules/controlfreec/makegraph/test.yml diff --git a/modules/controlfreec/assesssignificance/main.nf b/modules/controlfreec/assesssignificance/main.nf index dc9c6e86..f85a3c7f 100644 --- a/modules/controlfreec/assesssignificance/main.nf +++ b/modules/controlfreec/assesssignificance/main.nf @@ -11,7 +11,7 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { tuple val(meta), path(cnvs), path(ratio) output: - tuple val(meta), path("*.p.value.txt"), emit: bam + tuple val(meta), path("*.p.value.txt"), emit: p_value_txt path "versions.yml" , emit: versions when: @@ -19,9 +19,12 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio} + mv *.p.value.txt ${prefix}.p.value.txt + cat <<-END_VERSIONS > versions.yml "${task.process}": controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) diff --git a/modules/controlfreec/makegraph/main.nf b/modules/controlfreec/makegraph/main.nf new file mode 100644 index 00000000..9a0c7281 --- /dev/null +++ b/modules/controlfreec/makegraph/main.nf @@ -0,0 +1,40 @@ +process CONTROLFREEC_MAKEGRAPH { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(ratio), path(baf) + + output: + tuple val(meta), path("*_BAF.png") , emit: png_baf + tuple val(meta), path("*_ratio.log2.png"), emit: png_ratio_log2 + tuple val(meta), path("*_ratio.png") , emit: png_ratio + + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: "" + def prefix = task.ext.prefix ?: "${meta.id}" + def baf = baf ?: "" + """ + cat /usr/local/bin/makeGraph.R | R --slave --args ${args} ${ratio} ${baf} + + mv *_BAF.txt.png ${prefix}_BAF.png + mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png + mv *_ratio.txt.png ${prefix}_ratio.png + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + END_VERSIONS + """ +} diff --git a/modules/controlfreec/makegraph/meta.yml b/modules/controlfreec/makegraph/meta.yml new file mode 100644 index 00000000..a207ec8c --- /dev/null +++ b/modules/controlfreec/makegraph/meta.yml @@ -0,0 +1,58 @@ +name: controlfreec_makegraph +description: Plot Freec output +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + - baf: + type: file + description: .BAF file generated by FREEC + pattern: "*.BAF" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - png_baf: + type: file + description: Image of BAF plot + pattern: "*_BAF.png" + - png_ratio_log2: + type: file + description: Image of ratio log2 plot + pattern: "*_ratio.log2.png" + - png_ratio: + type: file + description: Image of ratio plot + pattern: "*_ratio.png" + +authors: + - "@FriederikeHanssen" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 0c77497d..6e2dbb9a 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -431,6 +431,10 @@ controlfreec/freec2bed: - modules/controlfreec/freec2bed/** - tests/modules/controlfreec/freec2bed/** +controlfreec/makegraph: + - modules/controlfreec/makegraph/** + - tests/modules/controlfreec/makegraph/** + cooler/cload: - modules/cooler/cload/** - tests/modules/cooler/cload/** diff --git a/tests/modules/controlfreec/assesssignificance/test.yml b/tests/modules/controlfreec/assesssignificance/test.yml index 58f83f43..f8393330 100644 --- a/tests/modules/controlfreec/assesssignificance/test.yml +++ b/tests/modules/controlfreec/assesssignificance/test.yml @@ -4,7 +4,7 @@ - controlfreec/assesssignificance - controlfreec files: - - path: output/controlfreec/test2.mpileup.gz_CNVs.p.value.txt + - path: output/controlfreec/test.p.value.txt md5sum: 44e23b916535fbc1a3f47b57fad292df - path: output/controlfreec/versions.yml md5sum: 0aa42fed10d61e4570fe1e0e83ffe932 diff --git a/tests/modules/controlfreec/makegraph/main.nf b/tests/modules/controlfreec/makegraph/main.nf new file mode 100644 index 00000000..ffea3d99 --- /dev/null +++ b/tests/modules/controlfreec/makegraph/main.nf @@ -0,0 +1,42 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CONTROLFREEC_MAKEGRAPH } from '../../../../modules/controlfreec/makegraph/main.nf' +include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf' +include { UNTAR } from '../../../../modules/untar/main.nf' + +workflow test_controlfreec_makegraph { + + input = [ + [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_mpileup'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true), + [],[],[],[] + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + + dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true) + dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true) + + chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ] + target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + + UNTAR(chrfiles) + CONTROLFREEC_FREEC (input, + fasta, + fai, + [], + dbsnp, + dbsnp_tbi, + UNTAR.out.untar.map{ it[1] }, + [], + target_bed, + [] + ) + + makegraph_in = CONTROLFREEC_FREEC.out.ratio.join(CONTROLFREEC_FREEC.out.BAF) + CONTROLFREEC_MAKEGRAPH ( makegraph_in ) +} diff --git a/tests/modules/controlfreec/makegraph/nextflow.config b/tests/modules/controlfreec/makegraph/nextflow.config new file mode 100644 index 00000000..f88fae50 --- /dev/null +++ b/tests/modules/controlfreec/makegraph/nextflow.config @@ -0,0 +1,30 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } + + withName:CONTROLFREEC_MAKEGRAPH { + ext.args = "2" + } +} diff --git a/tests/modules/controlfreec/makegraph/test.yml b/tests/modules/controlfreec/makegraph/test.yml new file mode 100644 index 00000000..21e78766 --- /dev/null +++ b/tests/modules/controlfreec/makegraph/test.yml @@ -0,0 +1,12 @@ +- name: controlfreec makegraph test_controlfreec_makegraph + command: nextflow run tests/modules/controlfreec/makegraph -entry test_controlfreec_makegraph -c tests/config/nextflow.config + tags: + - controlfreec + - controlfreec/makegraph + files: + - path: output/controlfreec/test_BAF.png + md5sum: f9d977839e09c7e2472d970bd4aa834c + - path: output/controlfreec/test_ratio.log2.png + md5sum: b3c7916b1b4951a0cc3da20d8e9e0262 + - path: output/controlfreec/test_ratio.png + md5sum: 1435b29536b3b1555b4c423f8f4fb000