From 0d8bd42cca70ad65f9eee3a9395ccc2ef36be362 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:34:23 +0000 Subject: [PATCH 01/34] Create index in bwa directory --- software/bwa/index/main.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/software/bwa/index/main.nf b/software/bwa/index/main.nf index 47d2ec54..5613b86d 100644 --- a/software/bwa/index/main.nf +++ b/software/bwa/index/main.nf @@ -28,7 +28,8 @@ process BWA_INDEX { script: def software = getSoftwareName(task.process) """ - bwa index $options.args $fasta + mkdir bwa + bwa index $options.args bwa/${fasta.baseName} echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ } From dcb1dc5cd93077ec751969ae2a9998f4393741e1 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:34:42 +0000 Subject: [PATCH 02/34] Remove fasta requirement from module --- software/bwa/mem/main.nf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/software/bwa/mem/main.nf b/software/bwa/mem/main.nf index 4ce1c578..d2652b62 100644 --- a/software/bwa/mem/main.nf +++ b/software/bwa/mem/main.nf @@ -21,7 +21,6 @@ process BWA_MEM { input: tuple val(meta), path(reads) path index - path fasta output: tuple val(meta), path("*.bam"), emit: bam @@ -32,13 +31,15 @@ process BWA_MEM { def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + bwa mem \\ $options.args \\ $read_group \\ -t $task.cpus \\ - $fasta \\ + \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ From 6df54698d945ef1da932b9983c5e80e121e4261d Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:34:55 +0000 Subject: [PATCH 03/34] Remove fasta from input --- software/bwa/mem/meta.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/software/bwa/mem/meta.yml b/software/bwa/mem/meta.yml index de61798b..2e44951c 100644 --- a/software/bwa/mem/meta.yml +++ b/software/bwa/mem/meta.yml @@ -51,10 +51,7 @@ input: - index: type: file description: BWA genome index files - pattern: "*.{amb,ann,bwt,pac,sa}" - - fasta: - type: file - description: Input genome fasta file + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" output: - bam: type: file From ade6124a8442229588adb5281ab8e2889bd8cf38 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:35:06 +0000 Subject: [PATCH 04/34] Change tests --- tests/software/bwa/main.nf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/software/bwa/main.nf b/tests/software/bwa/main.nf index a4dcdbbf..e4b3896e 100644 --- a/tests/software/bwa/main.nf +++ b/tests/software/bwa/main.nf @@ -21,8 +21,7 @@ workflow test_bwa_mem_single_end { BWA_MEM_SE ( input, - file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true) ) } @@ -38,7 +37,6 @@ workflow test_bwa_mem_paired_end { BWA_MEM_PE ( input, - file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true) ) } From d63d40827e4eb2f115471d81919b7da19364a540 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:40:55 +0000 Subject: [PATCH 05/34] Fix bwa index tests --- tests/software/bwa/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/software/bwa/test.yml b/tests/software/bwa/test.yml index 9efefa1d..b92025ec 100644 --- a/tests/software/bwa/test.yml +++ b/tests/software/bwa/test.yml @@ -4,13 +4,13 @@ - bwa - bwa_index files: - - path: output/bwa/NC_010473.fa.amb + - path: output/bwa/bwa/NC_010473.fa.amb md5sum: 942a990ae872f1c0b8d72dda2db405d5 - - path: output/bwa/NC_010473.fa.bwt + - path: output/bwa/bwa/NC_010473.fa.bwt md5sum: 7301b52e2ecb893d429a49fa692447ae - - path: output/bwa/NC_010473.fa.pac + - path: output/bwa/bwa/NC_010473.fa.pac md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad - - path: output/bwa/NC_010473.fa.sa + - path: output/bwa/bwa/NC_010473.fa.sa md5sum: a47dcc92e750e2f16fbd979b8ff9538e - name: Run bwa mem single-end From 05b15df17eb892742db3a1520c7d23774ff034c1 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 12:46:34 +0000 Subject: [PATCH 06/34] Remove file extension --- tests/software/bwa/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/software/bwa/test.yml b/tests/software/bwa/test.yml index b92025ec..818c79a5 100644 --- a/tests/software/bwa/test.yml +++ b/tests/software/bwa/test.yml @@ -4,13 +4,13 @@ - bwa - bwa_index files: - - path: output/bwa/bwa/NC_010473.fa.amb + - path: output/bwa/bwa/NC_010473.amb md5sum: 942a990ae872f1c0b8d72dda2db405d5 - - path: output/bwa/bwa/NC_010473.fa.bwt + - path: output/bwa/bwa/NC_010473.bwt md5sum: 7301b52e2ecb893d429a49fa692447ae - - path: output/bwa/bwa/NC_010473.fa.pac + - path: output/bwa/bwa/NC_010473.pac md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad - - path: output/bwa/bwa/NC_010473.fa.sa + - path: output/bwa/bwa/NC_010473.sa md5sum: a47dcc92e750e2f16fbd979b8ff9538e - name: Run bwa mem single-end From 24370f241b5a6d22805939e053a06c8d827acc84 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 13:24:55 +0000 Subject: [PATCH 07/34] Remove inexplicable @ewels file --- test_import.nf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 test_import.nf diff --git a/test_import.nf b/test_import.nf deleted file mode 100644 index 3d7ebd23..00000000 --- a/test_import.nf +++ /dev/null @@ -1,2 +0,0 @@ -// This file doesn't do anything, -// but pipelines can attempt to import it to check connection status From 3ccf99d61288ebce63340f8b86509cb5320a6f39 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 13:37:24 +0000 Subject: [PATCH 08/34] Fix module --- software/bwa/index/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/bwa/index/main.nf b/software/bwa/index/main.nf index 5613b86d..915c6623 100644 --- a/software/bwa/index/main.nf +++ b/software/bwa/index/main.nf @@ -22,14 +22,14 @@ process BWA_INDEX { path fasta output: - path "${fasta}.*" , emit: index + path "bwa" , emit: index path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) """ mkdir bwa - bwa index $options.args bwa/${fasta.baseName} + bwa index $options.args $fasta -p bwa/${fasta.baseName} echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ } From 838defa3506712d8b4c581c28eb5b32296ebe628 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 13:37:40 +0000 Subject: [PATCH 09/34] Update md5sums --- tests/software/bwa/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/software/bwa/test.yml b/tests/software/bwa/test.yml index 818c79a5..bdd5f218 100644 --- a/tests/software/bwa/test.yml +++ b/tests/software/bwa/test.yml @@ -1,5 +1,5 @@ - name: Run bwa index - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_index -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_index -c tests/config/nextflow.config tags: - bwa - bwa_index @@ -14,19 +14,19 @@ md5sum: a47dcc92e750e2f16fbd979b8ff9538e - name: Run bwa mem single-end - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_mem_single_end -c tests/config/nextflow.config tags: - bwa - bwa_mem files: - path: output/test_single_end/test.bam - md5sum: 3ee21210bac387e0335008146e4728bc - + md5sum: 52e81e5bd523d0b27fe533b21a0d80f5 + - name: Run bwa mem paired-end - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_mem_paired_end -c tests/config/nextflow.config tags: - bwa - bwa_mem files: - path: output/test_paired_end/test.bam - md5sum: 510d8acc6448c07cdacce8e64ec0904c + md5sum: 86d82fdb68ed384c656cfc62a253052f From 6ac252e40751cd20bf7b656c328a752935cab7bb Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 2 Feb 2021 13:38:34 +0000 Subject: [PATCH 10/34] Change singularity to docker again --- tests/software/bwa/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/software/bwa/test.yml b/tests/software/bwa/test.yml index bdd5f218..b061fa45 100644 --- a/tests/software/bwa/test.yml +++ b/tests/software/bwa/test.yml @@ -1,5 +1,5 @@ - name: Run bwa index - command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_index -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_index -c tests/config/nextflow.config tags: - bwa - bwa_index @@ -14,7 +14,7 @@ md5sum: a47dcc92e750e2f16fbd979b8ff9538e - name: Run bwa mem single-end - command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_mem_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_single_end -c tests/config/nextflow.config tags: - bwa - bwa_mem @@ -23,7 +23,7 @@ md5sum: 52e81e5bd523d0b27fe533b21a0d80f5 - name: Run bwa mem paired-end - command: nextflow run ./tests/software/bwa -profile singularity -entry test_bwa_mem_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_paired_end -c tests/config/nextflow.config tags: - bwa - bwa_mem From 137d00b5239fd4783a565b75616849dac8e7b5ff Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 5 Feb 2021 10:44:08 +0000 Subject: [PATCH 11/34] Fix tests --- tests/software/bwa/index/test.yml | 10 +++++----- tests/software/bwa/mem/test.yml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/software/bwa/index/test.yml b/tests/software/bwa/index/test.yml index 89fe3f87..0e7decdf 100644 --- a/tests/software/bwa/index/test.yml +++ b/tests/software/bwa/index/test.yml @@ -4,11 +4,11 @@ - bwa - bwa_index files: - - path: output/bwa/NC_010473.fa.amb + - path: output/bwa/bwa/NC_010473.amb md5sum: 942a990ae872f1c0b8d72dda2db405d5 - - path: output/bwa/NC_010473.fa.bwt + - path: output/bwa/bwa/NC_010473.bwt md5sum: 7301b52e2ecb893d429a49fa692447ae - - path: output/bwa/NC_010473.fa.pac + - path: output/bwa/bwa/NC_010473.pac md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad - - path: output/bwa/NC_010473.fa.sa - md5sum: a47dcc92e750e2f16fbd979b8ff9538e \ No newline at end of file + - path: output/bwa/bwa/NC_010473.sa + md5sum: a47dcc92e750e2f16fbd979b8ff9538e diff --git a/tests/software/bwa/mem/test.yml b/tests/software/bwa/mem/test.yml index decf2e44..b4c2f4f8 100644 --- a/tests/software/bwa/mem/test.yml +++ b/tests/software/bwa/mem/test.yml @@ -6,7 +6,7 @@ - bwa_mem_single_end files: - path: output/bwa/test.bam - md5sum: 3ee21210bac387e0335008146e4728bc + md5sum: 52e81e5bd523d0b27fe533b21a0d80f5 - name: bwa mem paired-end command: nextflow run ./tests/software/bwa/mem -entry test_bwa_mem_paired_end -c tests/config/nextflow.config @@ -16,4 +16,4 @@ - bwa_mem_paired_end files: - path: output/bwa/test.bam - md5sum: 510d8acc6448c07cdacce8e64ec0904c + md5sum: 86d82fdb68ed384c656cfc62a253052f From 7536b386a598ae11a7235f60f0f054518cc867d3 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 9 Feb 2021 17:56:01 +0100 Subject: [PATCH 12/34] Correct channel declaration on bedtools_maskfasta --- tests/software/bedtools/maskfasta/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/software/bedtools/maskfasta/main.nf b/tests/software/bedtools/maskfasta/main.nf index 11901636..c0434879 100644 --- a/tests/software/bedtools/maskfasta/main.nf +++ b/tests/software/bedtools/maskfasta/main.nf @@ -5,7 +5,7 @@ nextflow.enable.dsl = 2 include { BEDTOOLS_MASKFASTA } from '../../../../software/bedtools/maskfasta/main.nf' addParams( options: [:] ) workflow test_bedtools_maskfasta { - def input,fasta = [] + def bed,fasta = [] bed = [ [ id:'test'], file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] From e118bc049a876bde3d003e01c275094c971225ea Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 9 Feb 2021 17:56:51 +0100 Subject: [PATCH 13/34] Add bedtools getfasta module --- .github/filters.yml | 4 ++ software/bedtools/getfasta/functions.nf | 59 +++++++++++++++++++++++ software/bedtools/getfasta/main.nf | 42 ++++++++++++++++ software/bedtools/getfasta/meta.yml | 54 +++++++++++++++++++++ tests/software/bedtools/getfasta/main.nf | 13 +++++ tests/software/bedtools/getfasta/test.yml | 8 +++ 6 files changed, 180 insertions(+) create mode 100644 software/bedtools/getfasta/functions.nf create mode 100644 software/bedtools/getfasta/main.nf create mode 100644 software/bedtools/getfasta/meta.yml create mode 100644 tests/software/bedtools/getfasta/main.nf create mode 100644 tests/software/bedtools/getfasta/test.yml diff --git a/.github/filters.yml b/.github/filters.yml index c28e1dbc..a89a1b0a 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -34,6 +34,10 @@ bedtools_genomecov: - software/bedtools/genomecov/** - tests/software/bedtools/genomecov/** +bedtools_getfasta: + - software/bedtools/getfasta/** + - tests/software/bedtools/getfasta/** + bedtools_intersect: - software/bedtools/intersect/** - tests/software/bedtools/intersect/** diff --git a/software/bedtools/getfasta/functions.nf b/software/bedtools/getfasta/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/bedtools/getfasta/functions.nf @@ -0,0 +1,59 @@ +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/bedtools/getfasta/main.nf b/software/bedtools/getfasta/main.nf new file mode 100644 index 00000000..a0218ee7 --- /dev/null +++ b/software/bedtools/getfasta/main.nf @@ -0,0 +1,42 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BEDTOOLS_GETFASTA { + tag "$bed" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } + + conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" + } else { + container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" + } + + input: + path bed + path fasta + + output: + path "*.fa" , emit: fasta + path "*.version.txt", emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${bed.baseName}${options.suffix}" : "${bed.baseName}" + """ + bedtools \\ + getfasta \\ + $options.args \\ + -fi $fasta \\ + -bed $bed \\ + -fo ${prefix}.fa + + bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + """ +} diff --git a/software/bedtools/getfasta/meta.yml b/software/bedtools/getfasta/meta.yml new file mode 100644 index 00000000..692b7028 --- /dev/null +++ b/software/bedtools/getfasta/meta.yml @@ -0,0 +1,54 @@ +name: bedtools_getfasta +description: extract sequences in a FASTA file based on intervals defined in a feature file. +keywords: + - bed + - fasta + - getfasta +tools: + - bedtools: + description: | + A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. + documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html +params: + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. +input: + - bed: + type: file + description: Bed feature file + pattern: "*.{bed}" + - fasta: + type: file + description: Input fasta file + pattern: "*.{fa,fasta}" + +output: + - fasta: + type: file + description: Output fasta file with extracted sequences + pattern: "*.{fa}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/tests/software/bedtools/getfasta/main.nf b/tests/software/bedtools/getfasta/main.nf new file mode 100644 index 00000000..3e78a44a --- /dev/null +++ b/tests/software/bedtools/getfasta/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BEDTOOLS_GETFASTA } from '../../../../software/bedtools/getfasta/main.nf' addParams( options: [:] ) + +workflow test_bedtools_getfasta { + def bed,fasta = [] + bed = [ file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] + fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] + + BEDTOOLS_GETFASTA( bed, fasta ) +} diff --git a/tests/software/bedtools/getfasta/test.yml b/tests/software/bedtools/getfasta/test.yml new file mode 100644 index 00000000..c4b3ae77 --- /dev/null +++ b/tests/software/bedtools/getfasta/test.yml @@ -0,0 +1,8 @@ +- name: bedtools getfasta + command: nextflow run ./tests/software/bedtools/getfasta -entry test_bedtools_getfasta -c tests/config/nextflow.config + tags: + - bedtools + - bedtools_getfasta + files: + - path: output/bedtools/C.fa + md5sum: 2257190c8d9fc6f177a518440cf1f3f3 From aaa088dba88f8c58b2d14c6c4897861cdfcbf77a Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 9 Feb 2021 21:34:29 +0000 Subject: [PATCH 14/34] Update tests/software/bedtools/getfasta/main.nf --- tests/software/bedtools/getfasta/main.nf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/software/bedtools/getfasta/main.nf b/tests/software/bedtools/getfasta/main.nf index 3e78a44a..aba2f8e4 100644 --- a/tests/software/bedtools/getfasta/main.nf +++ b/tests/software/bedtools/getfasta/main.nf @@ -5,9 +5,8 @@ nextflow.enable.dsl = 2 include { BEDTOOLS_GETFASTA } from '../../../../software/bedtools/getfasta/main.nf' addParams( options: [:] ) workflow test_bedtools_getfasta { - def bed,fasta = [] - bed = [ file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] - fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] + def bed = [ file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] + def fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] - BEDTOOLS_GETFASTA( bed, fasta ) + BEDTOOLS_GETFASTA ( bed, fasta ) } From 3f431014a44116f3fe34b908456920610fecdffc Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 9 Feb 2021 21:34:40 +0000 Subject: [PATCH 15/34] Update software/bedtools/getfasta/main.nf --- software/bedtools/getfasta/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bedtools/getfasta/main.nf b/software/bedtools/getfasta/main.nf index a0218ee7..b60c04e9 100644 --- a/software/bedtools/getfasta/main.nf +++ b/software/bedtools/getfasta/main.nf @@ -11,7 +11,7 @@ process BEDTOOLS_GETFASTA { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) + conda (params.enable_conda ? "bioconda::bedtools=2.30.0=hc088bd4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" } else { From 28866f3dc714a85fb89e6359b05726f83c4feedb Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 9 Feb 2021 21:36:38 +0000 Subject: [PATCH 16/34] Update tests/software/bedtools/maskfasta/main.nf --- tests/software/bedtools/maskfasta/main.nf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/software/bedtools/maskfasta/main.nf b/tests/software/bedtools/maskfasta/main.nf index c0434879..c8f8797b 100644 --- a/tests/software/bedtools/maskfasta/main.nf +++ b/tests/software/bedtools/maskfasta/main.nf @@ -5,10 +5,9 @@ nextflow.enable.dsl = 2 include { BEDTOOLS_MASKFASTA } from '../../../../software/bedtools/maskfasta/main.nf' addParams( options: [:] ) workflow test_bedtools_maskfasta { - def bed,fasta = [] - bed = [ [ id:'test'], - file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] - fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] + def bed = [ [ id:'test'], + file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] + def fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] BEDTOOLS_MASKFASTA( bed, fasta ) } From 2fa14f2ec8e6fd341dc918ad68e6b862c75a189d Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 9 Feb 2021 23:00:19 +0100 Subject: [PATCH 17/34] Adding conda build to bcftools modules --- software/bcftools/bgzip/main.nf | 2 +- software/bcftools/filter/main.nf | 2 +- software/bcftools/isec/main.nf | 2 +- software/bcftools/stats/main.nf | 2 +- software/bcftools/tabix/main.nf | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/software/bcftools/bgzip/main.nf b/software/bcftools/bgzip/main.nf index cb29c2b2..3e6e72e6 100644 --- a/software/bcftools/bgzip/main.nf +++ b/software/bcftools/bgzip/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_BGZIP { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/filter/main.nf b/software/bcftools/filter/main.nf index c86166a5..3299def9 100644 --- a/software/bcftools/filter/main.nf +++ b/software/bcftools/filter/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_FILTER { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/isec/main.nf b/software/bcftools/isec/main.nf index e4d4962f..8f5a608f 100644 --- a/software/bcftools/isec/main.nf +++ b/software/bcftools/isec/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_ISEC { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/stats/main.nf b/software/bcftools/stats/main.nf index 4b1bfaf4..f0b81457 100644 --- a/software/bcftools/stats/main.nf +++ b/software/bcftools/stats/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_STATS { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/tabix/main.nf b/software/bcftools/tabix/main.nf index 3e5bba50..c1799bc3 100644 --- a/software/bcftools/tabix/main.nf +++ b/software/bcftools/tabix/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_TABIX { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { From e8dc199dc818ce73874b60ef064237c095905c01 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 9 Feb 2021 23:04:12 +0100 Subject: [PATCH 18/34] Adding conda build to blast modules --- software/blast/blastn/main.nf | 2 +- software/blast/makeblastdb/main.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/software/blast/blastn/main.nf b/software/blast/blastn/main.nf index ec02f609..5a021331 100644 --- a/software/blast/blastn/main.nf +++ b/software/blast/blastn/main.nf @@ -11,7 +11,7 @@ process BLAST_BLASTN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? 'bioconda::blast=2.10.1' : null) + conda (params.enable_conda ? 'bioconda::blast=2.10.1=pl526he19e7b1_3' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' } else { diff --git a/software/blast/makeblastdb/main.nf b/software/blast/makeblastdb/main.nf index c79b99da..f3f9cc25 100644 --- a/software/blast/makeblastdb/main.nf +++ b/software/blast/makeblastdb/main.nf @@ -11,7 +11,7 @@ process BLAST_MAKEBLASTDB { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? 'bioconda::blast=2.10.1' : null) + conda (params.enable_conda ? 'bioconda::blast=2.10.1=pl526he19e7b1_3' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' } else { From 0b33b6d0817513935b58e36a0d38f5510b508cf3 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:03:13 +0000 Subject: [PATCH 19/34] Add missing build ids --- software/bandage/image/main.nf | 2 +- software/bcftools/consensus/main.nf | 2 +- software/bedtools/maskfasta/main.nf | 2 +- software/gunzip/main.nf | 2 +- software/untar/main.nf | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/software/bandage/image/main.nf b/software/bandage/image/main.nf index 7f311746..57b5f23f 100644 --- a/software/bandage/image/main.nf +++ b/software/bandage/image/main.nf @@ -11,7 +11,7 @@ process BANDAGE_IMAGE { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? 'bioconda::bandage=0.8.1' : null) + conda (params.enable_conda ? 'bioconda::bandage=0.8.1=hc9558a2_2' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bandage:0.8.1--hc9558a2_2" } else { diff --git a/software/bcftools/consensus/main.nf b/software/bcftools/consensus/main.nf index c74d21d0..1e640542 100644 --- a/software/bcftools/consensus/main.nf +++ b/software/bcftools/consensus/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_CONSENSUS { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bedtools/maskfasta/main.nf b/software/bedtools/maskfasta/main.nf index ccd93df7..1051a80e 100644 --- a/software/bedtools/maskfasta/main.nf +++ b/software/bedtools/maskfasta/main.nf @@ -11,7 +11,7 @@ process BEDTOOLS_MASKFASTA { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) + conda (params.enable_conda ? "bioconda::bedtools=2.30.0=hc088bd4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" } else { diff --git a/software/gunzip/main.nf b/software/gunzip/main.nf index 20f6467d..b9647a4a 100644 --- a/software/gunzip/main.nf +++ b/software/gunzip/main.nf @@ -10,7 +10,7 @@ process GUNZIP { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" } else { diff --git a/software/untar/main.nf b/software/untar/main.nf index 8912fb0b..62596ef6 100644 --- a/software/untar/main.nf +++ b/software/untar/main.nf @@ -10,7 +10,7 @@ process UNTAR { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" } else { From d50d070c064a7d4913bd92bdc3772acb85700050 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:09:18 +0000 Subject: [PATCH 20/34] Change txt channel output --- software/bcftools/stats/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/bcftools/stats/main.nf b/software/bcftools/stats/main.nf index f0b81457..ffb9a468 100644 --- a/software/bcftools/stats/main.nf +++ b/software/bcftools/stats/main.nf @@ -21,8 +21,8 @@ process BCFTOOLS_STATS { tuple val(meta), path(vcf) output: - tuple val(meta), path("*.txt"), emit: stats - path "*.version.txt" , emit: version + tuple val(meta), path("*stats.txt"), emit: stats + path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) From 2b9129b3f9be9383280ad7621dafaeafde932ba9 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:09:22 +0000 Subject: [PATCH 21/34] Change txt channel output --- software/stringtie/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/stringtie/main.nf b/software/stringtie/main.nf index e624354b..1d69bb50 100644 --- a/software/stringtie/main.nf +++ b/software/stringtie/main.nf @@ -25,7 +25,7 @@ process STRINGTIE { output: tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf - tuple val(meta), path("*.txt") , emit: abundance + tuple val(meta), path("*.abundance.txt") , emit: abundance tuple val(meta), path("*.ballgown") , emit: ballgown path "*.version.txt" , emit: version @@ -45,7 +45,7 @@ process STRINGTIE { $strandedness \\ -G $gtf \\ -o ${prefix}.transcripts.gtf \\ - -A ${prefix}.gene_abundance.txt \\ + -A ${prefix}.gene.abundance.txt \\ -C ${prefix}.coverage.gtf \\ -b ${prefix}.ballgown \\ $options.args From 6795fe04b8fb946f31fc2071a8f8e6ee73c50ce0 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:26:18 +0000 Subject: [PATCH 22/34] Rename output channel --- software/pangolin/main.nf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/software/pangolin/main.nf b/software/pangolin/main.nf index ad1decb2..71c40aa8 100644 --- a/software/pangolin/main.nf +++ b/software/pangolin/main.nf @@ -11,19 +11,19 @@ process PANGOLIN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? 'bioconda::pangolin=2.1.7=py_0' : null) + conda (params.enable_conda ? 'bioconda::pangolin=2.2.1=py_0' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/pangolin:2.1.7--py_0' + container 'https://depot.galaxyproject.org/singularity/pangolin:2.2.1--py_0' } else { - container 'quay.io/biocontainers/pangolin:2.1.7--py_0' + container 'quay.io/biocontainers/pangolin:2.2.1--py_0' } input: tuple val(meta), path(fasta) output: - tuple val(meta), path('*.lineage_report.csv'), emit: report - path '*.version.txt' , emit: version + tuple val(meta), path('*.csv'), emit: report + path '*.version.txt' , emit: version script: def software = getSoftwareName(task.process) @@ -31,7 +31,7 @@ process PANGOLIN { """ pangolin \\ $fasta\\ - --outfile ${prefix}.lineage_report.csv \\ + --outfile ${prefix}.pangolin.csv \\ $options.args pangolin --version | sed "s/pangolin //g" > ${software}.version.txt From b03846600d80571f9383f60d1e17d2248ca8a52c Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:26:45 +0000 Subject: [PATCH 23/34] Tidy up --- software/pangolin/meta.yml | 95 ++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/software/pangolin/meta.yml b/software/pangolin/meta.yml index 51fcca63..82e157d9 100644 --- a/software/pangolin/meta.yml +++ b/software/pangolin/meta.yml @@ -1,57 +1,54 @@ name: pangolin description: Phylogenetic Assignment of Named Global Outbreak LINeages keywords: - - covid - - pangolin - - lineage + - covid + - pangolin + - lineage tools: - - star: - description: | - Phylogenetic Assignment of Named Global Outbreak LINeages - homepage: https://github.com/cov-lineages/pangolin#pangolearn-description - manual: https://github.com/cov-lineages/pangolin#pangolearn-description + - star: + description: | + Phylogenetic Assignment of Named Global Outbreak LINeages + homepage: https://github.com/cov-lineages/pangolin#pangolearn-description + manual: https://github.com/cov-lineages/pangolin#pangolearn-description params: - - outdir: - type: string - description: | - The pipeline's output directory. By default, the module will - output files into `$params.outdir/` - - publish_dir_mode: - type: string - description: | - Value for the Nextflow `publishDir` mode parameter. - Available: symlink, rellink, link, copy, copyNoFollow, move. - - enable_conda: - type: boolean - description: | - Run the module with Conda using the software specified - via the `conda` directive - - singularity_pull_docker_container: - type: boolean - description: | - Instead of directly downloading Singularity images for use with Singularity, - force the workflow to pull and convert Docker containers instead. - + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. input: - - meta: - type: map - description: | - Groovy Map containing sample information - - fasta: - type: file - description: | - The genome assembly to be evaluated - + - meta: + type: map + description: | + Groovy Map containing sample information + - fasta: + type: file + description: | + The genome assembly to be evaluated output: - - report: - type: file - description: The lineage report - pattern: "{prefix}.lineage_report.csv" - - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" - + - report: + type: file + description: Pangolin lineage report + pattern: "*.{csv}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" authors: - - "@kevinmenden" + - "@kevinmenden" + - "@drpatelh" From 7f629bca45b6df01f1f63098583fd8543f717621 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:26:55 +0000 Subject: [PATCH 24/34] OCDness --- tests/software/pangolin/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/software/pangolin/main.nf b/tests/software/pangolin/main.nf index 455c1996..b407398f 100644 --- a/tests/software/pangolin/main.nf +++ b/tests/software/pangolin/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { PANGOLIN } from '../../../software/pangolin/main.nf' addParams(options: [:]) +include { PANGOLIN } from '../../../software/pangolin/main.nf' addParams( options: [:] ) workflow test_pangolin { input = [ [ id:'test' ], // meta map [ file("${launchDir}/tests/data/fasta/sarscov2/GCA_011545545.1_ASM1154554v1_genomic.fna", checkIfExists: true) ] ] - PANGOLIN( input ) + PANGOLIN ( input ) } From 79d730f2c383549b5320717f12801688fa39decf Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:27:08 +0000 Subject: [PATCH 25/34] Change output name --- tests/software/pangolin/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/software/pangolin/test.yml b/tests/software/pangolin/test.yml index c50b4245..e7971a1f 100644 --- a/tests/software/pangolin/test.yml +++ b/tests/software/pangolin/test.yml @@ -3,5 +3,5 @@ tags: - pangolin files: - - path: ./output/pangolin/test.lineage_report.csv + - path: ./output/pangolin/test.pangolin.csv md5sum: a7423586a536a58f14fb4553f92b225e From 1d00a4a11c5fba6fdec9c7028ee0fa39155907b0 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Tue, 9 Feb 2021 23:31:39 +0000 Subject: [PATCH 26/34] Update md5sum --- tests/software/pangolin/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/software/pangolin/test.yml b/tests/software/pangolin/test.yml index e7971a1f..198ede93 100644 --- a/tests/software/pangolin/test.yml +++ b/tests/software/pangolin/test.yml @@ -4,4 +4,4 @@ - pangolin files: - path: ./output/pangolin/test.pangolin.csv - md5sum: a7423586a536a58f14fb4553f92b225e + md5sum: 097669de1843e27f4529d6db8bbed97b From e63279e6a25ef3ba916aec9a82b3b06378fa1d7e Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 10 Feb 2021 10:28:27 +0000 Subject: [PATCH 27/34] Pin pangoLearn version --- software/pangolin/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/pangolin/main.nf b/software/pangolin/main.nf index 71c40aa8..02d53551 100644 --- a/software/pangolin/main.nf +++ b/software/pangolin/main.nf @@ -11,7 +11,7 @@ process PANGOLIN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? 'bioconda::pangolin=2.2.1=py_0' : null) + conda (params.enable_conda ? 'bioconda::pangolin=2.2.1=py_0 bioconda::pangolearn=2021.02.05=pyh3252c3a_0' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container 'https://depot.galaxyproject.org/singularity/pangolin:2.2.1--py_0' } else { From d2508e3c0308ff601aa30b5f21d3a2e1eac85d75 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 10 Feb 2021 12:51:47 +0000 Subject: [PATCH 28/34] Amend prefix for bcftools stats --- software/bcftools/stats/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bcftools/stats/meta.yml b/software/bcftools/stats/meta.yml index fd8319e6..24ee2e36 100644 --- a/software/bcftools/stats/meta.yml +++ b/software/bcftools/stats/meta.yml @@ -52,7 +52,7 @@ output: - stats: type: file description: Text output file containing stats - pattern: "*.{txt}" + pattern: "*.{stats.txt}" - version: type: file description: File containing software version From b9afca2b057f431a59bf05afa525b165cc309e0c Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 10 Feb 2021 12:53:17 +0000 Subject: [PATCH 29/34] Underscore not . --- software/bcftools/stats/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bcftools/stats/meta.yml b/software/bcftools/stats/meta.yml index 24ee2e36..75ed50f4 100644 --- a/software/bcftools/stats/meta.yml +++ b/software/bcftools/stats/meta.yml @@ -52,7 +52,7 @@ output: - stats: type: file description: Text output file containing stats - pattern: "*.{stats.txt}" + pattern: "*_{stats.txt}" - version: type: file description: File containing software version From 6e8b63fc263741b32a61dfb244e03e4b6c8dbd5f Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 12 Feb 2021 17:22:07 +0100 Subject: [PATCH 30/34] Add cat fastq module --- .github/filters.yml | 4 +++ software/cat/fastq/functions.nf | 59 +++++++++++++++++++++++++++++++ software/cat/fastq/main.nf | 46 ++++++++++++++++++++++++ software/cat/fastq/meta.yml | 55 ++++++++++++++++++++++++++++ tests/software/cat/fastq/main.nf | 27 ++++++++++++++ tests/software/cat/fastq/test.yml | 21 +++++++++++ 6 files changed, 212 insertions(+) create mode 100644 software/cat/fastq/functions.nf create mode 100644 software/cat/fastq/main.nf create mode 100644 software/cat/fastq/meta.yml create mode 100644 tests/software/cat/fastq/main.nf create mode 100644 tests/software/cat/fastq/test.yml diff --git a/.github/filters.yml b/.github/filters.yml index 74156e9d..f63a162d 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -92,6 +92,10 @@ bwa_mem: - software/bwa/mem/** - tests/software/bwa/mem/** +cat_fastq: + - software/cat/fastq/** + - tests/software/cat/fastq/** + cutadapt: - software/cutadapt/** - tests/software/cutadapt/** diff --git a/software/cat/fastq/functions.nf b/software/cat/fastq/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/cat/fastq/functions.nf @@ -0,0 +1,59 @@ +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/cat/fastq/main.nf b/software/cat/fastq/main.nf new file mode 100644 index 00000000..44a06bb8 --- /dev/null +++ b/software/cat/fastq/main.nf @@ -0,0 +1,46 @@ +// Import generic module functions +include { initOptions; saveFiles } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process CAT_FASTQ { + tag "$meta.id" + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'merged_fastq', publish_id:meta.id) } + + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" + } else { + container "biocontainers/biocontainers:v1.2.0_cv1" + } + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.merged.fastq.gz"), emit: reads + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def readList = reads.collect{ it.toString() } + if (meta.single_end) { + if (readList.size > 1) { + """ + cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz + """ + } + } else { + if (readList.size > 2) { + def read1 = [] + def read2 = [] + readList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v } + """ + cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz + cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz + """ + } + } +} diff --git a/software/cat/fastq/meta.yml b/software/cat/fastq/meta.yml new file mode 100644 index 00000000..eda6dff7 --- /dev/null +++ b/software/cat/fastq/meta.yml @@ -0,0 +1,55 @@ +name: cat_fastq +description: Concatenates fastq files +keywords: + - fastq + - concatenate +tools: + - cat: + description: | + The cat utility reads files sequentially, writing them to the standard output. + documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html +params: + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. +input: + input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: list + description: | + List of input FastQ files to be concatenated. +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Merged fastq file + pattern: "*.{merged.fastq.gz}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/tests/software/cat/fastq/main.nf b/tests/software/cat/fastq/main.nf new file mode 100644 index 00000000..24d203c1 --- /dev/null +++ b/tests/software/cat/fastq/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CAT_FASTQ } from '../../../../software/cat/fastq/main.nf' addParams( options: [:] ) + +workflow test_cat_fastq_single_end { + + def input = [] + input = [ [ id:'test', single_end:true ], // meta map + [ file("${launchDir}/tests/data/fastq/rna/test_R1_val_1.fq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true) ]] + + CAT_FASTQ ( input ) +} + +workflow test_cat_fastq_paired_end { + + def input = [] + input = [ [ id:'test', single_end:false ], // meta map + [ file("${launchDir}/tests/data/fastq/rna/test_R1_val_1.fq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R2_val_2.fq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R2.fastq.gz", checkIfExists: true) ]] + + CAT_FASTQ ( input ) +} diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml new file mode 100644 index 00000000..90e37084 --- /dev/null +++ b/tests/software/cat/fastq/test.yml @@ -0,0 +1,21 @@ +- name: cat fastq single-end + command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config + tags: + - cat + - fastq + - cat_fastqc_single_end + files: + - path: output/merged_fastq/test.merged.fastq.gz + md5sum: 7f753b793e5b0872758b1574db84d767 + +- name: cat fastq fastqc_paired_end + command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config + tags: + - cat + - fastq + - cat_fastqc_paired_end + files: + - path: output/merged_fastq/test_1.merged.fastq.gz + md5sum: 7f753b793e5b0872758b1574db84d767 + - path: output/merged_fastq/test_2.merged.fastq.gz + md5sum: c71ff917e002b1e852916a021d52921d From d7a219e88d49285d01d524ae3b63ffefffb2ff77 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 12 Feb 2021 17:37:49 +0100 Subject: [PATCH 31/34] Fix test.yml --- tests/software/cat/fastq/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml index 90e37084..4c9a72fd 100644 --- a/tests/software/cat/fastq/test.yml +++ b/tests/software/cat/fastq/test.yml @@ -1,18 +1,14 @@ - name: cat fastq single-end command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config tags: - - cat - - fastq - cat_fastqc_single_end files: - path: output/merged_fastq/test.merged.fastq.gz md5sum: 7f753b793e5b0872758b1574db84d767 -- name: cat fastq fastqc_paired_end +- name: cat fastq paired-end command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config tags: - - cat - - fastq - cat_fastqc_paired_end files: - path: output/merged_fastq/test_1.merged.fastq.gz From 8e23e1839dc01927a9af3d91ca558fb12ac5eee2 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 12 Feb 2021 17:56:51 +0100 Subject: [PATCH 32/34] Trying to fix tests --- software/cat/fastq/main.nf | 4 ++-- tests/software/cat/fastq/test.yml | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/software/cat/fastq/main.nf b/software/cat/fastq/main.nf index 44a06bb8..95db8d9a 100644 --- a/software/cat/fastq/main.nf +++ b/software/cat/fastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles } from './functions' +include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] def options = initOptions(params.options) @@ -8,7 +8,7 @@ process CAT_FASTQ { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'merged_fastq', publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml index 4c9a72fd..a3122372 100644 --- a/tests/software/cat/fastq/test.yml +++ b/tests/software/cat/fastq/test.yml @@ -1,17 +1,21 @@ - name: cat fastq single-end command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config tags: + - cat + - fastq - cat_fastqc_single_end files: - - path: output/merged_fastq/test.merged.fastq.gz + - path: output/cat/test.merged.fastq.gz md5sum: 7f753b793e5b0872758b1574db84d767 - name: cat fastq paired-end command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config tags: + - cat + - fastq - cat_fastqc_paired_end files: - - path: output/merged_fastq/test_1.merged.fastq.gz + - path: output/cat/test_1.merged.fastq.gz md5sum: 7f753b793e5b0872758b1574db84d767 - - path: output/merged_fastq/test_2.merged.fastq.gz + - path: output/cat/test_2.merged.fastq.gz md5sum: c71ff917e002b1e852916a021d52921d From 0688230863d3a45c9b107af40769ea0e064d69d2 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 12 Feb 2021 18:02:32 +0100 Subject: [PATCH 33/34] Revert since fixes to test were not working This reverts commit d7a219e88d49285d01d524ae3b63ffefffb2ff77. --- software/cat/fastq/main.nf | 4 ++-- tests/software/cat/fastq/test.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/software/cat/fastq/main.nf b/software/cat/fastq/main.nf index 95db8d9a..44a06bb8 100644 --- a/software/cat/fastq/main.nf +++ b/software/cat/fastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles } from './functions' params.options = [:] def options = initOptions(params.options) @@ -8,7 +8,7 @@ process CAT_FASTQ { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'merged_fastq', publish_id:meta.id) } conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml index a3122372..90e37084 100644 --- a/tests/software/cat/fastq/test.yml +++ b/tests/software/cat/fastq/test.yml @@ -5,17 +5,17 @@ - fastq - cat_fastqc_single_end files: - - path: output/cat/test.merged.fastq.gz + - path: output/merged_fastq/test.merged.fastq.gz md5sum: 7f753b793e5b0872758b1574db84d767 -- name: cat fastq paired-end +- name: cat fastq fastqc_paired_end command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config tags: - cat - fastq - cat_fastqc_paired_end files: - - path: output/cat/test_1.merged.fastq.gz + - path: output/merged_fastq/test_1.merged.fastq.gz md5sum: 7f753b793e5b0872758b1574db84d767 - - path: output/cat/test_2.merged.fastq.gz + - path: output/merged_fastq/test_2.merged.fastq.gz md5sum: c71ff917e002b1e852916a021d52921d From fafe068192f01293738d3f50db24aa58451c905d Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 12 Feb 2021 18:49:57 +0100 Subject: [PATCH 34/34] Fixing test tags --- tests/software/cat/fastq/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml index 90e37084..b2235b6c 100644 --- a/tests/software/cat/fastq/test.yml +++ b/tests/software/cat/fastq/test.yml @@ -2,7 +2,7 @@ command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config tags: - cat - - fastq + - cat_fastq - cat_fastqc_single_end files: - path: output/merged_fastq/test.merged.fastq.gz @@ -12,7 +12,7 @@ command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config tags: - cat - - fastq + - cat_fastq - cat_fastqc_paired_end files: - path: output/merged_fastq/test_1.merged.fastq.gz