Merge pull request #70 from drpatelh/versions

Update existing modules with new options and container syntax
This commit is contained in:
Harshil Patel 2020-10-15 11:28:13 +01:00 committed by GitHub
commit ff0fe1a910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 655 additions and 640 deletions

View file

@ -80,7 +80,7 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi
nextflow.enable.dsl = 2 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! 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. - 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`. - 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 ```nextflow
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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`. 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`.

View file

@ -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: 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. // 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" // 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 // 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. // 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 // 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. // 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. // 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, // TODO nf-core: Process name MUST be all uppercase,
// "SOFTWARE" and (ideally) "TOOL" MUST be all one word separated by an "_". // "SOFTWARE" and (ideally) "TOOL" MUST be all one word separated by an "_".
process SOFTWARE_TOOL { process SOFTWARE_TOOL {
@ -31,18 +34,22 @@ process SOFTWARE_TOOL {
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
// TODO nf-core: If a meta map of sample information is NOT provided in "input:" section // 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:''". // 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 // 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. // 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. // 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". // If required, multi-tool containers may also be available and are usually named to start with "mulled".
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" 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)
input: input:
// TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group" // TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group"
@ -52,8 +59,6 @@ process SOFTWARE_TOOL {
// TODO nf-core: Where applicable please provide/convert compressed files as input/output // 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. // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc.
tuple val(meta), path(reads) tuple val(meta), path(reads)
// TODO nf-core: List additional required input channels/values here
val options
output: output:
// TODO nf-core: Named file extensions MUST be emitted for ALL output channels // TODO nf-core: Named file extensions MUST be emitted for ALL output channels
@ -64,19 +69,18 @@ process SOFTWARE_TOOL {
script: script:
def software = getSoftwareName(task.process) 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 // 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 // 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 // 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 // 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 // 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" // using the Nextflow "task" variable e.g. "--threads $task.cpus"
// TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;)
""" """
software tool \\ software tool \\
$ioptions.args \\ $options.args \\
--threads $task.cpus \\ --threads $task.cpus \\
$reads \\ $reads \\
> ${prefix}.bam > ${prefix}.bam

View file

@ -32,7 +32,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -49,11 +49,6 @@ input:
description: | description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data, List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively. 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 ## TODO nf-core: Add a description of all of the variables used as output
output: output:
- meta: - meta:

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2 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 * Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] [ 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_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_paired_end' ] ) FASTQC_PE ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process BWA_INDEX { process BWA_INDEX {
tag "$fasta" tag "$fasta"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path fasta path fasta
val options
output: output:
path "${fasta}.*" , emit: index path "${fasta}.*" , emit: index
@ -23,9 +27,8 @@ process BWA_INDEX {
script: script:
def software = getSoftwareName(task.process) 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 echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
""" """
} }

View file

@ -24,7 +24,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -33,11 +33,6 @@ input:
- fasta: - fasta:
type: file type: file
description: Input genome fasta 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: output:
- index: - index:
type: file type: file

View file

@ -2,10 +2,10 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { BWA_INDEX } from '../main.nf' include { BWA_INDEX } from '../main.nf' addParams( options: [:] )
workflow test { workflow test {
BWA_INDEX ( file("${baseDir}/input/NC_010473.fa", checkIfExists: true), [:] ) BWA_INDEX ( file("${baseDir}/input/NC_010473.fa", checkIfExists: true) )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,23 +1,27 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process BWA_MEM { process BWA_MEM {
tag "$meta.id" tag "$meta.id"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
path fasta path fasta
val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -25,17 +29,16 @@ process BWA_MEM {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
""" """
bwa mem \\ bwa mem \\
$ioptions.args \\ $options.args \\
$read_group \\ $read_group \\
-t $task.cpus \\ -t $task.cpus \\
$fasta \\ $fasta \\
$reads \\ $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 echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
""" """

View file

@ -27,7 +27,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -50,11 +50,6 @@ input:
- fasta: - fasta:
type: file type: file
description: Input genome fasta 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: output:
- bam: - bam:
type: file type: file

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2 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 * Test with single-end data
@ -13,11 +14,10 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ]
BWA_MEM ( BWA_MEM_SE (
input, input,
file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true),
file("${baseDir}/input/NC_010473.fa", checkIfExists: true), file("${baseDir}/input/NC_010473.fa", checkIfExists: true)
[ publish_dir:'test_single_end' ]
) )
} }
@ -31,11 +31,10 @@ workflow test_paired_end {
[ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] file("${baseDir}/input/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ]
BWA_MEM ( BWA_MEM_PE (
input, input,
file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true),
file("${baseDir}/input/NC_010473.fa", checkIfExists: true), file("${baseDir}/input/NC_010473.fa", checkIfExists: true)
[ publish_dir:'test_paired_end' ]
) )
} }

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_COMPUTEMATRIX { process DEEPTOOLS_COMPUTEMATRIX {
tag "$meta.id" tag "$meta.id"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bigwig) tuple val(meta), path(bigwig)
path bed path bed
val options
output: output:
tuple val(meta), path("*.mat.gz") , emit: matrix tuple val(meta), path("*.mat.gz") , emit: matrix
@ -25,11 +29,10 @@ process DEEPTOOLS_COMPUTEMATRIX {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
computeMatrix \\ computeMatrix \\
$ioptions.args \\ $options.args \\
--regionsFileName $bed \\ --regionsFileName $bed \\
--scoreFileName $bigwig \\ --scoreFileName $bigwig \\
--outFileName ${prefix}.computeMatrix.mat.gz \\ --outFileName ${prefix}.computeMatrix.mat.gz \\

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTFINGERPRINT { process DEEPTOOLS_PLOTFINGERPRINT {
tag "$meta.id" tag "$meta.id"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bams), path(bais) tuple val(meta), path(bams), path(bais)
val options
output: output:
tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.pdf") , emit: pdf
@ -25,12 +29,11 @@ process DEEPTOOLS_PLOTFINGERPRINT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : ''
""" """
plotFingerprint \\ plotFingerprint \\
$ioptions.args \\ $options.args \\
$extend \\ $extend \\
--bamfiles ${bams.join(' ')} \\ --bamfiles ${bams.join(' ')} \\
--plotFile ${prefix}.plotFingerprint.pdf \\ --plotFile ${prefix}.plotFingerprint.pdf \\

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTHEATMAP { process DEEPTOOLS_PLOTHEATMAP {
tag "$meta.id" tag "$meta.id"
label 'process_low' label 'process_low'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(matrix) tuple val(meta), path(matrix)
val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf"), emit: pdf
@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTHEATMAP {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
plotHeatmap \\ plotHeatmap \\
$ioptions.args \\ $options.args \\
--matrixFile $matrix \\ --matrixFile $matrix \\
--outFileName ${prefix}.plotHeatmap.pdf \\ --outFileName ${prefix}.plotHeatmap.pdf \\
--outFileNameMatrix ${prefix}.plotHeatmap.mat.tab --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTPROFILE { process DEEPTOOLS_PLOTPROFILE {
tag "$meta.id" tag "$meta.id"
label 'process_low' label 'process_low'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(matrix) tuple val(meta), path(matrix)
val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf"), emit: pdf
@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTPROFILE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
plotProfile \\ plotProfile \\
$ioptions.args \\ $options.args \\
--matrixFile $matrix \\ --matrixFile $matrix \\
--outFileName ${prefix}.plotProfile.pdf \\ --outFileName ${prefix}.plotProfile.pdf \\
--outFileNameData ${prefix}.plotProfile.tab --outFileNameData ${prefix}.plotProfile.tab

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process FASTQC { process FASTQC {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
val options
output: output:
tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.html"), emit: html
@ -25,19 +29,18 @@ process FASTQC {
script: script:
// Add soft-links to original FastQs for consistent naming in pipeline // Add soft-links to original FastQs for consistent naming in pipeline
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}.${ioptions.suffix}" : "${meta.id}"
if (meta.single_end) { if (meta.single_end) {
""" """
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz [ ! -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 fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt
""" """
} else { } else {
""" """
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -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 [ ! -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 fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt
""" """
} }

View file

@ -26,7 +26,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -42,11 +42,6 @@ input:
description: | description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data, List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively. respectively.
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2 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 * Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] [ 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_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_paired_end' ] ) FASTQC_PE ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,20 +1,24 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process GFFREAD { process GFFREAD {
tag "$gff" tag "$gff"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path gff path gff
val options
output: output:
path "*.gtf" , emit: gtf path "*.gtf" , emit: gtf
@ -22,9 +26,8 @@ process GFFREAD {
script: script:
def software = getSoftwareName(task.process) 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 echo \$(gffread --version 2>&1) > ${software}.version.txt
""" """
} }

View file

@ -1,6 +1,9 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '2.2.0' def VERSION = '2.2.0'
process HISAT2_ALIGN { process HISAT2_ALIGN {
@ -8,18 +11,19 @@ process HISAT2_ALIGN {
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
path splicesites path splicesites
val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -30,8 +34,7 @@ process HISAT2_ALIGN {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def strandedness = '' def strandedness = ''
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -53,7 +56,7 @@ process HISAT2_ALIGN {
--threads $task.cpus \\ --threads $task.cpus \\
$seq_center \\ $seq_center \\
$unaligned \\ $unaligned \\
$ioptions.args \\ $options.args \\
| samtools view -bS -F 4 -F 256 - > ${prefix}.bam | samtools view -bS -F 4 -F 256 - > ${prefix}.bam
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
@ -74,7 +77,7 @@ process HISAT2_ALIGN {
$unaligned \\ $unaligned \\
--no-mixed \\ --no-mixed \\
--no-discordant \\ --no-discordant \\
$ioptions.args \\ $options.args \\
| samtools view -bS -F 4 -F 8 -F 256 - > ${prefix}.bam | samtools view -bS -F 4 -F 8 -F 256 - > ${prefix}.bam
if [ -f ${prefix}.unmapped.fastq.1.gz ]; then if [ -f ${prefix}.unmapped.fastq.1.gz ]; then

View file

@ -1,24 +1,28 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '2.2.0' def VERSION = '2.2.0'
process HISAT2_BUILD { process HISAT2_BUILD {
tag "$fasta" tag "$fasta"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path fasta path fasta
path gtf path gtf
path splicesites path splicesites
val options
output: output:
path "hisat2", emit: index path "hisat2", emit: index
@ -47,7 +51,6 @@ process HISAT2_BUILD {
} }
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
""" """
mkdir hisat2 mkdir hisat2
$extract_exons $extract_exons
@ -55,7 +58,7 @@ process HISAT2_BUILD {
-p $task.cpus \\ -p $task.cpus \\
$ss \\ $ss \\
$exon \\ $exon \\
$ioptions.args \\ $options.args \\
$fasta \\ $fasta \\
hisat2/${fasta.baseName} hisat2/${fasta.baseName}

View file

@ -1,22 +1,25 @@
// Import generic module functions // Import generic module functions
include { saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
def VERSION = '2.2.0' def VERSION = '2.2.0'
process HISAT2_EXTRACTSPLICESITES { process HISAT2_EXTRACTSPLICESITES {
tag "$gtf" tag "$gtf"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path gtf path gtf
val options
output: output:
path "*.splice_sites.txt", emit: txt path "*.splice_sites.txt", emit: txt

View file

@ -1,6 +1,9 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '4.11' def VERSION = '4.11'
process HOMER_ANNOTATEPEAKS { process HOMER_ANNOTATEPEAKS {
@ -8,18 +11,19 @@ process HOMER_ANNOTATEPEAKS {
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(peak) tuple val(meta), path(peak)
path fasta path fasta
path gtf path gtf
val options
output: output:
tuple val(meta), path("*annotatePeaks.txt"), emit: txt tuple val(meta), path("*annotatePeaks.txt"), emit: txt
@ -27,13 +31,12 @@ process HOMER_ANNOTATEPEAKS {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
annotatePeaks.pl \\ annotatePeaks.pl \\
$peak \\ $peak \\
$fasta \\ $fasta \\
$ioptions.args \\ $options.args \\
-gtf $gtf \\ -gtf $gtf \\
-cpu $task.cpus \\ -cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt > ${prefix}.annotatePeaks.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process MACS2_CALLPEAK { process MACS2_CALLPEAK {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(ipbam), path(controlbam) tuple val(meta), path(ipbam), path(controlbam)
val macs2_gsize val macs2_gsize
val options
output: output:
tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak
@ -29,14 +33,13 @@ process MACS2_CALLPEAK {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def format = meta.single_end ? 'BAM' : 'BAMPE' def format = meta.single_end ? 'BAM' : 'BAMPE'
def control = controlbam ? "--control $controlbam" : '' def control = controlbam ? "--control $controlbam" : ''
""" """
macs2 \\ macs2 \\
callpeak \\ callpeak \\
$ioptions.args \\ $options.args \\
--gsize $macs2_gsize \\ --gsize $macs2_gsize \\
--format $format \\ --format $format \\
--name $prefix \\ --name $prefix \\

View file

@ -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"
}
}
}

View file

@ -1,6 +1,9 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '1.2.2' def VERSION = '1.2.2'
process PHANTOMPEAKQUALTOOLS { process PHANTOMPEAKQUALTOOLS {
@ -8,16 +11,17 @@ process PHANTOMPEAKQUALTOOLS {
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.out") , emit: spp tuple val(meta), path("*.out") , emit: spp
@ -27,8 +31,7 @@ process PHANTOMPEAKQUALTOOLS {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
RUN_SPP=`which run_spp.R` 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 Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_COLLECTMULTIPLEMETRICS { process PICARD_COLLECTMULTIPLEMETRICS {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path fasta path fasta
val options
output: output:
tuple val(meta), path("*_metrics"), emit: metrics tuple val(meta), path("*_metrics"), emit: metrics
@ -25,8 +29,7 @@ process PICARD_COLLECTMULTIPLEMETRICS {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' 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 \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
CollectMultipleMetrics \\ CollectMultipleMetrics \\
$ioptions.args \\ $options.args \\
INPUT=$bam \\ INPUT=$bam \\
OUTPUT=${prefix}.CollectMultipleMetrics \\ OUTPUT=${prefix}.CollectMultipleMetrics \\
REFERENCE_SEQUENCE=$fasta REFERENCE_SEQUENCE=$fasta

View file

@ -25,7 +25,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -43,11 +43,6 @@ input:
- fasta: - fasta:
type: file type: file
description: Genome fasta file description: Genome fasta file
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { PICARD_COLLECTMULTIPLEMETRICS } from '../main.nf' include { PICARD_COLLECTMULTIPLEMETRICS } from '../main.nf' addParams( options: [:] )
workflow test { workflow test {
@ -12,8 +12,7 @@ workflow test {
PICARD_COLLECTMULTIPLEMETRICS ( PICARD_COLLECTMULTIPLEMETRICS (
input, input,
file("${baseDir}/input/NC_010473.fa", checkIfExists: true), file("${baseDir}/input/NC_010473.fa", checkIfExists: true)
[:]
) )
} }

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_MARKDUPLICATES { process PICARD_MARKDUPLICATES {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.bam") , emit: bam
@ -24,8 +28,7 @@ process PICARD_MARKDUPLICATES {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' 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 \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
MarkDuplicates \\ MarkDuplicates \\
$ioptions.args \\ $options.args \\
INPUT=$bam \\ INPUT=$bam \\
OUTPUT=${prefix}.bam \\ OUTPUT=${prefix}.bam \\
METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt

View file

@ -25,7 +25,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -40,11 +40,6 @@ input:
type: file type: file
description: BAM file description: BAM file
pattern: "*.{bam}" pattern: "*.{bam}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { PICARD_MARKDUPLICATES } from '../main.nf' include { PICARD_MARKDUPLICATES } from '../main.nf' addParams( options: [:] )
workflow test { workflow test {
@ -10,7 +10,7 @@ workflow test {
input = [ [ id:'test', single_end:false ], // meta map input = [ [ id:'test', single_end:false ], // meta map
file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ]
PICARD_MARKDUPLICATES ( input, [:] ) PICARD_MARKDUPLICATES ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_MERGESAMFILES { process PICARD_MERGESAMFILES {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bams) tuple val(meta), path(bams)
val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -23,8 +27,7 @@ process PICARD_MERGESAMFILES {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def bam_files = bams.sort() def bam_files = bams.sort()
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
@ -37,7 +40,7 @@ process PICARD_MERGESAMFILES {
picard \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
MergeSamFiles \\ MergeSamFiles \\
$ioptions.args \\ $options.args \\
${'INPUT='+bam_files.join(' INPUT=')} \\ ${'INPUT='+bam_files.join(' INPUT=')} \\
OUTPUT=${prefix}.bam OUTPUT=${prefix}.bam
echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt

View file

@ -23,7 +23,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -38,11 +38,6 @@ input:
type: file type: file
description: List of BAM files description: List of BAM files
pattern: "*.{bam}" pattern: "*.{bam}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { PICARD_MERGESAMFILES } from '../main.nf' include { PICARD_MERGESAMFILES } from '../main.nf' addParams( options: [:] )
workflow test { 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", checkIfExists: true),
file("${baseDir}/input/test.paired_end.COPY.sorted.bam", checkIfExists: true), ] ] file("${baseDir}/input/test.paired_end.COPY.sorted.bam", checkIfExists: true), ] ]
PICARD_MERGESAMFILES ( input, [:] ) PICARD_MERGESAMFILES ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PRESEQ_LCEXTRAP { process PRESEQ_LCEXTRAP {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
label 'error_ignore' label 'error_ignore'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.ccurve.txt"), emit: ccurve tuple val(meta), path("*.ccurve.txt"), emit: ccurve
@ -25,13 +29,12 @@ process PRESEQ_LCEXTRAP {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-pe' def paired_end = meta.single_end ? '' : '-pe'
""" """
preseq \\ preseq \\
lc_extrap \\ lc_extrap \\
$ioptions.args \\ $options.args \\
$paired_end \\ $paired_end \\
-output ${prefix}.ccurve.txt \\ -output ${prefix}.ccurve.txt \\
$bam $bam

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process QUALIMAP_RNASEQ { process QUALIMAP_RNASEQ {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path gtf path gtf
val options
output: output:
tuple val(meta), path("${prefix}"), emit: results tuple val(meta), path("${prefix}"), emit: results
@ -24,8 +28,7 @@ process QUALIMAP_RNASEQ {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-pe' def paired_end = meta.single_end ? '' : '-pe'
def memory = task.memory.toGiga() + "G" def memory = task.memory.toGiga() + "G"
@ -42,7 +45,7 @@ process QUALIMAP_RNASEQ {
qualimap \\ qualimap \\
--java-mem-size=$memory \\ --java-mem-size=$memory \\
rnaseq \\ rnaseq \\
$ioptions.args \\ $options.args \\
-bam $bam \\ -bam $bam \\
-gtf $gtf \\ -gtf $gtf \\
-p $strandedness \\ -p $strandedness \\

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEM_CALCULATEEXPRESSION { process RSEM_CALCULATEEXPRESSION {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
val options
output: output:
tuple val(meta), path("*.genes.results") , emit: counts_gene tuple val(meta), path("*.genes.results") , emit: counts_gene
@ -31,8 +35,7 @@ process RSEM_CALCULATEEXPRESSION {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def strandedness = '' def strandedness = ''
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -48,7 +51,7 @@ process RSEM_CALCULATEEXPRESSION {
--temporary-folder ./tmp/ \\ --temporary-folder ./tmp/ \\
$strandedness \\ $strandedness \\
$paired_end \\ $paired_end \\
$ioptions.args \\ $options.args \\
$reads \\ $reads \\
\$INDEX \\ \$INDEX \\
$prefix $prefix

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEM_PREPAREREFERENCE { process RSEM_PREPAREREFERENCE {
tag "$fasta" tag "$fasta"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path fasta path fasta
path gtf path gtf
val options
output: output:
path "rsem" , emit: index path "rsem" , emit: index
@ -24,13 +28,12 @@ process RSEM_PREPAREREFERENCE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
""" """
mkdir rsem mkdir rsem
rsem-prepare-reference \\ rsem-prepare-reference \\
--gtf $gtf \\ --gtf $gtf \\
--num-threads $task.cpus \\ --num-threads $task.cpus \\
$ioptions.args \\ $options.args \\
$fasta \\ $fasta \\
rsem/genome rsem/genome

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_BAMSTAT { process RSEQC_BAMSTAT {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.bam_stat.txt"), emit: txt tuple val(meta), path("*.bam_stat.txt"), emit: txt
@ -23,12 +27,11 @@ process RSEQC_BAMSTAT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
bam_stat.py \\ bam_stat.py \\
-i $bam \\ -i $bam \\
$ioptions.args \\ $options.args \\
> ${prefix}.bam_stat.txt > ${prefix}.bam_stat.txt
bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_INFEREXPERIMENT { process RSEQC_INFEREXPERIMENT {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path bed path bed
val options
output: output:
tuple val(meta), path("*.infer_experiment.txt"), emit: txt tuple val(meta), path("*.infer_experiment.txt"), emit: txt
@ -24,13 +28,12 @@ process RSEQC_INFEREXPERIMENT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
infer_experiment.py \\ infer_experiment.py \\
-i $bam \\ -i $bam \\
-r $bed \\ -r $bed \\
$ioptions.args \\ $options.args \\
> ${prefix}.infer_experiment.txt > ${prefix}.infer_experiment.txt
infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_INNERDISTANCE { process RSEQC_INNERDISTANCE {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path bed path bed
val options
output: output:
tuple val(meta), path("*distance.txt"), optional:true, emit: distance tuple val(meta), path("*distance.txt"), optional:true, emit: distance
@ -28,15 +32,14 @@ process RSEQC_INNERDISTANCE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
if (!meta.single_end) { if (!meta.single_end) {
""" """
inner_distance.py \\ inner_distance.py \\
-i $bam \\ -i $bam \\
-r $bed \\ -r $bed \\
-o $prefix \\ -o $prefix \\
$ioptions.args \\ $options.args \\
> stdout.txt > stdout.txt
head -n 2 stdout.txt > ${prefix}.inner_distance_mean.txt head -n 2 stdout.txt > ${prefix}.inner_distance_mean.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_JUNCTIONANNOTATION { process RSEQC_JUNCTIONANNOTATION {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path bed path bed
val options
output: output:
tuple val(meta), path("*.junction.bed"), emit: bed tuple val(meta), path("*.junction.bed"), emit: bed
@ -30,14 +34,13 @@ process RSEQC_JUNCTIONANNOTATION {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
junction_annotation.py \\ junction_annotation.py \\
-i $bam \\ -i $bam \\
-r $bed \\ -r $bed \\
-o $prefix \\ -o $prefix \\
$ioptions.args \\ $options.args \\
2> ${prefix}.junction_annotation.log 2> ${prefix}.junction_annotation.log
junction_annotation.py --version | sed -e "s/junction_annotation.py //g" > ${software}.version.txt junction_annotation.py --version | sed -e "s/junction_annotation.py //g" > ${software}.version.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_JUNCTIONSATURATION { process RSEQC_JUNCTIONSATURATION {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path bed path bed
val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf"), emit: pdf
@ -25,14 +29,13 @@ process RSEQC_JUNCTIONSATURATION {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
junction_saturation.py \\ junction_saturation.py \\
-i $bam \\ -i $bam \\
-r $bed \\ -r $bed \\
-o $prefix \\ -o $prefix \\
$ioptions.args $options.args
junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt
""" """

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_READDISTRIBUTION { process RSEQC_READDISTRIBUTION {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path bed path bed
val options
output: output:
tuple val(meta), path("*.read_distribution.txt"), emit: txt tuple val(meta), path("*.read_distribution.txt"), emit: txt
@ -24,8 +28,7 @@ process RSEQC_READDISTRIBUTION {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
read_distribution.py \\ read_distribution.py \\
-i $bam \\ -i $bam \\

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_READDUPLICATION { process RSEQC_READDUPLICATION {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*seq.DupRate.xls"), emit: seq_xls tuple val(meta), path("*seq.DupRate.xls"), emit: seq_xls
@ -26,13 +30,12 @@ process RSEQC_READDUPLICATION {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
read_duplication.py \\ read_duplication.py \\
-i $bam \\ -i $bam \\
-o $prefix \\ -o $prefix \\
$ioptions.args $options.args
read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt
""" """

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SALMON_INDEX { process SALMON_INDEX {
tag "$fasta" tag "$fasta"
label "process_medium" label "process_medium"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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:'') }
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" 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)
input: input:
path fasta path fasta
val options
output: output:
path "salmon" , emit: index path "salmon" , emit: index
@ -23,13 +27,12 @@ process SALMON_INDEX {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
""" """
salmon \\ salmon \\
index \\ index \\
--threads $task.cpus \\ --threads $task.cpus \\
-t $fasta \\ -t $fasta \\
$ioptions.args \\ $options.args \\
-i salmon -i salmon
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
""" """

View file

@ -1,23 +1,27 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SALMON_QUANT { process SALMON_QUANT {
tag "$meta.id" tag "$meta.id"
label "process_medium" label "process_medium"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
path gtf path gtf
val options
output: output:
tuple val(meta), path("${prefix}"), emit: results tuple val(meta), path("${prefix}"), emit: results
@ -25,8 +29,7 @@ process SALMON_QUANT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}" def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def strandedness = meta.single_end ? 'U' : 'IU' def strandedness = meta.single_end ? 'U' : 'IU'
@ -42,7 +45,7 @@ process SALMON_QUANT {
--libType=$strandedness \\ --libType=$strandedness \\
--index $index \\ --index $index \\
$endedness \\ $endedness \\
$ioptions.args \\ $options.args \\
-o $prefix -o $prefix
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt salmon --version | sed -e "s/salmon //g" > ${software}.version.txt

View file

@ -1,20 +1,23 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_FLAGSTAT { process SAMTOOLS_FLAGSTAT {
tag "$meta.id" tag "$meta.id"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options
output: output:
tuple val(meta), path("*.flagstat"), emit: flagstat tuple val(meta), path("*.flagstat"), emit: flagstat

View file

@ -27,7 +27,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -46,11 +46,6 @@ input:
type: file type: file
description: Index for BAM/CRAM/SAM file description: Index for BAM/CRAM/SAM file
pattern: "*.{bai,crai,sai}" pattern: "*.{bai,crai,sai}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { SAMTOOLS_FLAGSTAT } from '../main.nf' include { SAMTOOLS_FLAGSTAT } from '../main.nf' addParams( options: [:] )
workflow test { 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", checkIfExists: true),
file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ]
SAMTOOLS_FLAGSTAT ( input, [:] ) SAMTOOLS_FLAGSTAT ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,20 +1,23 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_IDXSTATS { process SAMTOOLS_IDXSTATS {
tag "$meta.id" tag "$meta.id"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options
output: output:
tuple val(meta), path("*.idxstats"), emit: idxstats tuple val(meta), path("*.idxstats"), emit: idxstats

View file

@ -28,7 +28,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -47,11 +47,6 @@ input:
type: file type: file
description: Index for BAM/CRAM/SAM file description: Index for BAM/CRAM/SAM file
pattern: "*.{bai,crai,sai}" pattern: "*.{bai,crai,sai}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { SAMTOOLS_IDXSTATS } from '../main.nf' include { SAMTOOLS_IDXSTATS } from '../main.nf' addParams( options: [:] )
workflow test { 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", checkIfExists: true),
file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ]
SAMTOOLS_IDXSTATS ( input, [:] ) SAMTOOLS_IDXSTATS ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,20 +1,23 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_INDEX { process SAMTOOLS_INDEX {
tag "$meta.id" tag "$meta.id"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.bai"), emit: bai tuple val(meta), path("*.bai"), emit: bai

View file

@ -25,7 +25,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -40,11 +40,6 @@ input:
type: file type: file
description: BAM/CRAM/SAM file description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}" pattern: "*.{bam,cram,sam}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { SAMTOOLS_INDEX } from '../main.nf' include { SAMTOOLS_INDEX } from '../main.nf' addParams( options: [:] )
workflow test { workflow test {
@ -10,7 +10,7 @@ workflow test {
input = [ [ id:'test', single_end:false ], // meta map input = [ [ id:'test', single_end:false ], // meta map
file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true) ]
SAMTOOLS_INDEX ( input, [:] ) SAMTOOLS_INDEX ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SAMTOOLS_SORT { process SAMTOOLS_SORT {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -23,10 +27,9 @@ process SAMTOOLS_SORT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.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 echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
""" """
} }

View file

@ -25,7 +25,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -40,11 +40,6 @@ input:
type: file type: file
description: BAM/CRAM/SAM file description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}" pattern: "*.{bam,cram,sam}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { SAMTOOLS_SORT } from '../main.nf' include { SAMTOOLS_SORT } from '../main.nf' addParams( options: [:] )
workflow test { workflow test {
@ -10,7 +10,7 @@ workflow test {
input = [ [ id:'test', single_end:false ], // meta map input = [ [ id:'test', single_end:false ], // meta map
file("${baseDir}/input/test.paired_end.name.sorted.bam", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.name.sorted.bam", checkIfExists: true) ]
SAMTOOLS_SORT ( input, [:] ) SAMTOOLS_SORT ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,20 +1,23 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_STATS { process SAMTOOLS_STATS {
tag "$meta.id" tag "$meta.id"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options
output: output:
tuple val(meta), path("*.stats"), emit: stats tuple val(meta), path("*.stats"), emit: stats

View file

@ -26,7 +26,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -45,11 +45,6 @@ input:
type: file type: file
description: Index for BAM/CRAM/SAM file description: Index for BAM/CRAM/SAM file
pattern: "*.{bai,crai,sai}" pattern: "*.{bai,crai,sai}"
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { SAMTOOLS_STATS } from '../main.nf' include { SAMTOOLS_STATS } from '../main.nf' addParams( options: [:] )
workflow test { 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", checkIfExists: true),
file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ] file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ]
SAMTOOLS_STATS ( input, [:] ) SAMTOOLS_STATS ( input )
} }
workflow { workflow {

View file

@ -2,12 +2,12 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
} }
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,22 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SORTMERNA { process SORTMERNA {
tag "$meta.id" tag "$meta.id"
label "process_high" label "process_high"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path fasta path fasta
val options
output: output:
tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.fastq.gz"), emit: reads
@ -25,8 +29,7 @@ process SORTMERNA {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def Refs = "" def Refs = ""
for (i=0; i<fasta.size(); i++) { Refs+= " --ref ${fasta[i]}" } for (i=0; i<fasta.size(); i++) { Refs+= " --ref ${fasta[i]}" }
@ -39,7 +42,7 @@ process SORTMERNA {
--workdir . \\ --workdir . \\
--aligned rRNA_reads \\ --aligned rRNA_reads \\
--other non_rRNA_reads \\ --other non_rRNA_reads \\
$ioptions.args $options.args
gzip -f < non_rRNA_reads.fq > ${prefix}.fastq.gz gzip -f < non_rRNA_reads.fq > ${prefix}.fastq.gz
mv rRNA_reads.log ${prefix}.sortmerna.log mv rRNA_reads.log ${prefix}.sortmerna.log
@ -58,7 +61,7 @@ process SORTMERNA {
--other non_rRNA_reads \\ --other non_rRNA_reads \\
--paired_in \\ --paired_in \\
--out2 \\ --out2 \\
$ioptions.args $options.args
gzip -f < non_rRNA_reads_fwd.fq > ${prefix}_1.fastq.gz gzip -f < non_rRNA_reads_fwd.fq > ${prefix}_1.fastq.gz
gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz

View file

@ -1,24 +1,28 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STAR_ALIGN { process STAR_ALIGN {
tag "$meta.id" tag "$meta.id"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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. // 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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
path gtf path gtf
val options
output: output:
tuple val(meta), path("*Aligned.out.bam") , emit: bam tuple val(meta), path("*Aligned.out.bam") , emit: bam
@ -34,8 +38,7 @@ process STAR_ALIGN {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def ignore_gtf = params.star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" 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'" 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. \\ --outFileNamePrefix $prefix. \\
$ignore_gtf \\ $ignore_gtf \\
$seq_center \\ $seq_center \\
$ioptions.args $options.args
if [ -f ${prefix}.Unmapped.out.mate1 ]; then if [ -f ${prefix}.Unmapped.out.mate1 ]; then
mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq

View file

@ -1,23 +1,27 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STAR_GENOMEGENERATE { process STAR_GENOMEGENERATE {
tag "$fasta" tag "$fasta"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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. // 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" 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)
input: input:
path fasta path fasta
path gtf path gtf
val options
output: output:
path "star" , emit: index path "star" , emit: index
@ -25,7 +29,6 @@ process STAR_GENOMEGENERATE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
""" """
mkdir star mkdir star
@ -36,7 +39,7 @@ process STAR_GENOMEGENERATE {
--sjdbGTFfile $gtf \\ --sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\ --runThreadN $task.cpus \\
$memory \\ $memory \\
$ioptions.args $options.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt
""" """

View file

@ -1,22 +1,27 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STRINGTIE { process STRINGTIE {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
// 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" 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)
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path gtf path gtf
val options
output: output:
tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf
@ -27,8 +32,7 @@ process STRINGTIE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def strandedness = '' def strandedness = ''
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -45,7 +49,7 @@ process STRINGTIE {
-A ${prefix}.gene_abundance.txt \\ -A ${prefix}.gene_abundance.txt \\
-C ${prefix}.coverage.gtf \\ -C ${prefix}.coverage.gtf \\
-b ${prefix}.ballgown \\ -b ${prefix}.ballgown \\
$ioptions.args $options.args
stringtie --version > ${software}.version.txt stringtie --version > ${software}.version.txt
""" """

View file

@ -1,21 +1,26 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SUBREAD_FEATURECOUNTS { process SUBREAD_FEATURECOUNTS {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
// 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" 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)
input: input:
tuple val(meta), path(bams), path(annotation) tuple val(meta), path(bams), path(annotation)
val options
output: output:
tuple val(meta), path("*featureCounts.txt") , emit: counts tuple val(meta), path("*featureCounts.txt") , emit: counts
@ -24,8 +29,7 @@ process SUBREAD_FEATURECOUNTS {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-p' def paired_end = meta.single_end ? '' : '-p'
def strandedness = 0 def strandedness = 0
@ -36,7 +40,7 @@ process SUBREAD_FEATURECOUNTS {
} }
""" """
featureCounts \\ featureCounts \\
$ioptions.args \\ $options.args \\
$paired_end \\ $paired_end \\
-T $task.cpus \\ -T $task.cpus \\
-a $annotation \\ -a $annotation \\

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process TRIMGALORE { process TRIMGALORE {
tag "$meta.id" tag "$meta.id"
label 'process_high' label 'process_high'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
val options
output: output:
tuple val(meta), path("*.fq.gz") , emit: reads 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 // Added soft-links to original fastqs for consistent naming in MultiQC
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
if (meta.single_end) { if (meta.single_end) {
""" """
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz
trim_galore \\ trim_galore \\
$ioptions.args \\ $options.args \\
--cores $cores \\ --cores $cores \\
--gzip \\ --gzip \\
$c_r1 \\ $c_r1 \\
@ -64,7 +67,7 @@ process TRIMGALORE {
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -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 [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz
trim_galore \\ trim_galore \\
$ioptions.args \\ $options.args \\
--cores $cores \\ --cores $cores \\
--paired \\ --paired \\
--gzip \\ --gzip \\

View file

@ -24,7 +24,7 @@ params:
description: | description: |
Value for the Nextflow `publishDir` mode parameter. Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move. Available: symlink, rellink, link, copy, copyNoFollow, move.
- conda: - enable_conda:
type: boolean type: boolean
description: | description: |
Run the module with Conda using the software specified Run the module with Conda using the software specified
@ -60,11 +60,6 @@ input:
description: | description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data, List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively. respectively.
- options:
type: map
description: |
Groovy Map containing module options for passing command-line arguments and
output file paths.
output: output:
- meta: - meta:
type: map type: map

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2 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 * Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ] [ 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_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ] file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
TRIMGALORE ( input, [ publish_dir:'test_paired_end' ] ) TRIMGALORE_PE ( input )
} }
workflow { workflow {

View file

@ -2,7 +2,7 @@
params { params {
outdir = "output/" outdir = "output/"
publish_dir_mode = "copy" publish_dir_mode = "copy"
conda = false enable_conda = false
clip_r1 = 0 clip_r1 = 0
clip_r2 = 0 clip_r2 = 0
@ -12,7 +12,7 @@ params {
profiles { profiles {
conda { conda {
params.conda = true params.enable_conda = true
} }
docker { docker {
docker.enabled = true docker.enabled = true

View file

@ -1,6 +1,9 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '377' def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG { process UCSC_BEDRAPHTOBIGWIG {
@ -8,17 +11,18 @@ process UCSC_BEDRAPHTOBIGWIG {
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bedgraph) tuple val(meta), path(bedgraph)
path sizes path sizes
val options
output: output:
tuple val(meta), path("*.bigWig"), emit: bigwig tuple val(meta), path("*.bigWig"), emit: bigwig
@ -26,8 +30,7 @@ process UCSC_BEDRAPHTOBIGWIG {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process UMITOOLS_DEDUP { process UMITOOLS_DEDUP {
tag "$meta.id" tag "$meta.id"
label "process_medium" label "process_medium"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -24,14 +28,13 @@ process UMITOOLS_DEDUP {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
umi_tools dedup \\ umi_tools dedup \\
-I $bam \\ -I $bam \\
-S ${prefix}.bam \\ -S ${prefix}.bam \\
--output-stats=$prefix \\ --output-stats=$prefix \\
$ioptions.args \\ $options.args \\
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt
""" """

View file

@ -1,21 +1,25 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process UMITOOLS_EXTRACT { process UMITOOLS_EXTRACT {
tag "$meta.id" tag "$meta.id"
label "process_low" label "process_low"
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, 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) }
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" 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)
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
val options
output: output:
tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.fastq.gz"), emit: reads
@ -24,15 +28,14 @@ process UMITOOLS_EXTRACT {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
if (meta.single_end) { if (meta.single_end) {
""" """
umi_tools \\ umi_tools \\
extract \\ extract \\
-I $reads \\ -I $reads \\
-S ${prefix}.umi_extract.fastq.gz \\ -S ${prefix}.umi_extract.fastq.gz \\
$ioptions.args \\ $options.args \\
> ${prefix}.umi_extract.log > ${prefix}.umi_extract.log
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt
@ -45,7 +48,7 @@ process UMITOOLS_EXTRACT {
--read2-in=${reads[1]} \\ --read2-in=${reads[1]} \\
-S ${prefix}.umi_extract_1.fastq.gz \\ -S ${prefix}.umi_extract_1.fastq.gz \\
--read2-out=${prefix}.umi_extract_2.fastq.gz \\ --read2-out=${prefix}.umi_extract_2.fastq.gz \\
$ioptions.args \\ $options.args \\
> ${prefix}.umi_extract.log > ${prefix}.umi_extract.log
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt