From 14525ed50d59fcca905ae648df53c9f20d4017df Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 14 Oct 2020 18:29:50 +0100 Subject: [PATCH 1/6] Remove functions file --- software/fastqc/main.nf | 27 +++++----- software/gffread/main.nf | 21 ++++---- software/hisat2/align/main.nf | 25 +++++---- software/hisat2/build/main.nf | 19 ++++--- software/hisat2/extractsplicesites/main.nf | 15 +++--- software/macs2/functions.nf | 59 ---------------------- software/preseq/lcextrap/main.nf | 23 +++++---- software/qualimap/rnaseq/main.nf | 23 +++++---- software/rsem/calculateexpression/main.nf | 23 +++++---- software/rsem/preparereference/main.nf | 21 ++++---- software/rseqc/bamstat/main.nf | 25 +++++---- software/rseqc/inferexperiment/main.nf | 25 +++++---- software/rseqc/innerdistance/main.nf | 23 +++++---- software/rseqc/junctionannotation/main.nf | 23 +++++---- software/rseqc/junctionsaturation/main.nf | 23 +++++---- software/rseqc/readdistribution/main.nf | 21 ++++---- software/rseqc/readduplication/main.nf | 23 +++++---- software/salmon/index/main.nf | 21 ++++---- software/salmon/quant/main.nf | 23 +++++---- software/samtools/flagstat/main.nf | 19 ++++--- software/samtools/idxstats/main.nf | 19 ++++--- software/samtools/index/main.nf | 19 ++++--- software/samtools/sort/main.nf | 23 +++++---- software/samtools/stats/main.nf | 19 ++++--- software/sortmerna/main.nf | 25 +++++---- software/star/align/main.nf | 25 +++++---- software/star/genomegenerate/main.nf | 21 ++++---- software/stringtie/main.nf | 24 +++++---- software/subread/featurecounts/main.nf | 24 +++++---- software/trimgalore/main.nf | 23 +++++---- software/umitools/dedup/main.nf | 23 +++++---- software/umitools/extract/main.nf | 23 +++++---- 32 files changed, 393 insertions(+), 357 deletions(-) delete mode 100644 software/macs2/functions.nf diff --git a/software/fastqc/main.nf b/software/fastqc/main.nf index ed5cc561..64ea7b19 100644 --- a/software/fastqc/main.nf +++ b/software/fastqc/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process FASTQC { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - - container "quay.io/biocontainers/fastqc:0.11.9--0" - //container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0" - - conda (params.conda ? "bioconda::fastqc=0.11.9" : null) + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + conda (params.enable_conda ? "bioconda::fastqc=0.11.9" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0" + } else { + container "quay.io/biocontainers/fastqc:0.11.9--0" + } + input: tuple val(meta), path(reads) - val options - + output: tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.zip") , emit: zip @@ -25,19 +29,18 @@ process FASTQC { script: // Add soft-links to original FastQs for consistent naming in pipeline def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}.${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz - fastqc $ioptions.args --threads $task.cpus ${prefix}.fastq.gz + fastqc $options.args --threads $task.cpus ${prefix}.fastq.gz fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt """ } else { """ [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz - fastqc $ioptions.args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz + fastqc $options.args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt """ } diff --git a/software/gffread/main.nf b/software/gffread/main.nf index 14d27e50..c364ba5d 100644 --- a/software/gffread/main.nf +++ b/software/gffread/main.nf @@ -1,30 +1,33 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process GFFREAD { tag "$gff" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "quay.io/biocontainers/gffread:0.12.1--h8b12597_0" - //container https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0 - - conda (params.conda ? "bioconda::gffread=0.12.1" : null) + conda (params.enable_conda ? "bioconda::gffread=0.12.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0" + } else { + container "quay.io/biocontainers/gffread:0.12.1--h8b12597_0" + } input: path gff - val options - + output: path "*.gtf" , emit: gtf path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) """ - gffread $gff $ioptions.args -o ${gff.baseName}.gtf + gffread $gff $options.args -o ${gff.baseName}.gtf echo \$(gffread --version 2>&1) > ${software}.version.txt """ } diff --git a/software/hisat2/align/main.nf b/software/hisat2/align/main.nf index 4ad0987e..374fcef1 100644 --- a/software/hisat2/align/main.nf +++ b/software/hisat2/align/main.nf @@ -1,6 +1,9 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + def VERSION = '2.2.0' process HISAT2_ALIGN { @@ -8,19 +11,20 @@ process HISAT2_ALIGN { label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" - //container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" - - conda (params.conda ? "bioconda::hisat2=2.2.0 bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::hisat2=2.2.0 bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" + } else { + container "quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" + } input: tuple val(meta), path(reads) path index path splicesites - val options - + output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.log"), emit: summary @@ -30,8 +34,7 @@ process HISAT2_ALIGN { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -53,7 +56,7 @@ process HISAT2_ALIGN { --threads $task.cpus \\ $seq_center \\ $unaligned \\ - $ioptions.args \\ + $options.args \\ | samtools view -bS -F 4 -F 256 - > ${prefix}.bam echo $VERSION > ${software}.version.txt @@ -74,7 +77,7 @@ process HISAT2_ALIGN { $unaligned \\ --no-mixed \\ --no-discordant \\ - $ioptions.args \\ + $options.args \\ | samtools view -bS -F 4 -F 8 -F 256 - > ${prefix}.bam if [ -f ${prefix}.unmapped.fastq.1.gz ]; then diff --git a/software/hisat2/build/main.nf b/software/hisat2/build/main.nf index a6c47cba..4654d5f8 100644 --- a/software/hisat2/build/main.nf +++ b/software/hisat2/build/main.nf @@ -1,24 +1,28 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + def VERSION = '2.2.0' process HISAT2_BUILD { tag "$fasta" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" - //container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" - - conda (params.conda ? "bioconda::hisat2=2.2.0" : null) + conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" + } else { + container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" + } input: path fasta path gtf path splicesites - val options output: path "hisat2", emit: index @@ -47,7 +51,6 @@ process HISAT2_BUILD { } def software = getSoftwareName(task.process) - def ioptions = initOptions(options) """ mkdir hisat2 $extract_exons @@ -55,7 +58,7 @@ process HISAT2_BUILD { -p $task.cpus \\ $ss \\ $exon \\ - $ioptions.args \\ + $options.args \\ $fasta \\ hisat2/${fasta.baseName} diff --git a/software/hisat2/extractsplicesites/main.nf b/software/hisat2/extractsplicesites/main.nf index 71aec5bc..f3278b41 100644 --- a/software/hisat2/extractsplicesites/main.nf +++ b/software/hisat2/extractsplicesites/main.nf @@ -1,22 +1,25 @@ // Import generic module functions include { saveFiles; getSoftwareName } from './functions' +params.options = [:] + def VERSION = '2.2.0' process HISAT2_EXTRACTSPLICESITES { tag "$gtf" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" - //container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" - - conda (params.conda ? "bioconda::hisat2=2.2.0" : null) + conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" + } else { + container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" + } input: path gtf - val options output: path "*.splice_sites.txt", emit: txt diff --git a/software/macs2/functions.nf b/software/macs2/functions.nf deleted file mode 100644 index b3ac3801..00000000 --- a/software/macs2/functions.nf +++ /dev/null @@ -1,59 +0,0 @@ -/* - * ----------------------------------------------------- - * 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/preseq/lcextrap/main.nf b/software/preseq/lcextrap/main.nf index 7526ee4a..bb7de662 100644 --- a/software/preseq/lcextrap/main.nf +++ b/software/preseq/lcextrap/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process PRESEQ_LCEXTRAP { tag "$meta.id" label 'process_medium' label 'error_ignore' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/preseq:2.0.3--hf53bd2b_3" - //container "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3" - - conda (params.conda ? "bioconda::preseq=2.0.3" : null) + conda (params.enable_conda ? "bioconda::preseq=2.0.3" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3" + } else { + container "quay.io/biocontainers/preseq:2.0.3--hf53bd2b_3" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.ccurve.txt"), emit: ccurve tuple val(meta), path("*.log") , emit: log @@ -25,13 +29,12 @@ process PRESEQ_LCEXTRAP { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' """ preseq \\ lc_extrap \\ - $ioptions.args \\ + $options.args \\ $paired_end \\ -output ${prefix}.ccurve.txt \\ $bam diff --git a/software/qualimap/rnaseq/main.nf b/software/qualimap/rnaseq/main.nf index df0a7b87..7575140f 100644 --- a/software/qualimap/rnaseq/main.nf +++ b/software/qualimap/rnaseq/main.nf @@ -1,31 +1,34 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process QUALIMAP_RNASEQ { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/qualimap:2.2.2d--1" - //container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1" - - conda (params.conda ? "bioconda::qualimap=2.2.2d" : null) + conda (params.enable_conda ? "bioconda::qualimap=2.2.2d" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1" + } else { + container "quay.io/biocontainers/qualimap:2.2.2d--1" + } input: tuple val(meta), path(bam) path gtf - val options - + output: tuple val(meta), path("${prefix}"), emit: results path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' def memory = task.memory.toGiga() + "G" @@ -42,7 +45,7 @@ process QUALIMAP_RNASEQ { qualimap \\ --java-mem-size=$memory \\ rnaseq \\ - $ioptions.args \\ + $options.args \\ -bam $bam \\ -gtf $gtf \\ -p $strandedness \\ diff --git a/software/rsem/calculateexpression/main.nf b/software/rsem/calculateexpression/main.nf index de73f53a..b5fdb336 100644 --- a/software/rsem/calculateexpression/main.nf +++ b/software/rsem/calculateexpression/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEM_CALCULATEEXPRESSION { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - //container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - - conda (params.conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" + } else { + container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" + } input: tuple val(meta), path(reads) path index - val options - + output: tuple val(meta), path("*.genes.results") , emit: counts_gene tuple val(meta), path("*.isoforms.results"), emit: counts_transcript @@ -31,8 +35,7 @@ process RSEM_CALCULATEEXPRESSION { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -48,7 +51,7 @@ process RSEM_CALCULATEEXPRESSION { --temporary-folder ./tmp/ \\ $strandedness \\ $paired_end \\ - $ioptions.args \\ + $options.args \\ $reads \\ \$INDEX \\ $prefix diff --git a/software/rsem/preparereference/main.nf b/software/rsem/preparereference/main.nf index 3dbc2391..5a41728c 100644 --- a/software/rsem/preparereference/main.nf +++ b/software/rsem/preparereference/main.nf @@ -1,36 +1,39 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEM_PREPAREREFERENCE { tag "$fasta" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - //container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - - conda (params.conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" + } else { + container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" + } input: path fasta path gtf - val options - + output: path "rsem" , emit: index path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) """ mkdir rsem rsem-prepare-reference \\ --gtf $gtf \\ --num-threads $task.cpus \\ - $ioptions.args \\ + $options.args \\ $fasta \\ rsem/genome diff --git a/software/rseqc/bamstat/main.nf b/software/rseqc/bamstat/main.nf index 037e28b6..dfc1614d 100644 --- a/software/rseqc/bamstat/main.nf +++ b/software/rseqc/bamstat/main.nf @@ -1,34 +1,37 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_BAMSTAT { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.bam_stat.txt"), emit: txt path "*.version.txt" , emit: version script: - def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bam_stat.py \\ -i $bam \\ - $ioptions.args \\ + $options.args \\ > ${prefix}.bam_stat.txt bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt diff --git a/software/rseqc/inferexperiment/main.nf b/software/rseqc/inferexperiment/main.nf index d81d7819..65583fcf 100644 --- a/software/rseqc/inferexperiment/main.nf +++ b/software/rseqc/inferexperiment/main.nf @@ -1,36 +1,39 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_INFEREXPERIMENT { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) path bed - val options - + output: tuple val(meta), path("*.infer_experiment.txt"), emit: txt path "*.version.txt" , emit: version script: - def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ infer_experiment.py \\ -i $bam \\ -r $bed \\ - $ioptions.args \\ + $options.args \\ > ${prefix}.infer_experiment.txt infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt diff --git a/software/rseqc/innerdistance/main.nf b/software/rseqc/innerdistance/main.nf index 9d76253c..4d064d57 100644 --- a/software/rseqc/innerdistance/main.nf +++ b/software/rseqc/innerdistance/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_INNERDISTANCE { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) path bed - val options - + output: tuple val(meta), path("*distance.txt"), optional:true, emit: distance tuple val(meta), path("*freq.txt") , optional:true, emit: freq @@ -28,15 +32,14 @@ process RSEQC_INNERDISTANCE { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (!meta.single_end) { """ inner_distance.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $ioptions.args \\ + $options.args \\ > stdout.txt head -n 2 stdout.txt > ${prefix}.inner_distance_mean.txt diff --git a/software/rseqc/junctionannotation/main.nf b/software/rseqc/junctionannotation/main.nf index d446a991..ed1ae8c6 100644 --- a/software/rseqc/junctionannotation/main.nf +++ b/software/rseqc/junctionannotation/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_JUNCTIONANNOTATION { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) path bed - val options - + output: tuple val(meta), path("*.junction.bed"), emit: bed tuple val(meta), path("*.Interact.bed"), emit: interact_bed @@ -30,14 +34,13 @@ process RSEQC_JUNCTIONANNOTATION { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ junction_annotation.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $ioptions.args \\ + $options.args \\ 2> ${prefix}.junction_annotation.log junction_annotation.py --version | sed -e "s/junction_annotation.py //g" > ${software}.version.txt diff --git a/software/rseqc/junctionsaturation/main.nf b/software/rseqc/junctionsaturation/main.nf index 4a7b2af6..aa797633 100644 --- a/software/rseqc/junctionsaturation/main.nf +++ b/software/rseqc/junctionsaturation/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_JUNCTIONSATURATION { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) path bed - val options - + output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.r") , emit: rscript @@ -25,14 +29,13 @@ process RSEQC_JUNCTIONSATURATION { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ junction_saturation.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $ioptions.args + $options.args junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt """ diff --git a/software/rseqc/readdistribution/main.nf b/software/rseqc/readdistribution/main.nf index 87b2f888..f04cabbb 100644 --- a/software/rseqc/readdistribution/main.nf +++ b/software/rseqc/readdistribution/main.nf @@ -1,31 +1,34 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_READDISTRIBUTION { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) path bed - val options - + output: tuple val(meta), path("*.read_distribution.txt"), emit: txt path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ read_distribution.py \\ -i $bam \\ diff --git a/software/rseqc/readduplication/main.nf b/software/rseqc/readduplication/main.nf index b2aa8464..4a9d17aa 100644 --- a/software/rseqc/readduplication/main.nf +++ b/software/rseqc/readduplication/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process RSEQC_READDUPLICATION { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::rseqc=3.0.1" : null) + conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*seq.DupRate.xls"), emit: seq_xls tuple val(meta), path("*pos.DupRate.xls"), emit: pos_xls @@ -26,13 +30,12 @@ process RSEQC_READDUPLICATION { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ read_duplication.py \\ -i $bam \\ -o $prefix \\ - $ioptions.args + $options.args read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt """ diff --git a/software/salmon/index/main.nf b/software/salmon/index/main.nf index 934f3536..b9a4c51b 100644 --- a/software/salmon/index/main.nf +++ b/software/salmon/index/main.nf @@ -1,35 +1,38 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process SALMON_INDEX { tag "$fasta" label "process_medium" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0" - //container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0" - - conda (params.conda ? "bioconda::salmon=1.3.0" : null) + conda (params.enable_conda ? "bioconda::salmon=1.3.0" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0" + } else { + container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0" + } input: path fasta - val options output: path "salmon" , emit: index path "*.version.txt", emit: version script: - def software = getSoftwareName(task.process) - def ioptions = initOptions(options) + def software = getSoftwareName(task.process) """ salmon \\ index \\ --threads $task.cpus \\ -t $fasta \\ - $ioptions.args \\ + $options.args \\ -i salmon salmon --version | sed -e "s/salmon //g" > ${software}.version.txt """ diff --git a/software/salmon/quant/main.nf b/software/salmon/quant/main.nf index a333342b..eb2a373a 100644 --- a/software/salmon/quant/main.nf +++ b/software/salmon/quant/main.nf @@ -1,32 +1,35 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process SALMON_QUANT { tag "$meta.id" label "process_medium" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0" - //container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0" - - conda (params.conda ? "bioconda::salmon=1.3.0" : null) + conda (params.enable_conda ? "bioconda::salmon=1.3.0" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0" + } else { + container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0" + } input: tuple val(meta), path(reads) path index path gtf - val options - + output: tuple val(meta), path("${prefix}"), emit: results path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}" def strandedness = meta.single_end ? 'U' : 'IU' @@ -42,7 +45,7 @@ process SALMON_QUANT { --libType=$strandedness \\ --index $index \\ $endedness \\ - $ioptions.args \\ + $options.args \\ -o $prefix salmon --version | sed -e "s/salmon //g" > ${software}.version.txt diff --git a/software/samtools/flagstat/main.nf b/software/samtools/flagstat/main.nf index a497c9ab..00992c60 100644 --- a/software/samtools/flagstat/main.nf +++ b/software/samtools/flagstat/main.nf @@ -1,21 +1,24 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { saveFiles; getSoftwareName } from './functions' + +params.options = [:] process SAMTOOLS_FLAGSTAT { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - //container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" - - conda (params.conda ? "bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: tuple val(meta), path(bam), path(bai) - val options - + output: tuple val(meta), path("*.flagstat"), emit: flagstat path "*.version.txt" , emit: version diff --git a/software/samtools/idxstats/main.nf b/software/samtools/idxstats/main.nf index baf3a9b8..75ae493f 100644 --- a/software/samtools/idxstats/main.nf +++ b/software/samtools/idxstats/main.nf @@ -1,21 +1,24 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { saveFiles; getSoftwareName } from './functions' + +params.options = [:] process SAMTOOLS_IDXSTATS { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - //container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" - - conda (params.conda ? "bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: tuple val(meta), path(bam), path(bai) - val options - + output: tuple val(meta), path("*.idxstats"), emit: idxstats path "*.version.txt" , emit: version diff --git a/software/samtools/index/main.nf b/software/samtools/index/main.nf index 24dcaaee..09a24f25 100644 --- a/software/samtools/index/main.nf +++ b/software/samtools/index/main.nf @@ -1,21 +1,24 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { saveFiles; getSoftwareName } from './functions' + +params.options = [:] process SAMTOOLS_INDEX { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - //container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" - - conda (params.conda ? "bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.bai"), emit: bai path "*.version.txt" , emit: version diff --git a/software/samtools/sort/main.nf b/software/samtools/sort/main.nf index fc36d984..17f0df57 100644 --- a/software/samtools/sort/main.nf +++ b/software/samtools/sort/main.nf @@ -1,32 +1,35 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process SAMTOOLS_SORT { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - //container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" - - conda (params.conda ? "bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.bam"), emit: bam path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ - samtools sort $ioptions.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam + samtools sort $options.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt """ } diff --git a/software/samtools/stats/main.nf b/software/samtools/stats/main.nf index 23bfc96b..c368b4f6 100644 --- a/software/samtools/stats/main.nf +++ b/software/samtools/stats/main.nf @@ -1,21 +1,24 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { saveFiles; getSoftwareName } from './functions' + +params.options = [:] process SAMTOOLS_STATS { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - //container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" - - conda (params.conda ? "bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: tuple val(meta), path(bam), path(bai) - val options - + output: tuple val(meta), path("*.stats"), emit: stats path "*.version.txt" , emit: version diff --git a/software/sortmerna/main.nf b/software/sortmerna/main.nf index 204e66e6..c0839761 100644 --- a/software/sortmerna/main.nf +++ b/software/sortmerna/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process SORTMERNA { tag "$meta.id" label "process_high" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/sortmerna:4.2.0--0" - //container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0" - - conda (params.conda ? "bioconda::sortmerna=4.2.0" : null) + conda (params.enable_conda ? "bioconda::sortmerna=4.2.0" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0" + } else { + container "quay.io/biocontainers/sortmerna:4.2.0--0" + } input: tuple val(meta), path(reads) path fasta - val options - + output: tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.log") , emit: log @@ -25,8 +29,7 @@ process SORTMERNA { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def Refs = "" for (i=0; i ${prefix}.fastq.gz mv rRNA_reads.log ${prefix}.sortmerna.log @@ -58,7 +61,7 @@ process SORTMERNA { --other non_rRNA_reads \\ --paired_in \\ --out2 \\ - $ioptions.args + $options.args gzip -f < non_rRNA_reads_fwd.fq > ${prefix}_1.fastq.gz gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz diff --git a/software/star/align/main.nf b/software/star/align/main.nf index f75c6bce..9b58e53c 100644 --- a/software/star/align/main.nf +++ b/software/star/align/main.nf @@ -1,25 +1,29 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process STAR_ALIGN { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - // Don't upgrade me - 2.7X indices incompatible with iGenomes. - container "quay.io/biocontainers/star:2.6.1d--0" - //container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0" - - conda (params.conda ? "bioconda::star=2.6.1d" : null) + // Note: 2.7X indices incompatible with AWS iGenomes. + conda (params.enable_conda ? "bioconda::star=2.6.1d" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0" + } else { + container "quay.io/biocontainers/star:2.6.1d--0" + } input: tuple val(meta), path(reads) path index path gtf - val options - + output: tuple val(meta), path("*Aligned.out.bam") , emit: bam tuple val(meta), path("*Log.final.out") , emit: log_final @@ -34,8 +38,7 @@ process STAR_ALIGN { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def ignore_gtf = params.star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" def seq_center = params.seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$params.seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'" """ @@ -46,7 +49,7 @@ process STAR_ALIGN { --outFileNamePrefix $prefix. \\ $ignore_gtf \\ $seq_center \\ - $ioptions.args + $options.args if [ -f ${prefix}.Unmapped.out.mate1 ]; then mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq diff --git a/software/star/genomegenerate/main.nf b/software/star/genomegenerate/main.nf index 1e179711..6f976273 100644 --- a/software/star/genomegenerate/main.nf +++ b/software/star/genomegenerate/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process STAR_GENOMEGENERATE { tag "$fasta" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - // Don't upgrade me - 2.7X indices incompatible with iGenomes. - container "quay.io/biocontainers/star:2.6.1d--0" - //container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0" - - conda (params.conda ? "bioconda::star=2.6.1d" : null) + // Note: 2.7X indices incompatible with AWS iGenomes. + conda (params.enable_conda ? "bioconda::star=2.6.1d" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0" + } else { + container "quay.io/biocontainers/star:2.6.1d--0" + } input: path fasta path gtf - val options output: path "star" , emit: index @@ -25,7 +29,6 @@ process STAR_GENOMEGENERATE { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' """ mkdir star @@ -36,7 +39,7 @@ process STAR_GENOMEGENERATE { --sjdbGTFfile $gtf \\ --runThreadN $task.cpus \\ $memory \\ - $ioptions.args + $options.args STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt """ diff --git a/software/stringtie/main.nf b/software/stringtie/main.nf index ab12fa66..fc3cbd49 100644 --- a/software/stringtie/main.nf +++ b/software/stringtie/main.nf @@ -1,23 +1,28 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process STRINGTIE { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0" - //container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0" - - conda (params.conda ? "bioconda::stringtie=2.1.4" : null) + // Note: 2.7X indices incompatible with AWS iGenomes. + conda (params.enable_conda ? "bioconda::stringtie=2.1.4" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0" + } else { + container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0" + } input: tuple val(meta), path(bam) path gtf - val options - + output: tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf @@ -27,8 +32,7 @@ process STRINGTIE { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -45,7 +49,7 @@ process STRINGTIE { -A ${prefix}.gene_abundance.txt \\ -C ${prefix}.coverage.gtf \\ -b ${prefix}.ballgown \\ - $ioptions.args + $options.args stringtie --version > ${software}.version.txt """ diff --git a/software/subread/featurecounts/main.nf b/software/subread/featurecounts/main.nf index f7285af8..936c2ccf 100644 --- a/software/subread/featurecounts/main.nf +++ b/software/subread/featurecounts/main.nf @@ -1,22 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process SUBREAD_FEATURECOUNTS { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/subread:2.0.1--hed695b0_0" - //container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0" - - conda (params.conda ? "bioconda::subread=2.0.1" : null) + // Note: 2.7X indices incompatible with AWS iGenomes. + conda (params.enable_conda ? "bioconda::subread=2.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0" + } else { + container "quay.io/biocontainers/subread:2.0.1--hed695b0_0" + } input: tuple val(meta), path(bams), path(annotation) - val options - + output: tuple val(meta), path("*featureCounts.txt") , emit: counts tuple val(meta), path("*featureCounts.txt.summary"), emit: summary @@ -24,8 +29,7 @@ process SUBREAD_FEATURECOUNTS { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-p' def strandedness = 0 @@ -36,7 +40,7 @@ process SUBREAD_FEATURECOUNTS { } """ featureCounts \\ - $ioptions.args \\ + $options.args \\ $paired_end \\ -T $task.cpus \\ -a $annotation \\ diff --git a/software/trimgalore/main.nf b/software/trimgalore/main.nf index cd801353..0a32825e 100644 --- a/software/trimgalore/main.nf +++ b/software/trimgalore/main.nf @@ -1,21 +1,25 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process TRIMGALORE { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/trim-galore:0.6.6--0" - //container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.6--0" - - conda (params.conda ? "bioconda::trim-galore=0.6.6" : null) + conda (params.enable_conda ? "bioconda::trim-galore=0.6.6" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.6--0" + } else { + container "quay.io/biocontainers/trim-galore:0.6.6--0" + } input: tuple val(meta), path(reads) - val options output: tuple val(meta), path("*.fq.gz") , emit: reads @@ -45,13 +49,12 @@ process TRIMGALORE { // Added soft-links to original fastqs for consistent naming in MultiQC def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz trim_galore \\ - $ioptions.args \\ + $options.args \\ --cores $cores \\ --gzip \\ $c_r1 \\ @@ -64,7 +67,7 @@ process TRIMGALORE { [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz trim_galore \\ - $ioptions.args \\ + $options.args \\ --cores $cores \\ --paired \\ --gzip \\ diff --git a/software/umitools/dedup/main.nf b/software/umitools/dedup/main.nf index 5c72946d..abeab49a 100644 --- a/software/umitools/dedup/main.nf +++ b/software/umitools/dedup/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process UMITOOLS_DEDUP { tag "$meta.id" label "process_medium" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::umi_tools=1.0.1" : null) + conda (params.enable_conda ? "bioconda::umi_tools=1.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1" + } input: tuple val(meta), path(bam), path(bai) - val options - + output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.tsv"), emit: tsv @@ -24,14 +28,13 @@ process UMITOOLS_DEDUP { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ umi_tools dedup \\ -I $bam \\ -S ${prefix}.bam \\ --output-stats=$prefix \\ - $ioptions.args \\ + $options.args \\ umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt """ diff --git a/software/umitools/extract/main.nf b/software/umitools/extract/main.nf index 5049e2ad..34cb3e3c 100644 --- a/software/umitools/extract/main.nf +++ b/software/umitools/extract/main.nf @@ -1,21 +1,25 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process UMITOOLS_EXTRACT { tag "$meta.id" label "process_low" publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1" - //container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1" - - conda (params.conda ? "bioconda::umi_tools=1.0.1" : null) + conda (params.enable_conda ? "bioconda::umi_tools=1.0.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1" + } else { + container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1" + } input: tuple val(meta), path(reads) - val options output: tuple val(meta), path("*.fastq.gz"), emit: reads @@ -24,15 +28,14 @@ process UMITOOLS_EXTRACT { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ umi_tools \\ extract \\ -I $reads \\ -S ${prefix}.umi_extract.fastq.gz \\ - $ioptions.args \\ + $options.args \\ > ${prefix}.umi_extract.log umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt @@ -45,7 +48,7 @@ process UMITOOLS_EXTRACT { --read2-in=${reads[1]} \\ -S ${prefix}.umi_extract_1.fastq.gz \\ --read2-out=${prefix}.umi_extract_2.fastq.gz \\ - $ioptions.args \\ + $options.args \\ > ${prefix}.umi_extract.log umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt From 1d30e2c21affedc742680e8e04d60c6481d9cd11 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 14 Oct 2020 18:59:25 +0100 Subject: [PATCH 2/6] Update tools not in rnaseq pipeline too --- git_update.sh | 4 +++ software/SOFTWARE/TOOL/main.nf | 34 +++++++++++-------- software/bwa/index/main.nf | 21 +++++++----- software/bwa/mem/main.nf | 25 ++++++++------ software/deeptools/computematrix/main.nf | 23 +++++++------ software/deeptools/plotfingerprint/main.nf | 23 +++++++------ software/deeptools/plotheatmap/main.nf | 23 +++++++------ software/deeptools/plotprofile/main.nf | 23 +++++++------ software/homer/annotatepeaks/main.nf | 21 +++++++----- software/macs2/callpeak/main.nf | 23 +++++++------ software/phantompeakqualtools/main.nf | 21 +++++++----- .../picard/collectmultiplemetrics/main.nf | 21 +++++++----- software/picard/markduplicates/main.nf | 23 +++++++------ software/picard/mergesamfiles/main.nf | 23 +++++++------ software/ucsc/bedgraphtobigwig/main.nf | 21 +++++++----- 15 files changed, 188 insertions(+), 141 deletions(-) create mode 100755 git_update.sh diff --git a/git_update.sh b/git_update.sh new file mode 100755 index 00000000..8515b482 --- /dev/null +++ b/git_update.sh @@ -0,0 +1,4 @@ + +git pull +git pull upstream master +git push diff --git a/software/SOFTWARE/TOOL/main.nf b/software/SOFTWARE/TOOL/main.nf index 94abc58f..e87ea87d 100644 --- a/software/SOFTWARE/TOOL/main.nf +++ b/software/SOFTWARE/TOOL/main.nf @@ -10,7 +10,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' // TODO nf-core: The key words "MUST", "MUST NOT", "SHOULD", etc. are to be interpreted as described in RFC 2119 (https://tools.ietf.org/html/rfc2119). // TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. // All other parameters MUST be provided as a string i.e. "options.args" -// where "options" is a Groovy Map that MUST be provided in the "input:" section of the process. +// where "params.options" is a Groovy Map that MUST be provided via the addParams section of the including workflow. // 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 @@ -18,6 +18,9 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' // e.g. bwa mem | samtools view -B -T ref.fasta to output BAM instead of SAM. // TODO nf-core: Optional inputs are not currently supported by Nextflow. However, "fake files" MAY be used to work around this issue. +params.options = [:] +def options = initOptions(params.options) + // TODO nf-core: Process name MUST be all uppercase, // "SOFTWARE" and (ideally) "TOOL" MUST be all one word separated by an "_". process SOFTWARE_TOOL { @@ -31,18 +34,22 @@ process SOFTWARE_TOOL { mode: params.publish_dir_mode, // TODO nf-core: If a meta map of sample information is NOT provided in "input:" section // change "publish_id:meta.id" to initialise an empty string e.g. "publish_id:''". - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + + // TODO nf-core: List required Conda packages. + // Software MUST be pinned to channel (i.e. "bioconda") and version (i.e. "1.10") as in the example below. + // Pinning the build too e.g. "bioconda::samtools=1.10=h9402c20_2" is not currently a requirement. + conda (params.enable_conda ? "bioconda::samtools=1.10" : null) // TODO nf-core: Fetch "docker pull" address for latest BioContainer image of software: e.g. https://biocontainers.pro/#/tools/samtools // Click on the Pacakages and Containers tab, sort by Version and get the portion of the link after the docker pull command where Type is Docker. // You may need to double-check that you are using the latest version of the software because you may find that containers for older versions have been rebuilt more recently. // If required, multi-tool containers may also be available and are usually named to start with "mulled". - container "quay.io/biocontainers/samtools:1.10--h9402c20_2" - - // TODO nf-core: List required Conda packages. - // Software MUST be pinned to channel (i.e. "bioconda") and version (i.e. "1.10") as in the example below. - // Pinning the build too e.g. "bioconda::samtools=1.10=h9402c20_2" is not currently a requirement. - conda (params.conda ? "bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2" + } else { + container "quay.io/biocontainers/samtools:1.10--h9402c20_2" + } input: // TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group" @@ -52,9 +59,7 @@ process SOFTWARE_TOOL { // 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. tuple val(meta), path(reads) - // TODO nf-core: List additional required input channels/values here - val options - + output: // TODO nf-core: Named file extensions MUST be emitted for ALL output channels // TODO nf-core: If meta is provided in "input:" section then it MUST be added to ALL output channels (except version) @@ -64,19 +69,18 @@ process SOFTWARE_TOOL { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) // TODO nf-core: If a meta map of sample information is NOT provided in "input:" section delete the line below - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 // If the software is unable to output a version number on the command-line then it can be manually specified // e.g. https://github.com/nf-core/modules/blob/master/software/homer/annotatepeaks/main.nf - // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "$ioptions.args" variable + // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "$options.args" variable // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter // using the Nextflow "task" variable e.g. "--threads $task.cpus" // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) """ software tool \\ - $ioptions.args \\ + $options.args \\ --threads $task.cpus \\ $reads \\ > ${prefix}.bam diff --git a/software/bwa/index/main.nf b/software/bwa/index/main.nf index 537e096a..2a647b17 100644 --- a/software/bwa/index/main.nf +++ b/software/bwa/index/main.nf @@ -1,31 +1,34 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process BWA_INDEX { tag "$fasta" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - container "biocontainers/bwa:v0.7.17_cv1" - //container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7" - - conda (params.conda ? "bioconda::bwa=0.7.17" : null) + conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7" + } else { + container "biocontainers/bwa:v0.7.17_cv1" + } input: path fasta - val options - + output: path "${fasta}.*" , emit: index path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) """ - bwa index $ioptions.args $fasta + bwa index $options.args $fasta echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ } diff --git a/software/bwa/mem/main.nf b/software/bwa/mem/main.nf index 73eadaf8..78e0f968 100644 --- a/software/bwa/mem/main.nf +++ b/software/bwa/mem/main.nf @@ -1,41 +1,44 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process BWA_MEM { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" - //container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" - - conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null) + conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" + } else { + container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" + } input: tuple val(meta), path(reads) path index path fasta - val options - + output: tuple val(meta), path("*.bam"), emit: bam path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ bwa mem \\ - $ioptions.args \\ + $options.args \\ $read_group \\ -t $task.cpus \\ $fasta \\ $reads \\ - | samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ diff --git a/software/deeptools/computematrix/main.nf b/software/deeptools/computematrix/main.nf index 27e3b042..4eb6453f 100644 --- a/software/deeptools/computematrix/main.nf +++ b/software/deeptools/computematrix/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process DEEPTOOLS_COMPUTEMATRIX { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/deeptools:3.4.3--py_0" - //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" - - conda (params.conda ? "bioconda::deeptools=3.4.3" : null) + conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" + } else { + container "quay.io/biocontainers/deeptools:3.4.3--py_0" + } input: tuple val(meta), path(bigwig) path bed - val options - + output: tuple val(meta), path("*.mat.gz") , emit: matrix tuple val(meta), path("*.mat.tab"), emit: table @@ -25,11 +29,10 @@ process DEEPTOOLS_COMPUTEMATRIX { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ computeMatrix \\ - $ioptions.args \\ + $options.args \\ --regionsFileName $bed \\ --scoreFileName $bigwig \\ --outFileName ${prefix}.computeMatrix.mat.gz \\ diff --git a/software/deeptools/plotfingerprint/main.nf b/software/deeptools/plotfingerprint/main.nf index 57b56a06..2815a13c 100644 --- a/software/deeptools/plotfingerprint/main.nf +++ b/software/deeptools/plotfingerprint/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process DEEPTOOLS_PLOTFINGERPRINT { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/deeptools:3.4.3--py_0" - //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" - - conda (params.conda ? "bioconda::deeptools=3.4.3" : null) + conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" + } else { + container "quay.io/biocontainers/deeptools:3.4.3--py_0" + } input: tuple val(meta), path(bams), path(bais) - val options - + output: tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.raw.txt") , emit: matrix @@ -25,12 +29,11 @@ process DEEPTOOLS_PLOTFINGERPRINT { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' """ plotFingerprint \\ - $ioptions.args \\ + $options.args \\ $extend \\ --bamfiles ${bams.join(' ')} \\ --plotFile ${prefix}.plotFingerprint.pdf \\ diff --git a/software/deeptools/plotheatmap/main.nf b/software/deeptools/plotheatmap/main.nf index ca8bf08f..7d3d01bc 100644 --- a/software/deeptools/plotheatmap/main.nf +++ b/software/deeptools/plotheatmap/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process DEEPTOOLS_PLOTHEATMAP { tag "$meta.id" label 'process_low' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/deeptools:3.4.3--py_0" - //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" - - conda (params.conda ? "bioconda::deeptools=3.4.3" : null) + conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" + } else { + container "quay.io/biocontainers/deeptools:3.4.3--py_0" + } input: tuple val(meta), path(matrix) - val options - + output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table @@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTHEATMAP { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ plotHeatmap \\ - $ioptions.args \\ + $options.args \\ --matrixFile $matrix \\ --outFileName ${prefix}.plotHeatmap.pdf \\ --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab diff --git a/software/deeptools/plotprofile/main.nf b/software/deeptools/plotprofile/main.nf index 6a976f7f..4c6865ea 100644 --- a/software/deeptools/plotprofile/main.nf +++ b/software/deeptools/plotprofile/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process DEEPTOOLS_PLOTPROFILE { tag "$meta.id" label 'process_low' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/deeptools:3.4.3--py_0" - //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" - - conda (params.conda ? "bioconda::deeptools=3.4.3" : null) + conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" + } else { + container "quay.io/biocontainers/deeptools:3.4.3--py_0" + } input: tuple val(meta), path(matrix) - val options - + output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table @@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTPROFILE { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ plotProfile \\ - $ioptions.args \\ + $options.args \\ --matrixFile $matrix \\ --outFileName ${prefix}.plotProfile.pdf \\ --outFileNameData ${prefix}.plotProfile.tab diff --git a/software/homer/annotatepeaks/main.nf b/software/homer/annotatepeaks/main.nf index 98d234b0..9bdf0494 100644 --- a/software/homer/annotatepeaks/main.nf +++ b/software/homer/annotatepeaks/main.nf @@ -1,6 +1,9 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + def VERSION = '4.11' process HOMER_ANNOTATEPEAKS { @@ -8,18 +11,19 @@ process HOMER_ANNOTATEPEAKS { label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2" - //container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2" - - conda (params.conda ? "bioconda::homer=4.11" : null) + conda (params.enable_conda ? "bioconda::homer=4.11" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2" + } else { + container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2" + } input: tuple val(meta), path(peak) path fasta path gtf - val options output: tuple val(meta), path("*annotatePeaks.txt"), emit: txt @@ -27,13 +31,12 @@ process HOMER_ANNOTATEPEAKS { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ annotatePeaks.pl \\ $peak \\ $fasta \\ - $ioptions.args \\ + $options.args \\ -gtf $gtf \\ -cpu $task.cpus \\ > ${prefix}.annotatePeaks.txt diff --git a/software/macs2/callpeak/main.nf b/software/macs2/callpeak/main.nf index e9a2a9c1..b932d6cb 100644 --- a/software/macs2/callpeak/main.nf +++ b/software/macs2/callpeak/main.nf @@ -1,23 +1,27 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process MACS2_CALLPEAK { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0" - //container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0" - - conda (params.conda ? "bioconda::macs2=2.2.7.1" : null) + conda (params.enable_conda ? "bioconda::macs2=2.2.7.1" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0" + } else { + container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0" + } input: tuple val(meta), path(ipbam), path(controlbam) val macs2_gsize - val options - + output: tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak tuple val(meta), path("*.xls") , emit: xls @@ -29,14 +33,13 @@ process MACS2_CALLPEAK { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def format = meta.single_end ? 'BAM' : 'BAMPE' def control = controlbam ? "--control $controlbam" : '' """ macs2 \\ callpeak \\ - $ioptions.args \\ + $options.args \\ --gsize $macs2_gsize \\ --format $format \\ --name $prefix \\ diff --git a/software/phantompeakqualtools/main.nf b/software/phantompeakqualtools/main.nf index f9471dc6..a3d32a3e 100644 --- a/software/phantompeakqualtools/main.nf +++ b/software/phantompeakqualtools/main.nf @@ -1,6 +1,9 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + def VERSION = '1.2.2' process PHANTOMPEAKQUALTOOLS { @@ -8,17 +11,18 @@ process PHANTOMPEAKQUALTOOLS { label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0" - //container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0" - - conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null) + conda (params.enable_conda ? "bioconda::phantompeakqualtools=1.2.2" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0" + } else { + container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.out") , emit: spp tuple val(meta), path("*.pdf") , emit: pdf @@ -27,8 +31,7 @@ process PHANTOMPEAKQUALTOOLS { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ RUN_SPP=`which run_spp.R` Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus diff --git a/software/picard/collectmultiplemetrics/main.nf b/software/picard/collectmultiplemetrics/main.nf index 248da6c5..ff0c0835 100644 --- a/software/picard/collectmultiplemetrics/main.nf +++ b/software/picard/collectmultiplemetrics/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process PICARD_COLLECTMULTIPLEMETRICS { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/picard:2.23.6--0" - //container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" - - conda (params.conda ? "bioconda::picard=2.23.6" : null) + conda (params.enable_conda ? "bioconda::picard=2.23.6" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" + } else { + container "quay.io/biocontainers/picard:2.23.6--0" + } input: tuple val(meta), path(bam) path fasta - val options output: tuple val(meta), path("*_metrics"), emit: metrics @@ -25,8 +29,7 @@ process PICARD_COLLECTMULTIPLEMETRICS { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -37,7 +40,7 @@ process PICARD_COLLECTMULTIPLEMETRICS { picard \\ -Xmx${avail_mem}g \\ CollectMultipleMetrics \\ - $ioptions.args \\ + $options.args \\ INPUT=$bam \\ OUTPUT=${prefix}.CollectMultipleMetrics \\ REFERENCE_SEQUENCE=$fasta diff --git a/software/picard/markduplicates/main.nf b/software/picard/markduplicates/main.nf index 2e484115..924f8a94 100644 --- a/software/picard/markduplicates/main.nf +++ b/software/picard/markduplicates/main.nf @@ -1,22 +1,26 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process PICARD_MARKDUPLICATES { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/picard:2.23.6--0" - //container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" - - conda (params.conda ? "bioconda::picard=2.23.6" : null) + conda (params.enable_conda ? "bioconda::picard=2.23.6" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" + } else { + container "quay.io/biocontainers/picard:2.23.6--0" + } input: tuple val(meta), path(bam) - val options - + output: tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.metrics.txt"), emit: metrics @@ -24,8 +28,7 @@ process PICARD_MARKDUPLICATES { script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -36,7 +39,7 @@ process PICARD_MARKDUPLICATES { picard \\ -Xmx${avail_mem}g \\ MarkDuplicates \\ - $ioptions.args \\ + $options.args \\ INPUT=$bam \\ OUTPUT=${prefix}.bam \\ METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt diff --git a/software/picard/mergesamfiles/main.nf b/software/picard/mergesamfiles/main.nf index 403933a3..295cc259 100644 --- a/software/picard/mergesamfiles/main.nf +++ b/software/picard/mergesamfiles/main.nf @@ -1,30 +1,33 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + process PICARD_MERGESAMFILES { tag "$meta.id" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/picard:2.23.6--0" - //container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" - - conda (params.conda ? "bioconda::picard=2.23.6" : null) + conda (params.enable_conda ? "bioconda::picard=2.23.6" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0" + } else { + container "quay.io/biocontainers/picard:2.23.6--0" + } input: tuple val(meta), path(bams) - val options - + output: tuple val(meta), path("*.bam"), emit: bam path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def bam_files = bams.sort() def avail_mem = 3 if (!task.memory) { @@ -37,7 +40,7 @@ process PICARD_MERGESAMFILES { picard \\ -Xmx${avail_mem}g \\ MergeSamFiles \\ - $ioptions.args \\ + $options.args \\ ${'INPUT='+bam_files.join(' INPUT=')} \\ OUTPUT=${prefix}.bam echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt diff --git a/software/ucsc/bedgraphtobigwig/main.nf b/software/ucsc/bedgraphtobigwig/main.nf index b21b5fe0..1d7a425f 100644 --- a/software/ucsc/bedgraphtobigwig/main.nf +++ b/software/ucsc/bedgraphtobigwig/main.nf @@ -1,6 +1,9 @@ // Import generic module functions include { initOptions; saveFiles; getSoftwareName } from './functions' +params.options = [:] +def options = initOptions(params.options) + def VERSION = '377' process UCSC_BEDRAPHTOBIGWIG { @@ -8,26 +11,26 @@ process UCSC_BEDRAPHTOBIGWIG { label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1" - //container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1" - - conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null) + conda (params.enable_conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null) + if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1" + } else { + container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1" + } input: tuple val(meta), path(bedgraph) path sizes - val options - + output: tuple val(meta), path("*.bigWig"), emit: bigwig path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig echo $VERSION > ${software}.version.txt From c32fcb39fcedae29a60f3a099a06d2b739b22613 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Thu, 15 Oct 2020 10:22:40 +0100 Subject: [PATCH 3/6] Remove git update script --- git_update.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 git_update.sh diff --git a/git_update.sh b/git_update.sh deleted file mode 100755 index 8515b482..00000000 --- a/git_update.sh +++ /dev/null @@ -1,4 +0,0 @@ - -git pull -git pull upstream master -git push From 530789ba85b146d8aa27d613a5360d452e2460c8 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Thu, 15 Oct 2020 10:47:15 +0100 Subject: [PATCH 4/6] Get tests passing --- software/SOFTWARE/TOOL/test/main.nf | 7 ++++--- software/SOFTWARE/TOOL/test/nextflow.config | 4 ++-- software/bwa/index/test/main.nf | 4 ++-- software/bwa/index/test/nextflow.config | 4 ++-- software/bwa/mem/test/main.nf | 13 ++++++------- software/bwa/mem/test/nextflow.config | 4 ++-- software/fastqc/test/main.nf | 7 ++++--- software/fastqc/test/nextflow.config | 4 ++-- software/picard/collectmultiplemetrics/test/main.nf | 5 ++--- .../collectmultiplemetrics/test/nextflow.config | 4 ++-- software/picard/markduplicates/test/main.nf | 4 ++-- software/picard/markduplicates/test/nextflow.config | 4 ++-- software/picard/mergesamfiles/test/main.nf | 4 ++-- software/picard/mergesamfiles/test/nextflow.config | 4 ++-- software/samtools/flagstat/test/main.nf | 4 ++-- software/samtools/flagstat/test/nextflow.config | 4 ++-- software/samtools/idxstats/test/main.nf | 4 ++-- software/samtools/idxstats/test/nextflow.config | 4 ++-- software/samtools/index/test/main.nf | 4 ++-- software/samtools/index/test/nextflow.config | 4 ++-- software/samtools/sort/test/main.nf | 4 ++-- software/samtools/sort/test/nextflow.config | 4 ++-- software/samtools/stats/test/main.nf | 4 ++-- software/samtools/stats/test/nextflow.config | 4 ++-- software/trimgalore/test/main.nf | 7 ++++--- software/trimgalore/test/nextflow.config | 4 ++-- 26 files changed, 62 insertions(+), 61 deletions(-) diff --git a/software/SOFTWARE/TOOL/test/main.nf b/software/SOFTWARE/TOOL/test/main.nf index 80d0a347..e504e51e 100644 --- a/software/SOFTWARE/TOOL/test/main.nf +++ b/software/SOFTWARE/TOOL/test/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { FASTQC } from '../main.nf' +include { FASTQC as FASTQC_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) +include { FASTQC as FASTQC_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) /* * Test with single-end data @@ -13,7 +14,7 @@ workflow test_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] - FASTQC ( input, [ publish_dir:'test_single_end' ] ) + FASTQC_SE ( input ) } /* @@ -26,7 +27,7 @@ workflow test_paired_end { [ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true), file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] - FASTQC ( input, [ publish_dir:'test_paired_end' ] ) + FASTQC_PE ( input ) } workflow { diff --git a/software/SOFTWARE/TOOL/test/nextflow.config b/software/SOFTWARE/TOOL/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/SOFTWARE/TOOL/test/nextflow.config +++ b/software/SOFTWARE/TOOL/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/bwa/index/test/main.nf b/software/bwa/index/test/main.nf index 0a2c3303..ef0db3ef 100644 --- a/software/bwa/index/test/main.nf +++ b/software/bwa/index/test/main.nf @@ -2,10 +2,10 @@ nextflow.enable.dsl = 2 -include { BWA_INDEX } from '../main.nf' +include { BWA_INDEX } from '../main.nf' addParams( options: [:] ) workflow test { - BWA_INDEX ( file("${baseDir}/input/NC_010473.fa", checkIfExists: true), [:] ) + BWA_INDEX ( file("${baseDir}/input/NC_010473.fa", checkIfExists: true) ) } workflow { diff --git a/software/bwa/index/test/nextflow.config b/software/bwa/index/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/bwa/index/test/nextflow.config +++ b/software/bwa/index/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/bwa/mem/test/main.nf b/software/bwa/mem/test/main.nf index 0618983a..4d93e720 100755 --- a/software/bwa/mem/test/main.nf +++ b/software/bwa/mem/test/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { BWA_MEM } from '../main.nf' +include { BWA_MEM as BWA_MEM_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) +include { BWA_MEM as BWA_MEM_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) /* * Test with single-end data @@ -13,11 +14,10 @@ workflow test_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] - BWA_MEM ( + BWA_MEM_SE ( input, file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${baseDir}/input/NC_010473.fa", checkIfExists: true), - [ publish_dir:'test_single_end' ] + file("${baseDir}/input/NC_010473.fa", checkIfExists: true) ) } @@ -31,11 +31,10 @@ workflow test_paired_end { [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), file("${baseDir}/input/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] - BWA_MEM ( + BWA_MEM_PE ( input, file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${baseDir}/input/NC_010473.fa", checkIfExists: true), - [ publish_dir:'test_paired_end' ] + file("${baseDir}/input/NC_010473.fa", checkIfExists: true) ) } diff --git a/software/bwa/mem/test/nextflow.config b/software/bwa/mem/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/bwa/mem/test/nextflow.config +++ b/software/bwa/mem/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/fastqc/test/main.nf b/software/fastqc/test/main.nf index 80d0a347..e504e51e 100755 --- a/software/fastqc/test/main.nf +++ b/software/fastqc/test/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { FASTQC } from '../main.nf' +include { FASTQC as FASTQC_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) +include { FASTQC as FASTQC_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) /* * Test with single-end data @@ -13,7 +14,7 @@ workflow test_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] - FASTQC ( input, [ publish_dir:'test_single_end' ] ) + FASTQC_SE ( input ) } /* @@ -26,7 +27,7 @@ workflow test_paired_end { [ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true), file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] - FASTQC ( input, [ publish_dir:'test_paired_end' ] ) + FASTQC_PE ( input ) } workflow { diff --git a/software/fastqc/test/nextflow.config b/software/fastqc/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/fastqc/test/nextflow.config +++ b/software/fastqc/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/picard/collectmultiplemetrics/test/main.nf b/software/picard/collectmultiplemetrics/test/main.nf index 6aa30d4c..d52961d7 100755 --- a/software/picard/collectmultiplemetrics/test/main.nf +++ b/software/picard/collectmultiplemetrics/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_COLLECTMULTIPLEMETRICS } from '../main.nf' +include { PICARD_COLLECTMULTIPLEMETRICS } from '../main.nf' addParams( options: [:] ) workflow test { @@ -12,8 +12,7 @@ workflow test { PICARD_COLLECTMULTIPLEMETRICS ( input, - file("${baseDir}/input/NC_010473.fa", checkIfExists: true), - [:] + file("${baseDir}/input/NC_010473.fa", checkIfExists: true) ) } diff --git a/software/picard/collectmultiplemetrics/test/nextflow.config b/software/picard/collectmultiplemetrics/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/picard/collectmultiplemetrics/test/nextflow.config +++ b/software/picard/collectmultiplemetrics/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/picard/markduplicates/test/main.nf b/software/picard/markduplicates/test/main.nf index 91a1544b..300f8e4a 100755 --- a/software/picard/markduplicates/test/main.nf +++ b/software/picard/markduplicates/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_MARKDUPLICATES } from '../main.nf' +include { PICARD_MARKDUPLICATES } from '../main.nf' addParams( options: [:] ) workflow test { @@ -10,7 +10,7 @@ workflow test { input = [ [ id:'test', single_end:false ], // meta map file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ] - PICARD_MARKDUPLICATES ( input, [:] ) + PICARD_MARKDUPLICATES ( input ) } workflow { diff --git a/software/picard/markduplicates/test/nextflow.config b/software/picard/markduplicates/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/picard/markduplicates/test/nextflow.config +++ b/software/picard/markduplicates/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/picard/mergesamfiles/test/main.nf b/software/picard/mergesamfiles/test/main.nf index 693156cb..db93bb35 100755 --- a/software/picard/mergesamfiles/test/main.nf +++ b/software/picard/mergesamfiles/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_MERGESAMFILES } from '../main.nf' +include { PICARD_MERGESAMFILES } from '../main.nf' addParams( options: [:] ) workflow test { @@ -11,7 +11,7 @@ workflow test { [ file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true), file("${baseDir}/input/test.paired_end.COPY.sorted.bam", checkIfExists: true), ] ] - PICARD_MERGESAMFILES ( input, [:] ) + PICARD_MERGESAMFILES ( input ) } workflow { diff --git a/software/picard/mergesamfiles/test/nextflow.config b/software/picard/mergesamfiles/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/picard/mergesamfiles/test/nextflow.config +++ b/software/picard/mergesamfiles/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/samtools/flagstat/test/main.nf b/software/samtools/flagstat/test/main.nf index f41a0d86..680f70dd 100755 --- a/software/samtools/flagstat/test/main.nf +++ b/software/samtools/flagstat/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_FLAGSTAT } from '../main.nf' +include { SAMTOOLS_FLAGSTAT } from '../main.nf' addParams( options: [:] ) workflow test { @@ -11,7 +11,7 @@ workflow test { file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true), file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] - SAMTOOLS_FLAGSTAT ( input, [:] ) + SAMTOOLS_FLAGSTAT ( input ) } workflow { diff --git a/software/samtools/flagstat/test/nextflow.config b/software/samtools/flagstat/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/samtools/flagstat/test/nextflow.config +++ b/software/samtools/flagstat/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/samtools/idxstats/test/main.nf b/software/samtools/idxstats/test/main.nf index f7b230bf..61c05fb8 100755 --- a/software/samtools/idxstats/test/main.nf +++ b/software/samtools/idxstats/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_IDXSTATS } from '../main.nf' +include { SAMTOOLS_IDXSTATS } from '../main.nf' addParams( options: [:] ) workflow test { @@ -11,7 +11,7 @@ workflow test { file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true), file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] - SAMTOOLS_IDXSTATS ( input, [:] ) + SAMTOOLS_IDXSTATS ( input ) } workflow { diff --git a/software/samtools/idxstats/test/nextflow.config b/software/samtools/idxstats/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/samtools/idxstats/test/nextflow.config +++ b/software/samtools/idxstats/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/samtools/index/test/main.nf b/software/samtools/index/test/main.nf index a5b80893..7d949828 100755 --- a/software/samtools/index/test/main.nf +++ b/software/samtools/index/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_INDEX } from '../main.nf' +include { SAMTOOLS_INDEX } from '../main.nf' addParams( options: [:] ) workflow test { @@ -10,7 +10,7 @@ workflow test { input = [ [ id:'test', single_end:false ], // meta map file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ] - SAMTOOLS_INDEX ( input, [:] ) + SAMTOOLS_INDEX ( input ) } workflow { diff --git a/software/samtools/index/test/nextflow.config b/software/samtools/index/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/samtools/index/test/nextflow.config +++ b/software/samtools/index/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/samtools/sort/test/main.nf b/software/samtools/sort/test/main.nf index 04e02ece..45a6d43f 100755 --- a/software/samtools/sort/test/main.nf +++ b/software/samtools/sort/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_SORT } from '../main.nf' +include { SAMTOOLS_SORT } from '../main.nf' addParams( options: [:] ) workflow test { @@ -10,7 +10,7 @@ workflow test { input = [ [ id:'test', single_end:false ], // meta map file("${baseDir}/input/test.paired_end.name.sorted.bam", checkIfExists: true) ] - SAMTOOLS_SORT ( input, [:] ) + SAMTOOLS_SORT ( input ) } workflow { diff --git a/software/samtools/sort/test/nextflow.config b/software/samtools/sort/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/samtools/sort/test/nextflow.config +++ b/software/samtools/sort/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/samtools/stats/test/main.nf b/software/samtools/stats/test/main.nf index 0cbaba5d..a3388303 100755 --- a/software/samtools/stats/test/main.nf +++ b/software/samtools/stats/test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_STATS } from '../main.nf' +include { SAMTOOLS_STATS } from '../main.nf' addParams( options: [:] ) workflow test { @@ -11,7 +11,7 @@ workflow test { file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true), file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] - SAMTOOLS_STATS ( input, [:] ) + SAMTOOLS_STATS ( input ) } workflow { diff --git a/software/samtools/stats/test/nextflow.config b/software/samtools/stats/test/nextflow.config index 44b62ed8..4149feea 100644 --- a/software/samtools/stats/test/nextflow.config +++ b/software/samtools/stats/test/nextflow.config @@ -2,12 +2,12 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false } profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true diff --git a/software/trimgalore/test/main.nf b/software/trimgalore/test/main.nf index 7403f667..29754b9d 100755 --- a/software/trimgalore/test/main.nf +++ b/software/trimgalore/test/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { TRIMGALORE } from '../main.nf' +include { TRIMGALORE as TRIMGALORE_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) +include { TRIMGALORE as TRIMGALORE_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) /* * Test with single-end data @@ -13,7 +14,7 @@ workflow test_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] - TRIMGALORE ( input, [ publish_dir:'test_single_end' ] ) + TRIMGALORE_SE ( input ) } /* @@ -26,7 +27,7 @@ workflow test_paired_end { [ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true), file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] - TRIMGALORE ( input, [ publish_dir:'test_paired_end' ] ) + TRIMGALORE_PE ( input ) } workflow { diff --git a/software/trimgalore/test/nextflow.config b/software/trimgalore/test/nextflow.config index dd823c39..6432ed7d 100644 --- a/software/trimgalore/test/nextflow.config +++ b/software/trimgalore/test/nextflow.config @@ -2,7 +2,7 @@ params { outdir = "output/" publish_dir_mode = "copy" - conda = false + enable_conda = false clip_r1 = 0 clip_r2 = 0 @@ -12,7 +12,7 @@ params { profiles { conda { - params.conda = true + params.enable_conda = true } docker { docker.enabled = true From 7e2c7b1b41a39b6a5c188e954017886b8e6adcae Mon Sep 17 00:00:00 2001 From: drpatelh Date: Thu, 15 Oct 2020 11:02:04 +0100 Subject: [PATCH 5/6] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22add2b0..d3ca89ad 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi nextflow.enable.dsl = 2 - include { FASTQC } from './modules/nf-core/software/fastqc/main' + include { FASTQC } from './modules/nf-core/software/fastqc/main' addParams( options: [:] ) ``` 5. We have plans to add other utility commands to help developers install and maintain modules downloaded from this repository so watch this space! @@ -170,7 +170,7 @@ using a combination of `bwa` and `samtools` to output a BAM file instead of a SA - A module file SHOULD only define input and output files as command-line parameters to be executed within the process. -- All other parameters MUST be provided as a string i.e. `options.args` where `options` is a Groovy Map that MUST be provided in the `input` section of the process. +- All other parameters MUST be provided as a string i.e. `options.args` where `options` is a Groovy Map that MUST be provided via the Nextflow `addParams` option when including the module via `include` in the parent workflow. - If the tool supports multi-threading then you MUST provide the appropriate parameter using the Nextflow `task` variable e.g. `--threads $task.cpus`. @@ -207,7 +207,7 @@ The [Nextflow `publishDir`](https://www.nextflow.io/docs/latest/process.html#pub ```nextflow publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } ``` The `saveFiles` function can be found in the [`functions.nf`](software/fastqc/functions.nf) file of utility functions that will be copied into all module directories. It uses the various publishing `options` specified as input to the module to construct and append the relevant output path to `params.outdir`. From 29f9b054335bba2b282e90250f3f323c51ce7da2 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Thu, 15 Oct 2020 11:13:54 +0100 Subject: [PATCH 6/6] Update docs --- software/SOFTWARE/TOOL/meta.yml | 7 +------ software/bwa/index/meta.yml | 7 +------ software/bwa/mem/meta.yml | 7 +------ software/fastqc/meta.yml | 7 +------ software/picard/collectmultiplemetrics/meta.yml | 7 +------ software/picard/markduplicates/meta.yml | 7 +------ software/picard/mergesamfiles/meta.yml | 7 +------ software/samtools/flagstat/meta.yml | 7 +------ software/samtools/idxstats/meta.yml | 7 +------ software/samtools/index/meta.yml | 7 +------ software/samtools/sort/meta.yml | 7 +------ software/samtools/stats/meta.yml | 7 +------ software/trimgalore/meta.yml | 7 +------ 13 files changed, 13 insertions(+), 78 deletions(-) diff --git a/software/SOFTWARE/TOOL/meta.yml b/software/SOFTWARE/TOOL/meta.yml index 706b4e8d..3fd42a5c 100644 --- a/software/SOFTWARE/TOOL/meta.yml +++ b/software/SOFTWARE/TOOL/meta.yml @@ -32,7 +32,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -49,11 +49,6 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. ## TODO nf-core: Add a description of all of the variables used as output output: - meta: diff --git a/software/bwa/index/meta.yml b/software/bwa/index/meta.yml index a2f5b1ed..973a18db 100644 --- a/software/bwa/index/meta.yml +++ b/software/bwa/index/meta.yml @@ -24,7 +24,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -33,11 +33,6 @@ input: - fasta: type: file description: Input genome fasta file - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - index: type: file diff --git a/software/bwa/mem/meta.yml b/software/bwa/mem/meta.yml index 9b3bb8fb..142a5a0e 100644 --- a/software/bwa/mem/meta.yml +++ b/software/bwa/mem/meta.yml @@ -27,7 +27,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -50,11 +50,6 @@ input: - fasta: type: file description: Input genome fasta file - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - bam: type: file diff --git a/software/fastqc/meta.yml b/software/fastqc/meta.yml index 9ad28831..337fc372 100644 --- a/software/fastqc/meta.yml +++ b/software/fastqc/meta.yml @@ -26,7 +26,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -42,11 +42,6 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/picard/collectmultiplemetrics/meta.yml b/software/picard/collectmultiplemetrics/meta.yml index 02604089..6f2fd8bc 100644 --- a/software/picard/collectmultiplemetrics/meta.yml +++ b/software/picard/collectmultiplemetrics/meta.yml @@ -25,7 +25,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -43,11 +43,6 @@ input: - fasta: type: file description: Genome fasta file - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/picard/markduplicates/meta.yml b/software/picard/markduplicates/meta.yml index 6ee32509..a91616d8 100644 --- a/software/picard/markduplicates/meta.yml +++ b/software/picard/markduplicates/meta.yml @@ -25,7 +25,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -40,11 +40,6 @@ input: type: file description: BAM file pattern: "*.{bam}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/picard/mergesamfiles/meta.yml b/software/picard/mergesamfiles/meta.yml index b717f21a..f47fa903 100644 --- a/software/picard/mergesamfiles/meta.yml +++ b/software/picard/mergesamfiles/meta.yml @@ -23,7 +23,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -38,11 +38,6 @@ input: type: file description: List of BAM files pattern: "*.{bam}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/samtools/flagstat/meta.yml b/software/samtools/flagstat/meta.yml index bd51d37d..6703c392 100644 --- a/software/samtools/flagstat/meta.yml +++ b/software/samtools/flagstat/meta.yml @@ -27,7 +27,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -46,11 +46,6 @@ input: type: file description: Index for BAM/CRAM/SAM file pattern: "*.{bai,crai,sai}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/samtools/idxstats/meta.yml b/software/samtools/idxstats/meta.yml index ea2a8508..c33f1724 100644 --- a/software/samtools/idxstats/meta.yml +++ b/software/samtools/idxstats/meta.yml @@ -28,7 +28,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -47,11 +47,6 @@ input: type: file description: Index for BAM/CRAM/SAM file pattern: "*.{bai,crai,sai}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/samtools/index/meta.yml b/software/samtools/index/meta.yml index e2d1cd35..8d3e049c 100644 --- a/software/samtools/index/meta.yml +++ b/software/samtools/index/meta.yml @@ -25,7 +25,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -40,11 +40,6 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/samtools/sort/meta.yml b/software/samtools/sort/meta.yml index 51241de0..e8f74b26 100644 --- a/software/samtools/sort/meta.yml +++ b/software/samtools/sort/meta.yml @@ -25,7 +25,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -40,11 +40,6 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/samtools/stats/meta.yml b/software/samtools/stats/meta.yml index b3ede95a..9f478cc0 100644 --- a/software/samtools/stats/meta.yml +++ b/software/samtools/stats/meta.yml @@ -26,7 +26,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -45,11 +45,6 @@ input: type: file description: Index for BAM/CRAM/SAM file pattern: "*.{bai,crai,sai}" - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map diff --git a/software/trimgalore/meta.yml b/software/trimgalore/meta.yml index 34e492a8..bc1179e0 100644 --- a/software/trimgalore/meta.yml +++ b/software/trimgalore/meta.yml @@ -24,7 +24,7 @@ params: description: | Value for the Nextflow `publishDir` mode parameter. Available: symlink, rellink, link, copy, copyNoFollow, move. - - conda: + - enable_conda: type: boolean description: | Run the module with Conda using the software specified @@ -60,11 +60,6 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. - - options: - type: map - description: | - Groovy Map containing module options for passing command-line arguments and - output file paths. output: - meta: type: map