From 8d5680a6b782d97b359a4d2702259b71f96f5441 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 10:01:55 +0200 Subject: [PATCH 01/31] Add vserach usearch_global --- modules/vsearch/usearchglobal/main.nf | 51 +++++++++++++++++++ modules/vsearch/usearchglobal/meta.yml | 38 ++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/vsearch/usearchglobal/main.nf | 12 +++++ .../vsearch/usearchglobal/nextflow.config | 5 ++ tests/modules/vsearch/usearchglobal/test.yml | 7 +++ .../vsearch/usearchglobal/test.yml.ori | 14 +++++ 7 files changed, 131 insertions(+) create mode 100644 modules/vsearch/usearchglobal/main.nf create mode 100644 modules/vsearch/usearchglobal/meta.yml create mode 100644 tests/modules/vsearch/usearchglobal/main.nf create mode 100644 tests/modules/vsearch/usearchglobal/nextflow.config create mode 100644 tests/modules/vsearch/usearchglobal/test.yml create mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..65ee62cc --- /dev/null +++ b/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,51 @@ +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta + +process VSEARCH_USEARCHGLOBAL { + tag '$queryfasta' + label 'process_low' + + conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" + + input: + path queryfasta + path db + val outprefix + + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + + output: + path ("*.tsv") , emit: tsv + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + vsearch \\ + --usearch_global $queryfasta \\ + --db $db \\ + --threads $task.cpus \\ + $args \\ + --blast6out ${outprefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vsearch: \$(vsearch --version 2>&1 | head -n 1 | sed 's/vsearch //g' | sed 's/,.*//g' | sed 's/^v//' | sed 's/_.*//') + END_VERSIONS + """ +} diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml new file mode 100644 index 00000000..8cb97446 --- /dev/null +++ b/modules/vsearch/usearchglobal/meta.yml @@ -0,0 +1,38 @@ +name: "vsearch_usearchglobal" +description: Compare target sequences to fasta-formatted query sequences using global pairwise alignment. +keywords: + - vsearch + - usearch + - alignment + - fasta +tools: + - "vsearch": + description: "VSEARCH is a versatile open-source tool for microbiome analysis, including chimera detection, clustering, dereplication and rereplication, extraction, FASTA/FASTQ/SFF file processing, masking, orienting, pair-wise alignment, restriction site cutting, searching, shuffling, sorting, subsampling, and taxonomic classification of amplicon sequences for metagenomics, genomics, and population genetics. (USEARCH alternative)" + homepage: "https://github.com/torognes/vsearch" + documentation: "None" + tool_dev_url: "https://github.com/torognes/vsearch" + doi: "doi: 10.7717/peerj.2584" + licence: "['GPL v3-or-later OR BSD-2-clause']" + +input: + - queryfasta: + type: file + description: Query sequences in FASTA format + pattern: "*.{fasta,fa,fna,faa}" + - db: + type: file + description: Reference database file. It may be in FASTA or UDB format. + pattern: "*" + +output: + - blast6out: + type: file + description: Tab delimited results in blast-like format + pattern: "*.{tsv}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jtangrot" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2d0d3226..05188329 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2024,6 +2024,10 @@ vcftools: - modules/vcftools/** - tests/modules/vcftools/** +vsearch/usearchglobal: + - modules/vsearch/usearchglobal/** + - tests/modules/vsearch/usearchglobal/** + yara/index: - modules/yara/index/** - tests/modules/yara/index/** diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..02becd21 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VSEARCH_USEARCHGLOBAL } from '../../../../modules/vsearch/usearchglobal/main.nf' + +workflow test_vsearch_usearchglobal { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) +} diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config new file mode 100644 index 00000000..aab29979 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -0,0 +1,5 @@ +process { + ext.args = '--id 0.985' + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml new file mode 100644 index 00000000..b013519d --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -0,0 +1,7 @@ +- name: vsearch usearchglobal test_vsearch_usearchglobal + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch/usearchglobal + files: + - path: output/vsearch/blast6out_results.tsv + md5sum: 09733131643f1d951321a6e17a35eb8c diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori new file mode 100644 index 00000000..df644165 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml.ori @@ -0,0 +1,14 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml vsearch/usearchglobal +- name: "vsearch usearchglobal" + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - "vsearch" + # + - "vsearch/usearchglobal" + # + files: + - path: "output/vsearch/blast6out_results.tsv" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/vsearch/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 853b76d16a263b314e5807f675d532b5cc1a68d6 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 14:02:10 +0200 Subject: [PATCH 02/31] Add options for output file type --- modules/vsearch/usearchglobal/main.nf | 38 +++++++++++++++---- tests/modules/vsearch/usearchglobal/main.nf | 14 ++++++- .../vsearch/usearchglobal/nextflow.config | 4 +- tests/modules/vsearch/usearchglobal/test.yml | 14 ++++++- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 65ee62cc..0b31842f 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -10,7 +10,7 @@ // bwa mem | samtools view -B -T ref.fasta process VSEARCH_USEARCHGLOBAL { - tag '$queryfasta' + tag "$meta.id" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) @@ -19,29 +19,53 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - path queryfasta + tuple val(meta), path(queryfasta) path db - val outprefix + val outoption + val user_columns // TODO nf-core: Where applicable please provide/convert compressed files as input/output // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. output: - path ("*.tsv") , emit: tsv - path "versions.yml" , emit: versions - + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.uc') , optional: true, emit: uc + 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 columns = user_columns ? "--userfields ${user_columns}" : '' + switch ( outoption ) { + case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break + case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + default: + outfmt = "--alnout"; + out_ext = 'aln'; + log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + break + } """ vsearch \\ --usearch_global $queryfasta \\ --db $db \\ --threads $task.cpus \\ $args \\ - --blast6out ${outprefix}.tsv + ${columns} \\ + ${outfmt} ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index 02becd21..cdf0fb2f 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,5 +8,17 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) + + outoption = "xcfert" // Nonsense text to check default case. + columns = "" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) +} + +workflow test_vsearch_usearchglobal_userout { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + outoption = "userout" + columns = "query+target+id" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index aab29979..3148a59e 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,5 @@ process { ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file +} + diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b013519d..b7ebec4a 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,7 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: + - vsearch - vsearch/usearchglobal files: - - path: output/vsearch/blast6out_results.tsv - md5sum: 09733131643f1d951321a6e17a35eb8c + - path: output/vsearch/test.aln + md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + +- name: vsearch usearchglobal test_vsearch_usearchglobal_userout + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch + - vsearch/usearchglobal + files: + - path: output/vsearch/test.user.tsv + md5sum: b6cc50f7c8d18cb82e74dab70ed4baab From f1fc7fc38eb65782cdf2d05bc4d56a11ec8922a8 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 15:15:07 -0400 Subject: [PATCH 03/31] adding upzip --- modules/gamma/{ => gamma}/main.nf | 15 ++++++++-- modules/gamma/{ => gamma}/meta.yml | 0 tests/modules/gamma/gamma/main.nf | 29 +++++++++++++++++++ .../modules/gamma/{ => gamma}/nextflow.config | 0 tests/modules/gamma/gamma/test.yml | 29 +++++++++++++++++++ tests/modules/gamma/main.nf | 17 ----------- tests/modules/gamma/test.yml | 13 --------- 7 files changed, 71 insertions(+), 32 deletions(-) rename modules/gamma/{ => gamma}/main.nf (83%) rename modules/gamma/{ => gamma}/meta.yml (100%) create mode 100644 tests/modules/gamma/gamma/main.nf rename tests/modules/gamma/{ => gamma}/nextflow.config (100%) create mode 100644 tests/modules/gamma/gamma/test.yml delete mode 100644 tests/modules/gamma/main.nf delete mode 100644 tests/modules/gamma/test.yml diff --git a/modules/gamma/main.nf b/modules/gamma/gamma/main.nf similarity index 83% rename from modules/gamma/main.nf rename to modules/gamma/gamma/main.nf index e176ee68..51a5f6c8 100644 --- a/modules/gamma/main.nf +++ b/modules/gamma/gamma/main.nf @@ -26,13 +26,24 @@ process GAMMA { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + """ - GAMMA.py \\ + if [[ ${fasta} == *.gz ]] + then + FNAME=\$(basename ${fasta} .gz) + gunzip -f ${fasta} + GAMMA.py \\ + $args \\ + "\${FNAME}" \\ + $db \\ + $prefix + else + GAMMA.py \\ $args \\ $fasta \\ $db \\ $prefix - + fi cat <<-END_VERSIONS > versions.yml "${task.process}": gamma: $VERSION diff --git a/modules/gamma/meta.yml b/modules/gamma/gamma/meta.yml similarity index 100% rename from modules/gamma/meta.yml rename to modules/gamma/gamma/meta.yml diff --git a/tests/modules/gamma/gamma/main.nf b/tests/modules/gamma/gamma/main.nf new file mode 100644 index 00000000..070a3bf1 --- /dev/null +++ b/tests/modules/gamma/gamma/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GAMMA } from '../../../../modules/gamma/gamma/main.nf' + +workflow test_unzip { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true), + ] + + db = [ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/ResGANNCBI_20210507_srst2.fasta", checkIfExists: true), ] + + GAMMA ( input, db ) +} + +workflow test_gamma { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + GAMMA ( input, db ) +} diff --git a/tests/modules/gamma/nextflow.config b/tests/modules/gamma/gamma/nextflow.config similarity index 100% rename from tests/modules/gamma/nextflow.config rename to tests/modules/gamma/gamma/nextflow.config diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml new file mode 100644 index 00000000..308d890f --- /dev/null +++ b/tests/modules/gamma/gamma/test.yml @@ -0,0 +1,29 @@ +- name: gamma gamma test_unzip + command: nextflow run tests/modules/gamma/gamma -entry test_unzip -c tests/config/nextflow.config + tags: + - gamma/gamma + - gamma + files: + - path: /tmp/tmppm1ybfln/gamma/test.fasta + md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce + - path: /tmp/tmppm1ybfln/gamma/test.gamma + md5sum: 46165a89e10b7315d3a9b0aa6c561626 + - path: /tmp/tmppm1ybfln/gamma/test.psl + md5sum: f489ce4602ddbcb692d5781ee3fbf449 + - path: /tmp/tmppm1ybfln/gamma/versions.yml + md5sum: ad23c3ec60663598543cbe8bc74bc4ab + +- name: gamma gamma test_gamma + command: nextflow run tests/modules/gamma/gamma -entry test_gamma -c tests/config/nextflow.config + tags: + - gamma/gamma + - gamma + files: + - path: /tmp/tmpw3chm6da/gamma/test.fasta + md5sum: df37b48466181311e0a679f3c5878484 + - path: /tmp/tmpw3chm6da/gamma/test.gamma + md5sum: 3256708fa517a65ed01d99e0e3c762ae + - path: /tmp/tmpw3chm6da/gamma/test.psl + md5sum: 162a2757ed3b167ae1e0cdb24213f940 + - path: /tmp/tmpw3chm6da/gamma/versions.yml + md5sum: 3fefb5b46c94993362243c5f9a472057 diff --git a/tests/modules/gamma/main.nf b/tests/modules/gamma/main.nf deleted file mode 100644 index f9477706..00000000 --- a/tests/modules/gamma/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GAMMA } from '../../../modules/gamma/main.nf' - -workflow test_gamma { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] - - GAMMA ( input, db ) -} diff --git a/tests/modules/gamma/test.yml b/tests/modules/gamma/test.yml deleted file mode 100644 index 1b493b49..00000000 --- a/tests/modules/gamma/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: gamma test_gamma - command: nextflow run tests/modules/gamma -entry test_gamma -c tests/config/nextflow.config - tags: - - gamma - files: - - path: output/gamma/test.fasta - md5sum: df37b48466181311e0a679f3c5878484 - - path: output/gamma/test.gamma - md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: output/gamma/test.psl - md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: output/gamma/versions.yml - md5sum: 3fefb5b46c94993362243c5f9a472057 From b8aaea7429e74cb23acff21b03ba3814d7905ed1 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 16:27:00 -0400 Subject: [PATCH 04/31] updating paths in test.yml --- modules/gamma/gamma/main.nf | 2 +- modules/gamma/gamma/meta.yml | 3 ++- tests/modules/gamma/gamma/main.nf | 6 +++--- tests/modules/gamma/gamma/test.yml | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/gamma/gamma/main.nf b/modules/gamma/gamma/main.nf index 51a5f6c8..fddced62 100644 --- a/modules/gamma/gamma/main.nf +++ b/modules/gamma/gamma/main.nf @@ -1,6 +1,6 @@ def VERSION = '2.1' // Version information not provided by tool on CLI -process GAMMA { +process GAMMA_GAMMA { tag "$meta.id" label 'process_low' diff --git a/modules/gamma/gamma/meta.yml b/modules/gamma/gamma/meta.yml index 316b685b..d9e272e2 100644 --- a/modules/gamma/gamma/meta.yml +++ b/modules/gamma/gamma/meta.yml @@ -1,4 +1,4 @@ -name: "gamma" +name: "gamma_gamma" description: Gene Allele Mutation Microbial Assessment keywords: - gamma @@ -61,3 +61,4 @@ output: authors: - "@sateeshperi" - "@rastanton" + - "@jvhagey" diff --git a/tests/modules/gamma/gamma/main.nf b/tests/modules/gamma/gamma/main.nf index 070a3bf1..97e58be7 100644 --- a/tests/modules/gamma/gamma/main.nf +++ b/tests/modules/gamma/gamma/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GAMMA } from '../../../../modules/gamma/gamma/main.nf' +include { GAMMA_GAMMA } from '../../../../modules/gamma/gamma/main.nf' workflow test_unzip { @@ -13,7 +13,7 @@ workflow test_unzip { db = [ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/ResGANNCBI_20210507_srst2.fasta", checkIfExists: true), ] - GAMMA ( input, db ) + GAMMA_GAMMA ( input, db ) } workflow test_gamma { @@ -25,5 +25,5 @@ workflow test_gamma { db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] - GAMMA ( input, db ) + GAMMA_GAMMA ( input, db ) } diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml index 308d890f..2c649105 100644 --- a/tests/modules/gamma/gamma/test.yml +++ b/tests/modules/gamma/gamma/test.yml @@ -4,14 +4,14 @@ - gamma/gamma - gamma files: - - path: /tmp/tmppm1ybfln/gamma/test.fasta + - path: output/gamma/gamma/test.fasta md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce - - path: /tmp/tmppm1ybfln/gamma/test.gamma + - path: output/gamma/gamma/test.gamma md5sum: 46165a89e10b7315d3a9b0aa6c561626 - - path: /tmp/tmppm1ybfln/gamma/test.psl + - path: output/gamma/gamma/test.psl md5sum: f489ce4602ddbcb692d5781ee3fbf449 - - path: /tmp/tmppm1ybfln/gamma/versions.yml - md5sum: ad23c3ec60663598543cbe8bc74bc4ab + - path: output/gamma/gamma/versions.yml + md5sum: 8baafec7b3b87f788f69e30d317c9722 - name: gamma gamma test_gamma command: nextflow run tests/modules/gamma/gamma -entry test_gamma -c tests/config/nextflow.config @@ -19,11 +19,11 @@ - gamma/gamma - gamma files: - - path: /tmp/tmpw3chm6da/gamma/test.fasta + - path: output/gamma/gamma/test.fasta md5sum: df37b48466181311e0a679f3c5878484 - - path: /tmp/tmpw3chm6da/gamma/test.gamma + - path: output/gamma/gamma/test.gamma md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: /tmp/tmpw3chm6da/gamma/test.psl + - path: output/gamma/gamma/test.psl md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: /tmp/tmpw3chm6da/gamma/versions.yml - md5sum: 3fefb5b46c94993362243c5f9a472057 + - path: output/gamma/gamma/versions.yml + md5sum: b75c2871d8cac2f8ac67c0fbd22babd6 From bb999395aa4d03d02336794c655cfcdf34855b05 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 19:19:38 -0400 Subject: [PATCH 05/31] fixed pytest_modules.yml --- tests/config/pytest_modules.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2063d691..80711bae 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -707,9 +707,9 @@ freebayes: - modules/freebayes/** - tests/modules/freebayes/** -gamma: - - modules/gamma/** - - tests/modules/gamma/** +gamma/gamma: + - modules/gamma/gamma/** + - tests/modules/gamma/gamma/** gatk4/applybqsr: - modules/gatk4/applybqsr/** From 127665d27ba5512bfe1596f86c2b11a197556233 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 19:27:09 -0400 Subject: [PATCH 06/31] fixed test.yml --- tests/modules/gamma/gamma/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml index 2c649105..163eda5f 100644 --- a/tests/modules/gamma/gamma/test.yml +++ b/tests/modules/gamma/gamma/test.yml @@ -4,13 +4,13 @@ - gamma/gamma - gamma files: - - path: output/gamma/gamma/test.fasta + - path: output/gamma/test.fasta md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce - - path: output/gamma/gamma/test.gamma + - path: output/gamma/test.gamma md5sum: 46165a89e10b7315d3a9b0aa6c561626 - - path: output/gamma/gamma/test.psl + - path: output/gamma/test.psl md5sum: f489ce4602ddbcb692d5781ee3fbf449 - - path: output/gamma/gamma/versions.yml + - path: output/gamma/versions.yml md5sum: 8baafec7b3b87f788f69e30d317c9722 - name: gamma gamma test_gamma @@ -19,11 +19,11 @@ - gamma/gamma - gamma files: - - path: output/gamma/gamma/test.fasta + - path: output/gamma/test.fasta md5sum: df37b48466181311e0a679f3c5878484 - - path: output/gamma/gamma/test.gamma + - path: output/gamma/test.gamma md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: output/gamma/gamma/test.psl + - path: output/gamma/test.psl md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: output/gamma/gamma/versions.yml + - path: output/gamma/versions.yml md5sum: b75c2871d8cac2f8ac67c0fbd22babd6 From c452f562890534ca3d0a331de7c35b744037fdae Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Wed, 25 May 2022 12:29:14 +0000 Subject: [PATCH 07/31] Patch mash screen --- modules/mash/screen/main.nf | 8 ++++---- modules/mash/screen/meta.yml | 9 +++++---- tests/modules/mash/screen/main.nf | 9 ++++++--- tests/modules/mash/screen/test.yml | 10 +++++----- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/mash/screen/main.nf b/modules/mash/screen/main.nf index 3e7859ed..be272cbb 100644 --- a/modules/mash/screen/main.nf +++ b/modules/mash/screen/main.nf @@ -8,8 +8,8 @@ process MASH_SCREEN { 'quay.io/biocontainers/mash:2.3--he348c14_1' }" input: - tuple val(meta), path(query_sketch) - path fastx_db + tuple val(meta), path(query) + path sequences_sketch output: tuple val(meta), path("*.screen"), emit: screen @@ -26,8 +26,8 @@ process MASH_SCREEN { screen \\ $args \\ -p $task.cpus \\ - $query_sketch \\ - $fastx_db \\ + $sequences_sketch \\ + $query \\ > ${prefix}.screen cat <<-END_VERSIONS > versions.yml diff --git a/modules/mash/screen/meta.yml b/modules/mash/screen/meta.yml index 81e455bc..063aca6c 100644 --- a/modules/mash/screen/meta.yml +++ b/modules/mash/screen/meta.yml @@ -20,13 +20,14 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - query_sketch: + - query: type: file - description: MinHash sketch of query sequences - pattern: "*.msh" - - fastx_db: + description: Query sequences + pattern: "*.fastq.gz" + - sequence_sketch: type: file description: Sequence files to match against + pattern: "*.msh" output: - meta: diff --git a/tests/modules/mash/screen/main.nf b/tests/modules/mash/screen/main.nf index 7f0b8bd9..5338d932 100644 --- a/tests/modules/mash/screen/main.nf +++ b/tests/modules/mash/screen/main.nf @@ -14,8 +14,11 @@ workflow test_mash_screen { file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] - fastx_db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + sars_db = [ + [ id: 'sars_db' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] - MASH_SKETCH ( input ) - MASH_SCREEN ( MASH_SKETCH.out.mash, fastx_db ) + MASH_SKETCH ( sars_db ) + MASH_SCREEN ( input, MASH_SKETCH.out.mash.map { meta, sketch -> sketch } ) } diff --git a/tests/modules/mash/screen/test.yml b/tests/modules/mash/screen/test.yml index f622817a..e4907ce9 100644 --- a/tests/modules/mash/screen/test.yml +++ b/tests/modules/mash/screen/test.yml @@ -4,9 +4,9 @@ - mash - mash/screen files: - - path: output/mash/test.mash_stats - md5sum: 2a6f297d8e69a5e4160243bc6c89129c - - path: output/mash/test.msh - md5sum: d747145a43dad5f82342036f8f5d9133 + - path: output/mash/sars_db.mash_stats + md5sum: 1dafbd23e36e18bf4c87a007d0fc98f7 + - path: output/mash/sars_db.msh + md5sum: 24289e4a13526e88eeb2abfca4a0f0a8 - path: output/mash/test.screen - md5sum: d3c871dccd5cd57ab54781fa5c5d7278 + md5sum: ac8701e1aab651b2f36c6380b1351b11 From 72ff2732e3177b041234aa49c1775376a00d59f4 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 25 May 2022 19:19:39 +0200 Subject: [PATCH 08/31] add all remaining outputs to mosdepth --- modules/mosdepth/main.nf | 29 ++++++++++++------ modules/mosdepth/meta.yml | 16 ++++++++++ tests/modules/mosdepth/main.nf | 30 ++++++++++++++++-- tests/modules/mosdepth/nextflow.config | 6 ++++ tests/modules/mosdepth/test.yml | 42 ++++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 12 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 5f6538e7..96471cfc 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -13,15 +13,19 @@ process MOSDEPTH { path fasta output: - tuple val(meta), path('*.global.dist.txt') , emit: global_txt - tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true - tuple val(meta), path('*.summary.txt') , emit: summary_txt - tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true - tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true - tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi, optional:true - tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true - tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true - path "versions.yml" , emit: versions + tuple val(meta), path('*.global.dist.txt') , emit: global_txt + tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true + tuple val(meta), path('*.summary.txt') , emit: summary_txt + tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true + tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true + tuple val(meta), path('*.per-base.bed.gz.csi') , emit: per_base_csi, optional:true + tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true + tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true + tuple val(meta), path('*.quantized.bed.gz') , emit: quantized_bed , optional:true + tuple val(meta), path('*.quantized.bed.gz.csi') , emit: quantized_csi , optional:true + tuple val(meta), path('*.thresholds.bed.gz') , emit: thresholds_bed , optional:true + tuple val(meta), path('*.thresholds.bed.gz.csi'), emit: thresholds_csi , optional:true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -34,6 +38,9 @@ process MOSDEPTH { if (bed && args.contains("--by")) { exit 1, "'--by' can only be specified once when running mosdepth! Either remove input BED file definition or remove '--by' from 'ext.args' definition" } + if (!bed && args.contains("--thresholds")) { + exit 1, "'--thresholds' can only be specified in conjunction with '--by'" + } """ mosdepth \\ @@ -61,6 +68,10 @@ process MOSDEPTH { touch ${prefix}.per-base.bed.gz.csi touch ${prefix}.regions.bed.gz touch ${prefix}.regions.bed.gz.csi + touch ${prefix}.quantized.bed.gz + touch ${prefix}.quantized.bed.gz.csi + touch ${prefix}.thresholds.bed.gz + touch ${prefix}.thresholds.bed.gz.csi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index 6e9e34c9..d1e33447 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -72,6 +72,22 @@ output: type: file description: Index file for BED file with per-region coverage pattern: "*.{regions.bed.gz.csi}" + - quantized_bed: + type: file + description: BED file with binned coverage + pattern: "*.{quantized.bed.gz}" + - quantized_csi: + type: file + description: Index file for BED file with binned coverage + pattern: "*.{quantized.bed.gz.csi}" + - thresholds_bed: + type: file + description: BED file with the number of bases in each region that are covered at or above each threshold + pattern: "*.{thresholds.bed.gz}" + - thresholds_csi: + type: file + description: Index file for BED file with threshold coverage + pattern: "*.{thresholds.bed.gz.csi}" - versions: type: file description: File containing software versions diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index 96a9ef20..dd4a01c4 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -2,9 +2,12 @@ nextflow.enable.dsl = 2 -include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' -include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' -include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_THRESHOLD } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_QUANTIZED } from '../../../modules/mosdepth/main.nf' + workflow test_mosdepth { input = [ @@ -61,6 +64,27 @@ workflow test_mosdepth_window { MOSDEPTH_WINDOW ( input, [], [] ) } +workflow test_mosdepth_quantized { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + + MOSDEPTH_QUANTIZED ( input, [], [] ) +} + +workflow test_mosdepth_thresholds { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + + MOSDEPTH_THRESHOLD ( input, bed, [] ) +} + workflow test_mosdepth_fail { input = [ [ id:'test', single_end:true ], diff --git a/tests/modules/mosdepth/nextflow.config b/tests/modules/mosdepth/nextflow.config index 4a6153e6..66e9291f 100644 --- a/tests/modules/mosdepth/nextflow.config +++ b/tests/modules/mosdepth/nextflow.config @@ -7,4 +7,10 @@ process { withName: MOSDEPTH_WINDOW { ext.args = "--by 100" } + withName: MOSDEPTH_QUANTIZED { + ext.args = "--quantize 0:1:4:100:200" + } + withName: MOSDEPTH_THRESHOLD { + ext.args = "--thresholds 1,10,20,30" + } } diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index a3115d6e..8efadb9d 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -86,6 +86,48 @@ - path: output/mosdepth/test.regions.bed.gz.csi md5sum: 257d67678136963d9dd904330079609d +- name: mosdepth test_mosdepth_quantized + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_quantized -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.quantized.bed.gz + md5sum: 3e434a8bafcf59a67841ae3d4d752838 + - path: output/mosdepth/test.quantized.bed.gz.csi + md5sum: be9617f551f19a33923f1e886eaefb93 + +- name: mosdepth test_mosdepth_thresholds + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_thresholds -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 96c037f769974b904beb53edc4f56d82 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.regions.bed.gz + md5sum: 5d398caf7171ec4406278e2add3009ae + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: 47669cfe41f3e222e74d81e1b1be191f + - path: output/mosdepth/test.thresholds.bed.gz + md5sum: 13101e326eea3cbfa1d569b69f494f4c + - path: output/mosdepth/test.thresholds.bed.gz.csi + md5sum: 912055ee9452229439df6fae95644196 + - name: mosdepth test_mosdepth_fail command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: From 241a1de035d47529fd09835f3f619490308afc21 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 25 May 2022 19:38:12 +0100 Subject: [PATCH 09/31] Update main.nf --- tests/modules/mosdepth/main.nf | 93 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index dd4a01c4..1bb8e8ff 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -8,90 +8,89 @@ include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main. include { MOSDEPTH as MOSDEPTH_THRESHOLD } from '../../../modules/mosdepth/main.nf' include { MOSDEPTH as MOSDEPTH_QUANTIZED } from '../../../modules/mosdepth/main.nf' - workflow test_mosdepth { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] MOSDEPTH ( input, [], [] ) } workflow test_mosdepth_bed { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH ( input, bed, [] ) } workflow test_mosdepth_cram { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) MOSDEPTH ( input, [], fasta ) } workflow test_mosdepth_cram_bed { input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] - fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) MOSDEPTH ( input, bed, fasta ) } workflow test_mosdepth_window { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_WINDOW ( input, [], [] ) } workflow test_mosdepth_quantized { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] MOSDEPTH_QUANTIZED ( input, [], [] ) } workflow test_mosdepth_thresholds { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_THRESHOLD ( input, bed, [] ) } workflow test_mosdepth_fail { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_FAIL ( input, bed, [] ) } From 72a31b76eb1b58879e0d91fb1d992e0118693098 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 25 May 2022 19:42:15 +0100 Subject: [PATCH 10/31] Update main.nf --- modules/mosdepth/main.nf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 96471cfc..d7e3c929 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -14,17 +14,17 @@ process MOSDEPTH { output: tuple val(meta), path('*.global.dist.txt') , emit: global_txt - tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true tuple val(meta), path('*.summary.txt') , emit: summary_txt - tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true - tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true - tuple val(meta), path('*.per-base.bed.gz.csi') , emit: per_base_csi, optional:true - tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true - tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true - tuple val(meta), path('*.quantized.bed.gz') , emit: quantized_bed , optional:true - tuple val(meta), path('*.quantized.bed.gz.csi') , emit: quantized_csi , optional:true - tuple val(meta), path('*.thresholds.bed.gz') , emit: thresholds_bed , optional:true - tuple val(meta), path('*.thresholds.bed.gz.csi'), emit: thresholds_csi , optional:true + tuple val(meta), path('*.region.dist.txt') , optional:true, emit: regions_txt + tuple val(meta), path('*.per-base.d4') , optional:true, emit: per_base_d4 + tuple val(meta), path('*.per-base.bed.gz') , optional:true, emit: per_base_bed + tuple val(meta), path('*.per-base.bed.gz.csi') , optional:true, emit: per_base_csi + tuple val(meta), path('*.regions.bed.gz') , optional:true, emit: regions_bed + tuple val(meta), path('*.regions.bed.gz.csi') , optional:true, emit: regions_csi + tuple val(meta), path('*.quantized.bed.gz') , optional:true, emit: quantized_bed + tuple val(meta), path('*.quantized.bed.gz.csi') , optional:true, emit: quantized_csi + tuple val(meta), path('*.thresholds.bed.gz') , optional:true, emit: thresholds_bed + tuple val(meta), path('*.thresholds.bed.gz.csi'), optional:true, emit: thresholds_csi path "versions.yml" , emit: versions when: @@ -44,7 +44,7 @@ process MOSDEPTH { """ mosdepth \\ - --threads ${task.cpus} \\ + --threads $task.cpus \\ $interval \\ $reference \\ $args \\ From 05e4e2cddec05c58e7a807e03a8e751456eef572 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Thu, 26 May 2022 20:16:45 +0200 Subject: [PATCH 11/31] Add idcutoff as input --- modules/vsearch/usearchglobal/main.nf | 53 ++++++++----------- modules/vsearch/usearchglobal/meta.yml | 51 ++++++++++++++++-- tests/modules/vsearch/usearchglobal/main.nf | 7 +-- .../vsearch/usearchglobal/nextflow.config | 1 - tests/modules/vsearch/usearchglobal/test.yml | 8 +-- .../vsearch/usearchglobal/test.yml.ori | 14 ----- 6 files changed, 79 insertions(+), 55 deletions(-) delete mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 0b31842f..ed95b7c3 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -1,39 +1,31 @@ -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta - process VSEARCH_USEARCHGLOBAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--h95f258a_0': 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - tuple val(meta), path(queryfasta) + val(meta) + path(queryfasta) path db + val idcutoff val outoption val user_columns - // TODO nf-core: Where applicable please provide/convert compressed files as input/output - // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. - output: - tuple val(meta), path('*.aln') , optional: true, emit: aln - tuple val(meta), path('*.biom') , optional: true, emit: biom - tuple val(meta), path('*.sam') , optional: true, emit: sam - tuple val(meta), path('*.tsv') , optional: true, emit: tsv - tuple val(meta), path('*.uc') , optional: true, emit: uc - path "versions.yml" , emit: versions + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.lca') , optional: true, emit: lca + tuple val(meta), path('*.mothur') , optional: true, emit: mothur + tuple val(meta), path('*.otu') , optional: true, emit: otu + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -45,13 +37,13 @@ process VSEARCH_USEARCHGLOBAL { switch ( outoption ) { case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break - case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break - case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break - case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break - case "samout": outfmt = "--samout"; out_ext = 'sam'; break - case "uc": outfmt = "--uc"; out_ext = 'uc'; break - case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break - case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'txt'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca'; break default: outfmt = "--alnout"; out_ext = 'aln'; @@ -62,6 +54,7 @@ process VSEARCH_USEARCHGLOBAL { vsearch \\ --usearch_global $queryfasta \\ --db $db \\ + --id $idcutoff \\ --threads $task.cpus \\ $args \\ ${columns} \\ diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 8cb97446..848fb65a 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -15,20 +15,65 @@ tools: licence: "['GPL v3-or-later OR BSD-2-clause']" input: + - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test' ] - queryfasta: type: file description: Query sequences in FASTA format pattern: "*.{fasta,fa,fna,faa}" - db: type: file - description: Reference database file. It may be in FASTA or UDB format. + description: Reference database file in FASTA or UDB format pattern: "*" + - idcutoff: + type: real + description: Reject the sequence match if the pairwise identity is lower than the given id cutoff value (value ranging from 0.0 to 1.0 included) + - outoption: + type: string + description: Specify the type of output file to be generated by selecting one of the vsearch output file options + pattern: "alnout|biomout|blast6out|mothur_shared_out|otutabout|samout|uc|userout|lcaout" + - user_columns: + type: string + description: If using the `userout` option, specify which columns to include in output, with fields separated with `+` (e.g. query+target+id). See USEARCH manual for valid options. For other output options, use an empty string. output: - - blast6out: + - aln: type: file - description: Tab delimited results in blast-like format + description: Results in pairwise alignment format + pattern: "*.{aln}" + - biom: + type: file + description: Results in an OTU table in the biom version 1.0 file format + pattern: "*.{biom}" + - lca: + type: file + description: Last common ancestor (LCA) information about the hits of each query in tab-separated format + pattern: "*.{lca}" + - mothur: + type: file + description: Results in an OTU table in the mothur ’shared’ tab-separated plain text file format + pattern: "*.{mothur}" + - otu: + type: file + description: Results in an OTU table in the classic tab-separated plain text format + pattern: "*.{otu}" + - sam: + type: file + description: Results written in sam format + pattern: "*.{sam}" + - tsv: + type: file + description: Results in tab-separated output, columns defined by user pattern: "*.{tsv}" + - txt: + type: file + description: Tab delimited results in blast-like tabular format + pattern: "*.{txt}" + - uc: + type: file + description: Tab delimited results in a uclust-like format with 10 columns + pattern: "*.{uc}" - versions: type: file description: File containing software versions diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index cdf0fb2f..f4afec32 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,17 +8,18 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - + idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index 3148a59e..14f46dea 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,4 @@ process { - ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b7ebec4a..79bcd50e 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,17 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - path: output/vsearch/test.aln - md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + md5sum: 2543c4147530dcb1ba4550d3fdb1502a - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - - path: output/vsearch/test.user.tsv + - path: output/vsearch/test.tsv md5sum: b6cc50f7c8d18cb82e74dab70ed4baab diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori deleted file mode 100644 index df644165..00000000 --- a/tests/modules/vsearch/usearchglobal/test.yml.ori +++ /dev/null @@ -1,14 +0,0 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml vsearch/usearchglobal -- name: "vsearch usearchglobal" - command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config - tags: - - "vsearch" - # - - "vsearch/usearchglobal" - # - files: - - path: "output/vsearch/blast6out_results.tsv" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/vsearch/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From fb6c7bca3d55c19a793372513395e3a567bdd7ba Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 27 May 2022 11:35:04 +0100 Subject: [PATCH 12/31] Bump container version for STAR to 2.7.10a --- modules/star/align/main.nf | 13 +++++++------ modules/star/genomegenerate/main.nf | 13 ++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/star/align/main.nf b/modules/star/align/main.nf index 762b84f6..e5aa36f5 100644 --- a/modules/star/align/main.nf +++ b/modules/star/align/main.nf @@ -2,16 +2,15 @@ process STAR_ALIGN { tag "$meta.id" label 'process_high' - // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? 'bioconda::star=2.7.9a' : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/star:2.7.9a--h9ee0642_0' : - 'quay.io/biocontainers/star:2.7.9a--h9ee0642_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: tuple val(meta), path(reads) - path index - path gtf + path index + path gtf val star_ignore_sjdbgtf val seq_platform val seq_center @@ -67,6 +66,8 @@ process STAR_ALIGN { cat <<-END_VERSIONS > versions.yml "${task.process}": star: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') END_VERSIONS """ } diff --git a/modules/star/genomegenerate/main.nf b/modules/star/genomegenerate/main.nf index e5568f1d..3c298016 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -2,19 +2,18 @@ process STAR_GENOMEGENERATE { tag "$fasta" label 'process_high' - // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? "bioconda::star=2.7.9a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' : - 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: path fasta path gtf output: - path "star" , emit: index - path "versions.yml" , emit: versions + path "star" , emit: index + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -22,7 +21,7 @@ process STAR_GENOMEGENERATE { script: def args = task.ext.args ?: '' def args_list = args.tokenize() - def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' + def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' if (args_list.contains('--genomeSAindexNbases')) { """ mkdir star From ad578cafcc559b8a6a99257b91e85ba044d9f619 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 27 May 2022 12:14:10 +0100 Subject: [PATCH 13/31] Fix tests --- tests/modules/star/align/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/modules/star/align/test.yml b/tests/modules/star/align/test.yml index af5bebe5..f7cb0f62 100644 --- a/tests/modules/star/align/test.yml +++ b/tests/modules/star/align/test.yml @@ -36,7 +36,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: b9f5e2f6a624b64c300fe25dc3ac801f + md5sum: 63de6af2210e138b49d7b4d570c6e67f - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -80,7 +80,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: 38d08f0b944a2a1b981a250d675aa0d9 + md5sum: 7cdef439bc8092bfefb4d091bf8ee6ab - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -124,7 +124,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: c740d5177067c1fcc48ab7a16cd639d7 + md5sum: 5dbc36fce7b72628c809bbc7d3d67973 - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -168,9 +168,9 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: a1bd1b40950a58ea2776908076160052 + md5sum: d85858bf55a523121dde762046a34c5c - path: output/star/test.Chimeric.out.junction - md5sum: 327629eb54032212f29e1c32cbac6975 + md5sum: ae87d1a24180f5a35cf6b47fdfdd0539 - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out From 1c99ffd876a3a91c13764b7b9c26959d74eb1bea Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 10:01:55 +0200 Subject: [PATCH 14/31] Add vserach usearch_global --- modules/vsearch/usearchglobal/main.nf | 51 +++++++++++++++++++ modules/vsearch/usearchglobal/meta.yml | 38 ++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/vsearch/usearchglobal/main.nf | 12 +++++ .../vsearch/usearchglobal/nextflow.config | 5 ++ tests/modules/vsearch/usearchglobal/test.yml | 7 +++ .../vsearch/usearchglobal/test.yml.ori | 14 +++++ 7 files changed, 131 insertions(+) create mode 100644 modules/vsearch/usearchglobal/main.nf create mode 100644 modules/vsearch/usearchglobal/meta.yml create mode 100644 tests/modules/vsearch/usearchglobal/main.nf create mode 100644 tests/modules/vsearch/usearchglobal/nextflow.config create mode 100644 tests/modules/vsearch/usearchglobal/test.yml create mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..65ee62cc --- /dev/null +++ b/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,51 @@ +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta + +process VSEARCH_USEARCHGLOBAL { + tag '$queryfasta' + label 'process_low' + + conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" + + input: + path queryfasta + path db + val outprefix + + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + + output: + path ("*.tsv") , emit: tsv + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + vsearch \\ + --usearch_global $queryfasta \\ + --db $db \\ + --threads $task.cpus \\ + $args \\ + --blast6out ${outprefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vsearch: \$(vsearch --version 2>&1 | head -n 1 | sed 's/vsearch //g' | sed 's/,.*//g' | sed 's/^v//' | sed 's/_.*//') + END_VERSIONS + """ +} diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml new file mode 100644 index 00000000..8cb97446 --- /dev/null +++ b/modules/vsearch/usearchglobal/meta.yml @@ -0,0 +1,38 @@ +name: "vsearch_usearchglobal" +description: Compare target sequences to fasta-formatted query sequences using global pairwise alignment. +keywords: + - vsearch + - usearch + - alignment + - fasta +tools: + - "vsearch": + description: "VSEARCH is a versatile open-source tool for microbiome analysis, including chimera detection, clustering, dereplication and rereplication, extraction, FASTA/FASTQ/SFF file processing, masking, orienting, pair-wise alignment, restriction site cutting, searching, shuffling, sorting, subsampling, and taxonomic classification of amplicon sequences for metagenomics, genomics, and population genetics. (USEARCH alternative)" + homepage: "https://github.com/torognes/vsearch" + documentation: "None" + tool_dev_url: "https://github.com/torognes/vsearch" + doi: "doi: 10.7717/peerj.2584" + licence: "['GPL v3-or-later OR BSD-2-clause']" + +input: + - queryfasta: + type: file + description: Query sequences in FASTA format + pattern: "*.{fasta,fa,fna,faa}" + - db: + type: file + description: Reference database file. It may be in FASTA or UDB format. + pattern: "*" + +output: + - blast6out: + type: file + description: Tab delimited results in blast-like format + pattern: "*.{tsv}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jtangrot" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 529f3e02..3ff58b5c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2052,6 +2052,10 @@ vcftools: - modules/vcftools/** - tests/modules/vcftools/** +vsearch/usearchglobal: + - modules/vsearch/usearchglobal/** + - tests/modules/vsearch/usearchglobal/** + yara/index: - modules/yara/index/** - tests/modules/yara/index/** diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..02becd21 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VSEARCH_USEARCHGLOBAL } from '../../../../modules/vsearch/usearchglobal/main.nf' + +workflow test_vsearch_usearchglobal { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) +} diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config new file mode 100644 index 00000000..aab29979 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -0,0 +1,5 @@ +process { + ext.args = '--id 0.985' + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml new file mode 100644 index 00000000..b013519d --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -0,0 +1,7 @@ +- name: vsearch usearchglobal test_vsearch_usearchglobal + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch/usearchglobal + files: + - path: output/vsearch/blast6out_results.tsv + md5sum: 09733131643f1d951321a6e17a35eb8c diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori new file mode 100644 index 00000000..df644165 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml.ori @@ -0,0 +1,14 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml vsearch/usearchglobal +- name: "vsearch usearchglobal" + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - "vsearch" + # + - "vsearch/usearchglobal" + # + files: + - path: "output/vsearch/blast6out_results.tsv" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/vsearch/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 589ce2d73a0b9a3109f5291587eff425ca7fbfa5 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 14:02:10 +0200 Subject: [PATCH 15/31] Add options for output file type --- modules/vsearch/usearchglobal/main.nf | 38 +++++++++++++++---- tests/modules/vsearch/usearchglobal/main.nf | 14 ++++++- .../vsearch/usearchglobal/nextflow.config | 4 +- tests/modules/vsearch/usearchglobal/test.yml | 14 ++++++- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 65ee62cc..0b31842f 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -10,7 +10,7 @@ // bwa mem | samtools view -B -T ref.fasta process VSEARCH_USEARCHGLOBAL { - tag '$queryfasta' + tag "$meta.id" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) @@ -19,29 +19,53 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - path queryfasta + tuple val(meta), path(queryfasta) path db - val outprefix + val outoption + val user_columns // TODO nf-core: Where applicable please provide/convert compressed files as input/output // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. output: - path ("*.tsv") , emit: tsv - path "versions.yml" , emit: versions - + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.uc') , optional: true, emit: uc + 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 columns = user_columns ? "--userfields ${user_columns}" : '' + switch ( outoption ) { + case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break + case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + default: + outfmt = "--alnout"; + out_ext = 'aln'; + log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + break + } """ vsearch \\ --usearch_global $queryfasta \\ --db $db \\ --threads $task.cpus \\ $args \\ - --blast6out ${outprefix}.tsv + ${columns} \\ + ${outfmt} ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index 02becd21..cdf0fb2f 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,5 +8,17 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) + + outoption = "xcfert" // Nonsense text to check default case. + columns = "" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) +} + +workflow test_vsearch_usearchglobal_userout { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + outoption = "userout" + columns = "query+target+id" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index aab29979..3148a59e 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,5 @@ process { ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file +} + diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b013519d..b7ebec4a 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,7 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: + - vsearch - vsearch/usearchglobal files: - - path: output/vsearch/blast6out_results.tsv - md5sum: 09733131643f1d951321a6e17a35eb8c + - path: output/vsearch/test.aln + md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + +- name: vsearch usearchglobal test_vsearch_usearchglobal_userout + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch + - vsearch/usearchglobal + files: + - path: output/vsearch/test.user.tsv + md5sum: b6cc50f7c8d18cb82e74dab70ed4baab From 01d86439f5a25cd6b46006420ad7eb35049f4b27 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Thu, 26 May 2022 20:16:45 +0200 Subject: [PATCH 16/31] Add idcutoff as input --- modules/vsearch/usearchglobal/main.nf | 53 ++++++++----------- modules/vsearch/usearchglobal/meta.yml | 51 ++++++++++++++++-- tests/modules/vsearch/usearchglobal/main.nf | 7 +-- .../vsearch/usearchglobal/nextflow.config | 1 - tests/modules/vsearch/usearchglobal/test.yml | 8 +-- .../vsearch/usearchglobal/test.yml.ori | 14 ----- 6 files changed, 79 insertions(+), 55 deletions(-) delete mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 0b31842f..ed95b7c3 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -1,39 +1,31 @@ -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta - process VSEARCH_USEARCHGLOBAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--h95f258a_0': 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - tuple val(meta), path(queryfasta) + val(meta) + path(queryfasta) path db + val idcutoff val outoption val user_columns - // TODO nf-core: Where applicable please provide/convert compressed files as input/output - // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. - output: - tuple val(meta), path('*.aln') , optional: true, emit: aln - tuple val(meta), path('*.biom') , optional: true, emit: biom - tuple val(meta), path('*.sam') , optional: true, emit: sam - tuple val(meta), path('*.tsv') , optional: true, emit: tsv - tuple val(meta), path('*.uc') , optional: true, emit: uc - path "versions.yml" , emit: versions + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.lca') , optional: true, emit: lca + tuple val(meta), path('*.mothur') , optional: true, emit: mothur + tuple val(meta), path('*.otu') , optional: true, emit: otu + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -45,13 +37,13 @@ process VSEARCH_USEARCHGLOBAL { switch ( outoption ) { case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break - case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break - case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break - case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break - case "samout": outfmt = "--samout"; out_ext = 'sam'; break - case "uc": outfmt = "--uc"; out_ext = 'uc'; break - case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break - case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'txt'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca'; break default: outfmt = "--alnout"; out_ext = 'aln'; @@ -62,6 +54,7 @@ process VSEARCH_USEARCHGLOBAL { vsearch \\ --usearch_global $queryfasta \\ --db $db \\ + --id $idcutoff \\ --threads $task.cpus \\ $args \\ ${columns} \\ diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 8cb97446..848fb65a 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -15,20 +15,65 @@ tools: licence: "['GPL v3-or-later OR BSD-2-clause']" input: + - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test' ] - queryfasta: type: file description: Query sequences in FASTA format pattern: "*.{fasta,fa,fna,faa}" - db: type: file - description: Reference database file. It may be in FASTA or UDB format. + description: Reference database file in FASTA or UDB format pattern: "*" + - idcutoff: + type: real + description: Reject the sequence match if the pairwise identity is lower than the given id cutoff value (value ranging from 0.0 to 1.0 included) + - outoption: + type: string + description: Specify the type of output file to be generated by selecting one of the vsearch output file options + pattern: "alnout|biomout|blast6out|mothur_shared_out|otutabout|samout|uc|userout|lcaout" + - user_columns: + type: string + description: If using the `userout` option, specify which columns to include in output, with fields separated with `+` (e.g. query+target+id). See USEARCH manual for valid options. For other output options, use an empty string. output: - - blast6out: + - aln: type: file - description: Tab delimited results in blast-like format + description: Results in pairwise alignment format + pattern: "*.{aln}" + - biom: + type: file + description: Results in an OTU table in the biom version 1.0 file format + pattern: "*.{biom}" + - lca: + type: file + description: Last common ancestor (LCA) information about the hits of each query in tab-separated format + pattern: "*.{lca}" + - mothur: + type: file + description: Results in an OTU table in the mothur ’shared’ tab-separated plain text file format + pattern: "*.{mothur}" + - otu: + type: file + description: Results in an OTU table in the classic tab-separated plain text format + pattern: "*.{otu}" + - sam: + type: file + description: Results written in sam format + pattern: "*.{sam}" + - tsv: + type: file + description: Results in tab-separated output, columns defined by user pattern: "*.{tsv}" + - txt: + type: file + description: Tab delimited results in blast-like tabular format + pattern: "*.{txt}" + - uc: + type: file + description: Tab delimited results in a uclust-like format with 10 columns + pattern: "*.{uc}" - versions: type: file description: File containing software versions diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index cdf0fb2f..f4afec32 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,17 +8,18 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - + idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index 3148a59e..14f46dea 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,4 @@ process { - ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b7ebec4a..79bcd50e 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,17 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - path: output/vsearch/test.aln - md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + md5sum: 2543c4147530dcb1ba4550d3fdb1502a - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - - path: output/vsearch/test.user.tsv + - path: output/vsearch/test.tsv md5sum: b6cc50f7c8d18cb82e74dab70ed4baab diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori deleted file mode 100644 index df644165..00000000 --- a/tests/modules/vsearch/usearchglobal/test.yml.ori +++ /dev/null @@ -1,14 +0,0 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml vsearch/usearchglobal -- name: "vsearch usearchglobal" - command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config - tags: - - "vsearch" - # - - "vsearch/usearchglobal" - # - files: - - path: "output/vsearch/blast6out_results.tsv" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/vsearch/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 2e16c90fce782bda854d2d638d0e216fc613ca39 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 09:57:05 +0200 Subject: [PATCH 17/31] Fix whitespace --- modules/vsearch/usearchglobal/main.nf | 2 +- modules/vsearch/usearchglobal/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index ed95b7c3..804ef223 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -26,7 +26,7 @@ process VSEARCH_USEARCHGLOBAL { tuple val(meta), path('*.txt') , optional: true, emit: txt tuple val(meta), path('*.uc') , optional: true, emit: uc path "versions.yml" , emit: versions - + when: task.ext.when == null || task.ext.when diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 848fb65a..3b22e9cd 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -65,7 +65,7 @@ output: - tsv: type: file description: Results in tab-separated output, columns defined by user - pattern: "*.{tsv}" + pattern: "*.{tsv}" - txt: type: file description: Tab delimited results in blast-like tabular format From c67c15f243b6e590fb28275dbcc29f0d4ae6053c Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:01:06 +0200 Subject: [PATCH 18/31] Make input tuple --- modules/vsearch/usearchglobal/main.nf | 3 +-- tests/modules/vsearch/usearchglobal/main.nf | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 804ef223..88d945ea 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -8,8 +8,7 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - val(meta) - path(queryfasta) + tuple val(meta), path(queryfasta) path db val idcutoff val outoption diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index f4afec32..90dc3191 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -11,7 +11,7 @@ workflow test_vsearch_usearchglobal { idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [[id:'test'], query], db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { @@ -21,5 +21,5 @@ workflow test_vsearch_usearchglobal_userout { idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [[id:'test'], query], db, idcutoff, outoption, columns ) } From 69e00b55d39c2d4c1f4ef94fd5be972d8478c07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeanette=20T=C3=A5ngrot?= Date: Mon, 30 May 2022 13:03:45 +0200 Subject: [PATCH 19/31] Update modules/vsearch/usearchglobal/main.nf Co-authored-by: Daniel Straub <42973691+d4straub@users.noreply.github.com> --- modules/vsearch/usearchglobal/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 804ef223..01e379d2 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -47,7 +47,7 @@ process VSEARCH_USEARCHGLOBAL { default: outfmt = "--alnout"; out_ext = 'aln'; - log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + log.warn("Unknown output file format provided (${outoption}): selecting pairwise alignments (alnout)"); break } """ From 6aac5c2c4099f950f43f9db7fa3b4b639c4c7ffc Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:30:27 +0200 Subject: [PATCH 20/31] Update test --- tests/modules/vsearch/usearchglobal/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index 79bcd50e..a593f78f 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -5,7 +5,16 @@ - vsearch files: - path: output/vsearch/test.aln - md5sum: 2543c4147530dcb1ba4550d3fdb1502a + contains: + - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" + - "Query >lcl|MT192765.1_cds_QIK50427.1_2" + - "%Id TLen Target" + - "100% 29829 MT192765.1" + - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" + - "Target 29829nt >MT192765.1" + - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" + - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" + - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config From 6ae405c5dab57ca9ce3761bfd6f39d6bb8df9e20 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:35:12 +0200 Subject: [PATCH 21/31] prettier --- tests/modules/vsearch/usearchglobal/test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index a593f78f..227d728f 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -6,15 +6,15 @@ files: - path: output/vsearch/test.aln contains: - - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" - - "Query >lcl|MT192765.1_cds_QIK50427.1_2" - - "%Id TLen Target" - - "100% 29829 MT192765.1" - - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" - - "Target 29829nt >MT192765.1" - - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" - - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" - - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" + - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" + - "Query >lcl|MT192765.1_cds_QIK50427.1_2" + - "%Id TLen Target" + - "100% 29829 MT192765.1" + - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" + - "Target 29829nt >MT192765.1" + - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" + - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" + - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config From d463cd5dd676738e95363e46302918d366a6b6d2 Mon Sep 17 00:00:00 2001 From: Sebastien Guizard Date: Mon, 30 May 2022 17:26:51 +0100 Subject: [PATCH 22/31] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Remove=20last?= =?UTF-8?q?=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/bamtools/convert/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/bamtools/convert/meta.yml b/modules/bamtools/convert/meta.yml index 5796a4ab..dcd1cc65 100644 --- a/modules/bamtools/convert/meta.yml +++ b/modules/bamtools/convert/meta.yml @@ -42,7 +42,6 @@ output: type: file description: File containing software versions pattern: "versions.yml" - ## TODO nf-core: Delete / customise this example output - out: type: file description: The data in the asked format (bed, fasta, fastq, json, pileup, sam, yaml) From 723852bf3d3b12059b2f53da8bc055206f3019d7 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 13:38:18 +0200 Subject: [PATCH 23/31] Fixes running without shortreads, and also ensures all tests produce non-empty fastq.gz files --- modules/filtlong/main.nf | 2 +- tests/modules/filtlong/nextflow.config | 2 ++ tests/modules/filtlong/test.yml | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf index 0e6fdd53..67500053 100644 --- a/modules/filtlong/main.nf +++ b/modules/filtlong/main.nf @@ -20,7 +20,7 @@ process FILTLONG { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def short_reads = meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" """ filtlong \\ $short_reads \\ diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index 8730f1c4..ec9854c2 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -2,4 +2,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + ext.args = "--min_length 10" + } diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index dc5fa5a9..9c465303 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -1,23 +1,23 @@ - name: filtlong test_filtlong - command: nextflow run ./tests/modules/filtlong -entry test_filtlong -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed - name: filtlong test_filtlong_illumina_se - command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed - name: filtlong test_filtlong_illumina_pe - command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed From 430def06faabbbbfe03da68661c329b85a1296ed Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 14:45:41 +0200 Subject: [PATCH 24/31] Switch from md5sum to string due to conda flakiness --- tests/modules/filtlong/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index 9c465303..93f847ec 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -4,7 +4,8 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" - name: filtlong test_filtlong_illumina_se command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config @@ -12,7 +13,8 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" - name: filtlong test_filtlong_illumina_pe command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config @@ -20,4 +22,5 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" From 51b0a6e4f3b048a1eebeb86896fa0374771ca554 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 31 May 2022 15:15:58 +0200 Subject: [PATCH 25/31] Added optional input of index files to bcftools/concat --- modules/bcftools/concat/main.nf | 2 +- modules/bcftools/concat/meta.yml | 5 +++++ tests/modules/bcftools/concat/main.nf | 18 +++++++++++++++--- tests/modules/bcftools/concat/test.yml | 15 ++++++++++++--- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/modules/bcftools/concat/main.nf b/modules/bcftools/concat/main.nf index c0633ef7..257ee36f 100644 --- a/modules/bcftools/concat/main.nf +++ b/modules/bcftools/concat/main.nf @@ -8,7 +8,7 @@ process BCFTOOLS_CONCAT { 'quay.io/biocontainers/bcftools:1.14--h88f3f91_0' }" input: - tuple val(meta), path(vcfs) + tuple val(meta), path(vcfs), path(tbi) output: tuple val(meta), path("*.gz"), emit: vcf diff --git a/modules/bcftools/concat/meta.yml b/modules/bcftools/concat/meta.yml index 3984276f..167dbe5a 100644 --- a/modules/bcftools/concat/meta.yml +++ b/modules/bcftools/concat/meta.yml @@ -25,6 +25,11 @@ input: description: | List containing 2 or more vcf files e.g. [ 'file1.vcf', 'file2.vcf' ] + - tbi: + type: files + description: | + List containing 2 or more index files (optional) + e.g. [ 'file1.tbi', 'file2.tbi' ] output: - meta: type: map diff --git a/tests/modules/bcftools/concat/main.nf b/tests/modules/bcftools/concat/main.nf index 8441d488..777dc5b8 100644 --- a/tests/modules/bcftools/concat/main.nf +++ b/tests/modules/bcftools/concat/main.nf @@ -4,13 +4,25 @@ nextflow.enable.dsl = 2 include { BCFTOOLS_CONCAT } from '../../../../modules/bcftools/concat/main.nf' -workflow test_bcftools_concat { +workflow test_bcftools_concat_tbi { input = [ [ id:'test3' ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ] + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) ] + ] + + BCFTOOLS_CONCAT ( input ) +} + +workflow test_bcftools_concat_no_tbi { + + input = [ [ id:'test3' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ], + [] ] - BCFTOOLS_CONCAT ( input ) } diff --git a/tests/modules/bcftools/concat/test.yml b/tests/modules/bcftools/concat/test.yml index 7d04ebc6..0d12badc 100644 --- a/tests/modules/bcftools/concat/test.yml +++ b/tests/modules/bcftools/concat/test.yml @@ -1,8 +1,17 @@ -- name: bcftools concat test_bcftools_concat - command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config +- name: bcftools concat test_bcftools_concat_tbi + command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config tags: - - bcftools/concat - bcftools + - bcftools/concat + files: + - path: output/bcftools/test3.vcf.gz + md5sum: 35c88bfaad20101062e98beb217d7137 + +- name: bcftools concat test_bcftools_concat_no_tbi + command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat_no_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config + tags: + - bcftools + - bcftools/concat files: - path: output/bcftools/test3.vcf.gz md5sum: 35c88bfaad20101062e98beb217d7137 From 5513d095f5240a0240cd327e3b86fa619819d3d4 Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen Date: Tue, 31 May 2022 15:37:26 +0200 Subject: [PATCH 26/31] Adding tbi-files to the output from GATK4_MERGEVCFS. #1709 --- modules/gatk4/mergevcfs/main.nf | 1 + modules/gatk4/mergevcfs/meta.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index 964c1a3b..35930a6e 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -13,6 +13,7 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi path "versions.yml" , emit: versions when: diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 8d4123d9..6110e944 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -35,6 +35,12 @@ output: type: file description: merged vcf file pattern: "*.vcf.gz" + - tbi: + type: file + description: index files for the merged vcf files + pattern: "*.tbi" + + - versions: type: file description: File containing software versions From 3e20ca7e9a0400b3d878e6c846a3b3733bfb867c Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:46:28 +0200 Subject: [PATCH 27/31] Don't hardcode forced output names --- tests/modules/filtlong/nextflow.config | 1 + tests/modules/filtlong/test.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index ec9854c2..f0b90e67 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,5 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" + ext.prefix = "${meta.id}_lr" } diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index 93f847ec..87bd491b 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -3,7 +3,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -12,7 +12,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -21,6 +21,6 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" From 089f761f0bf79c4a486f1df9b6205f650196a2c1 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:49:57 +0200 Subject: [PATCH 28/31] Actually add the changes --- modules/filtlong/main.nf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf index 67500053..9dbf05b2 100644 --- a/modules/filtlong/main.nf +++ b/modules/filtlong/main.nf @@ -11,7 +11,7 @@ process FILTLONG { tuple val(meta), path(shortreads), path(longreads) output: - tuple val(meta), path("${meta.id}_lr_filtlong.fastq.gz"), emit: reads + tuple val(meta), path("*.fastq.gz"), emit: reads path "versions.yml" , emit: versions when: @@ -21,12 +21,13 @@ process FILTLONG { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + if ("$longreads" == "${prefix}.fastq.gz") error "Longread FASTQ input and output names are the same, set prefix in module configuration to disambiguate!" """ filtlong \\ $short_reads \\ $args \\ $longreads \\ - | gzip -n > ${prefix}_lr_filtlong.fastq.gz + | gzip -n > ${prefix}.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": From 98bb45cf4e93801116d9435f2c1e644f91f0628d Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 13:59:56 +0000 Subject: [PATCH 29/31] Updating test for gatk4/mergevcfs --- tests/modules/gatk4/mergevcfs/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/modules/gatk4/mergevcfs/test.yml b/tests/modules/gatk4/mergevcfs/test.yml index da2f7578..eb43a184 100644 --- a/tests/modules/gatk4/mergevcfs/test.yml +++ b/tests/modules/gatk4/mergevcfs/test.yml @@ -6,6 +6,8 @@ files: - path: output/gatk4/test.vcf.gz md5sum: 5b289bda88d3a3504f2e19ee8cff177c + - path: output/gatk4/test.vcf.gz.tbi + md5sum: a81673763b13086cfce9a23e72a35a16 - path: output/gatk4/versions.yml - name: gatk4 mergevcfs test_gatk4_mergevcfs_no_dict From 4199a05aeb0ec277d40cb112949bb85893310873 Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 15:34:34 +0000 Subject: [PATCH 30/31] Removing redundant empty line --- modules/gatk4/mergevcfs/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 6110e944..3ebce0b9 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -40,7 +40,6 @@ output: description: index files for the merged vcf files pattern: "*.tbi" - - versions: type: file description: File containing software versions From df22cd80df8bee4d3f1d5750026c26c560be7392 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 20:07:52 +0200 Subject: [PATCH 31/31] Fix config for tests --- tests/modules/filtlong/nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index f0b90e67..5e4c9fbb 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,6 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" - ext.prefix = "${meta.id}_lr" + ext.prefix = "test_lr" }