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
include { FASTQC } from './modules/nf-core/software/fastqc/main'
include { FASTQC } from './modules/nf-core/software/fastqc/main' addParams( options: [:] )
```
5. We have plans to add other utility commands to help developers install and maintain modules downloaded from this repository so watch this space!
@ -170,7 +170,7 @@ using a combination of `bwa` and `samtools` to output a BAM file instead of a SA
- A module file SHOULD only define input and output files as command-line parameters to be executed within the process.
- All other parameters MUST be provided as a string i.e. `options.args` where `options` is a Groovy Map that MUST be provided in the `input` section of the process.
- All other parameters MUST be provided as a string i.e. `options.args` where `options` is a Groovy Map that MUST be provided via the Nextflow `addParams` option when including the module via `include` in the parent workflow.
- If the tool supports multi-threading then you MUST provide the appropriate parameter using the Nextflow `task` variable e.g. `--threads $task.cpus`.
@ -207,7 +207,7 @@ The [Nextflow `publishDir`](https://www.nextflow.io/docs/latest/process.html#pub
```nextflow
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
```
The `saveFiles` function can be found in the [`functions.nf`](software/fastqc/functions.nf) file of utility functions that will be copied into all module directories. It uses the various publishing `options` specified as input to the module to construct and append the relevant output path to `params.outdir`.

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: A module file SHOULD only define input and output files as command-line parameters.
// All other parameters MUST be provided as a string i.e. "options.args"
// where "options" is a Groovy Map that MUST be provided in the "input:" section of the process.
// where "params.options" is a Groovy Map that MUST be provided via the addParams section of the including workflow.
// Any parameters that need to be evaluated in the context of a particular sample
// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately.
// TODO nf-core: Software that can be piped together SHOULD be added to separate module files
@ -18,6 +18,9 @@ include { initOptions; saveFiles; getSoftwareName } from './functions'
// e.g. bwa mem | samtools view -B -T ref.fasta to output BAM instead of SAM.
// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, "fake files" MAY be used to work around this issue.
params.options = [:]
def options = initOptions(params.options)
// TODO nf-core: Process name MUST be all uppercase,
// "SOFTWARE" and (ideally) "TOOL" MUST be all one word separated by an "_".
process SOFTWARE_TOOL {
@ -31,18 +34,22 @@ process SOFTWARE_TOOL {
mode: params.publish_dir_mode,
// TODO nf-core: If a meta map of sample information is NOT provided in "input:" section
// change "publish_id:meta.id" to initialise an empty string e.g. "publish_id:''".
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
// TODO nf-core: List required Conda packages.
// Software MUST be pinned to channel (i.e. "bioconda") and version (i.e. "1.10") as in the example below.
// Pinning the build too e.g. "bioconda::samtools=1.10=h9402c20_2" is not currently a requirement.
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
// TODO nf-core: Fetch "docker pull" address for latest BioContainer image of software: e.g. https://biocontainers.pro/#/tools/samtools
// Click on the Pacakages and Containers tab, sort by Version and get the portion of the link after the docker pull command where Type is Docker.
// You may need to double-check that you are using the latest version of the software because you may find that containers for older versions have been rebuilt more recently.
// If required, multi-tool containers may also be available and are usually named to start with "mulled".
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
// TODO nf-core: List required Conda packages.
// Software MUST be pinned to channel (i.e. "bioconda") and version (i.e. "1.10") as in the example below.
// Pinning the build too e.g. "bioconda::samtools=1.10=h9402c20_2" is not currently a requirement.
conda (params.conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
// TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group"
@ -52,9 +59,7 @@ process SOFTWARE_TOOL {
// TODO nf-core: Where applicable please provide/convert compressed files as input/output
// e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc.
tuple val(meta), path(reads)
// TODO nf-core: List additional required input channels/values here
val options
output:
// TODO nf-core: Named file extensions MUST be emitted for ALL output channels
// TODO nf-core: If meta is provided in "input:" section then it MUST be added to ALL output channels (except version)
@ -64,19 +69,18 @@ process SOFTWARE_TOOL {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
// TODO nf-core: If a meta map of sample information is NOT provided in "input:" section delete the line below
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
// TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10
// If the software is unable to output a version number on the command-line then it can be manually specified
// e.g. https://github.com/nf-core/modules/blob/master/software/homer/annotatepeaks/main.nf
// TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "$ioptions.args" variable
// TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "$options.args" variable
// TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter
// using the Nextflow "task" variable e.g. "--threads $task.cpus"
// TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;)
"""
software tool \\
$ioptions.args \\
$options.args \\
--threads $task.cpus \\
$reads \\
> ${prefix}.bam

View file

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

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2
include { FASTQC } from '../main.nf'
include { FASTQC as FASTQC_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] )
include { FASTQC as FASTQC_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] )
/*
* Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_single_end' ] )
FASTQC_SE ( input )
}
/*
@ -26,7 +27,7 @@ workflow test_paired_end {
[ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_paired_end' ] )
FASTQC_PE ( input )
}
workflow {

View file

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

View file

@ -1,31 +1,34 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process BWA_INDEX {
tag "$fasta"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "biocontainers/bwa:v0.7.17_cv1"
//container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7"
conda (params.conda ? "bioconda::bwa=0.7.17" : null)
conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7"
} else {
container "biocontainers/bwa:v0.7.17_cv1"
}
input:
path fasta
val options
output:
path "${fasta}.*" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
"""
bwa index $ioptions.args $fasta
bwa index $options.args $fasta
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""
}

View file

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

View file

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

View file

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

View file

@ -1,41 +1,44 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process BWA_MEM {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
//container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
} else {
container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
}
input:
tuple val(meta), path(reads)
path index
path fasta
val options
output:
tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
"""
bwa mem \\
$ioptions.args \\
$options.args \\
$read_group \\
-t $task.cpus \\
$fasta \\
$reads \\
| samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam -
| samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam -
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""

View file

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

View file

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

View file

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

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_COMPUTEMATRIX {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
} else {
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
}
input:
tuple val(meta), path(bigwig)
path bed
val options
output:
tuple val(meta), path("*.mat.gz") , emit: matrix
tuple val(meta), path("*.mat.tab"), emit: table
@ -25,11 +29,10 @@ process DEEPTOOLS_COMPUTEMATRIX {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
computeMatrix \\
$ioptions.args \\
$options.args \\
--regionsFileName $bed \\
--scoreFileName $bigwig \\
--outFileName ${prefix}.computeMatrix.mat.gz \\

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTFINGERPRINT {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
} else {
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
}
input:
tuple val(meta), path(bams), path(bais)
val options
output:
tuple val(meta), path("*.pdf") , emit: pdf
tuple val(meta), path("*.raw.txt") , emit: matrix
@ -25,12 +29,11 @@ process DEEPTOOLS_PLOTFINGERPRINT {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : ''
"""
plotFingerprint \\
$ioptions.args \\
$options.args \\
$extend \\
--bamfiles ${bams.join(' ')} \\
--plotFile ${prefix}.plotFingerprint.pdf \\

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTHEATMAP {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
} else {
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
}
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTHEATMAP {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
plotHeatmap \\
$ioptions.args \\
$options.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotHeatmap.pdf \\
--outFileNameMatrix ${prefix}.plotHeatmap.mat.tab

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process DEEPTOOLS_PLOTPROFILE {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
conda (params.enable_conda ? "bioconda::deeptools=3.4.3" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
} else {
container "quay.io/biocontainers/deeptools:3.4.3--py_0"
}
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
@ -24,11 +28,10 @@ process DEEPTOOLS_PLOTPROFILE {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
plotProfile \\
$ioptions.args \\
$options.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotProfile.pdf \\
--outFileNameData ${prefix}.plotProfile.tab

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/fastqc:0.11.9--0"
//container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0"
conda (params.conda ? "bioconda::fastqc=0.11.9" : null)
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
conda (params.enable_conda ? "bioconda::fastqc=0.11.9" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0"
} else {
container "quay.io/biocontainers/fastqc:0.11.9--0"
}
input:
tuple val(meta), path(reads)
val options
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip") , emit: zip
@ -25,19 +29,18 @@ process FASTQC {
script:
// Add soft-links to original FastQs for consistent naming in pipeline
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}.${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}"
if (meta.single_end) {
"""
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz
fastqc $ioptions.args --threads $task.cpus ${prefix}.fastq.gz
fastqc $options.args --threads $task.cpus ${prefix}.fastq.gz
fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt
"""
} else {
"""
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz
[ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz
fastqc $ioptions.args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz
fastqc $options.args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz
fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt
"""
}

View file

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

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2
include { FASTQC } from '../main.nf'
include { FASTQC as FASTQC_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] )
include { FASTQC as FASTQC_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] )
/*
* Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_single_end' ] )
FASTQC_SE ( input )
}
/*
@ -26,7 +27,7 @@ workflow test_paired_end {
[ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
FASTQC ( input, [ publish_dir:'test_paired_end' ] )
FASTQC_PE ( input )
}
workflow {

View file

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

View file

@ -1,30 +1,33 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process GFFREAD {
tag "$gff"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "quay.io/biocontainers/gffread:0.12.1--h8b12597_0"
//container https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0
conda (params.conda ? "bioconda::gffread=0.12.1" : null)
conda (params.enable_conda ? "bioconda::gffread=0.12.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0"
} else {
container "quay.io/biocontainers/gffread:0.12.1--h8b12597_0"
}
input:
path gff
val options
output:
path "*.gtf" , emit: gtf
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
"""
gffread $gff $ioptions.args -o ${gff.baseName}.gtf
gffread $gff $options.args -o ${gff.baseName}.gtf
echo \$(gffread --version 2>&1) > ${software}.version.txt
"""
}

View file

@ -1,6 +1,9 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '2.2.0'
process HISAT2_ALIGN {
@ -8,19 +11,20 @@ process HISAT2_ALIGN {
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0"
//container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0"
conda (params.conda ? "bioconda::hisat2=2.2.0 bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::hisat2=2.2.0 bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0"
} else {
container "quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0"
}
input:
tuple val(meta), path(reads)
path index
path splicesites
val options
output:
tuple val(meta), path("*.bam"), emit: bam
tuple val(meta), path("*.log"), emit: summary
@ -30,8 +34,7 @@ process HISAT2_ALIGN {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def strandedness = ''
if (meta.strandedness == 'forward') {
@ -53,7 +56,7 @@ process HISAT2_ALIGN {
--threads $task.cpus \\
$seq_center \\
$unaligned \\
$ioptions.args \\
$options.args \\
| samtools view -bS -F 4 -F 256 - > ${prefix}.bam
echo $VERSION > ${software}.version.txt
@ -74,7 +77,7 @@ process HISAT2_ALIGN {
$unaligned \\
--no-mixed \\
--no-discordant \\
$ioptions.args \\
$options.args \\
| samtools view -bS -F 4 -F 8 -F 256 - > ${prefix}.bam
if [ -f ${prefix}.unmapped.fastq.1.gz ]; then

View file

@ -1,24 +1,28 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '2.2.0'
process HISAT2_BUILD {
tag "$fasta"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4"
//container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
conda (params.conda ? "bioconda::hisat2=2.2.0" : null)
conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
} else {
container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4"
}
input:
path fasta
path gtf
path splicesites
val options
output:
path "hisat2", emit: index
@ -47,7 +51,6 @@ process HISAT2_BUILD {
}
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
"""
mkdir hisat2
$extract_exons
@ -55,7 +58,7 @@ process HISAT2_BUILD {
-p $task.cpus \\
$ss \\
$exon \\
$ioptions.args \\
$options.args \\
$fasta \\
hisat2/${fasta.baseName}

View file

@ -1,22 +1,25 @@
// Import generic module functions
include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
def VERSION = '2.2.0'
process HISAT2_EXTRACTSPLICESITES {
tag "$gtf"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4"
//container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
conda (params.conda ? "bioconda::hisat2=2.2.0" : null)
conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
} else {
container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4"
}
input:
path gtf
val options
output:
path "*.splice_sites.txt", emit: txt

View file

@ -1,6 +1,9 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '4.11'
process HOMER_ANNOTATEPEAKS {
@ -8,18 +11,19 @@ process HOMER_ANNOTATEPEAKS {
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2"
//container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2"
conda (params.conda ? "bioconda::homer=4.11" : null)
conda (params.enable_conda ? "bioconda::homer=4.11" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2"
} else {
container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2"
}
input:
tuple val(meta), path(peak)
path fasta
path gtf
val options
output:
tuple val(meta), path("*annotatePeaks.txt"), emit: txt
@ -27,13 +31,12 @@ process HOMER_ANNOTATEPEAKS {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
annotatePeaks.pl \\
$peak \\
$fasta \\
$ioptions.args \\
$options.args \\
-gtf $gtf \\
-cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process MACS2_CALLPEAK {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0"
//container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0"
conda (params.conda ? "bioconda::macs2=2.2.7.1" : null)
conda (params.enable_conda ? "bioconda::macs2=2.2.7.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0"
} else {
container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0"
}
input:
tuple val(meta), path(ipbam), path(controlbam)
val macs2_gsize
val options
output:
tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak
tuple val(meta), path("*.xls") , emit: xls
@ -29,14 +33,13 @@ process MACS2_CALLPEAK {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def format = meta.single_end ? 'BAM' : 'BAMPE'
def control = controlbam ? "--control $controlbam" : ''
"""
macs2 \\
callpeak \\
$ioptions.args \\
$options.args \\
--gsize $macs2_gsize \\
--format $format \\
--name $prefix \\

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
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '1.2.2'
process PHANTOMPEAKQUALTOOLS {
@ -8,17 +11,18 @@ process PHANTOMPEAKQUALTOOLS {
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0"
//container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0"
conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null)
conda (params.enable_conda ? "bioconda::phantompeakqualtools=1.2.2" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0"
} else {
container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.out") , emit: spp
tuple val(meta), path("*.pdf") , emit: pdf
@ -27,8 +31,7 @@ process PHANTOMPEAKQUALTOOLS {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
RUN_SPP=`which run_spp.R`
Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_COLLECTMULTIPLEMETRICS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.6--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
conda (params.conda ? "bioconda::picard=2.23.6" : null)
conda (params.enable_conda ? "bioconda::picard=2.23.6" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
} else {
container "quay.io/biocontainers/picard:2.23.6--0"
}
input:
tuple val(meta), path(bam)
path fasta
val options
output:
tuple val(meta), path("*_metrics"), emit: metrics
@ -25,8 +29,7 @@ process PICARD_COLLECTMULTIPLEMETRICS {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
@ -37,7 +40,7 @@ process PICARD_COLLECTMULTIPLEMETRICS {
picard \\
-Xmx${avail_mem}g \\
CollectMultipleMetrics \\
$ioptions.args \\
$options.args \\
INPUT=$bam \\
OUTPUT=${prefix}.CollectMultipleMetrics \\
REFERENCE_SEQUENCE=$fasta

View file

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

View file

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

View file

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

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_MARKDUPLICATES {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.6--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
conda (params.conda ? "bioconda::picard=2.23.6" : null)
conda (params.enable_conda ? "bioconda::picard=2.23.6" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
} else {
container "quay.io/biocontainers/picard:2.23.6--0"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.metrics.txt"), emit: metrics
@ -24,8 +28,7 @@ process PICARD_MARKDUPLICATES {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
@ -36,7 +39,7 @@ process PICARD_MARKDUPLICATES {
picard \\
-Xmx${avail_mem}g \\
MarkDuplicates \\
$ioptions.args \\
$options.args \\
INPUT=$bam \\
OUTPUT=${prefix}.bam \\
METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt

View file

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

View file

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

View file

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

View file

@ -1,30 +1,33 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PICARD_MERGESAMFILES {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.6--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
conda (params.conda ? "bioconda::picard=2.23.6" : null)
conda (params.enable_conda ? "bioconda::picard=2.23.6" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/picard:2.23.6--0"
} else {
container "quay.io/biocontainers/picard:2.23.6--0"
}
input:
tuple val(meta), path(bams)
val options
output:
tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def bam_files = bams.sort()
def avail_mem = 3
if (!task.memory) {
@ -37,7 +40,7 @@ process PICARD_MERGESAMFILES {
picard \\
-Xmx${avail_mem}g \\
MergeSamFiles \\
$ioptions.args \\
$options.args \\
${'INPUT='+bam_files.join(' INPUT=')} \\
OUTPUT=${prefix}.bam
echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt

View file

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

View file

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

View file

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

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process PRESEQ_LCEXTRAP {
tag "$meta.id"
label 'process_medium'
label 'error_ignore'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/preseq:2.0.3--hf53bd2b_3"
//container "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3"
conda (params.conda ? "bioconda::preseq=2.0.3" : null)
conda (params.enable_conda ? "bioconda::preseq=2.0.3" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3"
} else {
container "quay.io/biocontainers/preseq:2.0.3--hf53bd2b_3"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.ccurve.txt"), emit: ccurve
tuple val(meta), path("*.log") , emit: log
@ -25,13 +29,12 @@ process PRESEQ_LCEXTRAP {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-pe'
"""
preseq \\
lc_extrap \\
$ioptions.args \\
$options.args \\
$paired_end \\
-output ${prefix}.ccurve.txt \\
$bam

View file

@ -1,31 +1,34 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process QUALIMAP_RNASEQ {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/qualimap:2.2.2d--1"
//container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1"
conda (params.conda ? "bioconda::qualimap=2.2.2d" : null)
conda (params.enable_conda ? "bioconda::qualimap=2.2.2d" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1"
} else {
container "quay.io/biocontainers/qualimap:2.2.2d--1"
}
input:
tuple val(meta), path(bam)
path gtf
val options
output:
tuple val(meta), path("${prefix}"), emit: results
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-pe'
def memory = task.memory.toGiga() + "G"
@ -42,7 +45,7 @@ process QUALIMAP_RNASEQ {
qualimap \\
--java-mem-size=$memory \\
rnaseq \\
$ioptions.args \\
$options.args \\
-bam $bam \\
-gtf $gtf \\
-p $strandedness \\

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEM_CALCULATEEXPRESSION {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
//container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
conda (params.conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null)
conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
} else {
container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
}
input:
tuple val(meta), path(reads)
path index
val options
output:
tuple val(meta), path("*.genes.results") , emit: counts_gene
tuple val(meta), path("*.isoforms.results"), emit: counts_transcript
@ -31,8 +35,7 @@ process RSEM_CALCULATEEXPRESSION {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def strandedness = ''
if (meta.strandedness == 'forward') {
@ -48,7 +51,7 @@ process RSEM_CALCULATEEXPRESSION {
--temporary-folder ./tmp/ \\
$strandedness \\
$paired_end \\
$ioptions.args \\
$options.args \\
$reads \\
\$INDEX \\
$prefix

View file

@ -1,36 +1,39 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEM_PREPAREREFERENCE {
tag "$fasta"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
//container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
conda (params.conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null)
conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
} else {
container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
}
input:
path fasta
path gtf
val options
output:
path "rsem" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
"""
mkdir rsem
rsem-prepare-reference \\
--gtf $gtf \\
--num-threads $task.cpus \\
$ioptions.args \\
$options.args \\
$fasta \\
rsem/genome

View file

@ -1,34 +1,37 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_BAMSTAT {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.bam_stat.txt"), emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bam_stat.py \\
-i $bam \\
$ioptions.args \\
$options.args \\
> ${prefix}.bam_stat.txt
bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt

View file

@ -1,36 +1,39 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_INFEREXPERIMENT {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
path bed
val options
output:
tuple val(meta), path("*.infer_experiment.txt"), emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
infer_experiment.py \\
-i $bam \\
-r $bed \\
$ioptions.args \\
$options.args \\
> ${prefix}.infer_experiment.txt
infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_INNERDISTANCE {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
path bed
val options
output:
tuple val(meta), path("*distance.txt"), optional:true, emit: distance
tuple val(meta), path("*freq.txt") , optional:true, emit: freq
@ -28,15 +32,14 @@ process RSEQC_INNERDISTANCE {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
if (!meta.single_end) {
"""
inner_distance.py \\
-i $bam \\
-r $bed \\
-o $prefix \\
$ioptions.args \\
$options.args \\
> stdout.txt
head -n 2 stdout.txt > ${prefix}.inner_distance_mean.txt

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_JUNCTIONANNOTATION {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
path bed
val options
output:
tuple val(meta), path("*.junction.bed"), emit: bed
tuple val(meta), path("*.Interact.bed"), emit: interact_bed
@ -30,14 +34,13 @@ process RSEQC_JUNCTIONANNOTATION {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
junction_annotation.py \\
-i $bam \\
-r $bed \\
-o $prefix \\
$ioptions.args \\
$options.args \\
2> ${prefix}.junction_annotation.log
junction_annotation.py --version | sed -e "s/junction_annotation.py //g" > ${software}.version.txt

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_JUNCTIONSATURATION {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
path bed
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.r") , emit: rscript
@ -25,14 +29,13 @@ process RSEQC_JUNCTIONSATURATION {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
junction_saturation.py \\
-i $bam \\
-r $bed \\
-o $prefix \\
$ioptions.args
$options.args
junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt
"""

View file

@ -1,31 +1,34 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_READDISTRIBUTION {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
path bed
val options
output:
tuple val(meta), path("*.read_distribution.txt"), emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
read_distribution.py \\
-i $bam \\

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process RSEQC_READDUPLICATION {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::rseqc=3.0.1" : null)
conda (params.enable_conda ? "bioconda::rseqc=3.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*seq.DupRate.xls"), emit: seq_xls
tuple val(meta), path("*pos.DupRate.xls"), emit: pos_xls
@ -26,13 +30,12 @@ process RSEQC_READDUPLICATION {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
read_duplication.py \\
-i $bam \\
-o $prefix \\
$ioptions.args
$options.args
read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt
"""

View file

@ -1,35 +1,38 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SALMON_INDEX {
tag "$fasta"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
//container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
conda (params.conda ? "bioconda::salmon=1.3.0" : null)
conda (params.enable_conda ? "bioconda::salmon=1.3.0" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
} else {
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
}
input:
path fasta
val options
output:
path "salmon" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def software = getSoftwareName(task.process)
"""
salmon \\
index \\
--threads $task.cpus \\
-t $fasta \\
$ioptions.args \\
$options.args \\
-i salmon
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
"""

View file

@ -1,32 +1,35 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SALMON_QUANT {
tag "$meta.id"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
//container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
conda (params.conda ? "bioconda::salmon=1.3.0" : null)
conda (params.enable_conda ? "bioconda::salmon=1.3.0" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
} else {
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
}
input:
tuple val(meta), path(reads)
path index
path gtf
val options
output:
tuple val(meta), path("${prefix}"), emit: results
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def strandedness = meta.single_end ? 'U' : 'IU'
@ -42,7 +45,7 @@ process SALMON_QUANT {
--libType=$strandedness \\
--index $index \\
$endedness \\
$ioptions.args \\
$options.args \\
-o $prefix
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt

View file

@ -1,21 +1,24 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_FLAGSTAT {
tag "$meta.id"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
conda (params.conda ? "bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
tuple val(meta), path(bam), path(bai)
val options
output:
tuple val(meta), path("*.flagstat"), emit: flagstat
path "*.version.txt" , emit: version

View file

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

View file

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

View file

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

View file

@ -1,21 +1,24 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_IDXSTATS {
tag "$meta.id"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
conda (params.conda ? "bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
tuple val(meta), path(bam), path(bai)
val options
output:
tuple val(meta), path("*.idxstats"), emit: idxstats
path "*.version.txt" , emit: version

View file

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

View file

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

View file

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

View file

@ -1,21 +1,24 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_INDEX {
tag "$meta.id"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
conda (params.conda ? "bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.bai"), emit: bai
path "*.version.txt" , emit: version

View file

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

View file

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

View file

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

View file

@ -1,32 +1,35 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SAMTOOLS_SORT {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
conda (params.conda ? "bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
samtools sort $ioptions.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam
samtools sort $options.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
"""
}

View file

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

View file

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

View file

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

View file

@ -1,21 +1,24 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
include { saveFiles; getSoftwareName } from './functions'
params.options = [:]
process SAMTOOLS_STATS {
tag "$meta.id"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
conda (params.conda ? "bioconda::samtools=1.10" : null)
conda (params.enable_conda ? "bioconda::samtools=1.10" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
} else {
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
}
input:
tuple val(meta), path(bam), path(bai)
val options
output:
tuple val(meta), path("*.stats"), emit: stats
path "*.version.txt" , emit: version

View file

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

View file

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

View file

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

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SORTMERNA {
tag "$meta.id"
label "process_high"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/sortmerna:4.2.0--0"
//container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0"
conda (params.conda ? "bioconda::sortmerna=4.2.0" : null)
conda (params.enable_conda ? "bioconda::sortmerna=4.2.0" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0"
} else {
container "quay.io/biocontainers/sortmerna:4.2.0--0"
}
input:
tuple val(meta), path(reads)
path fasta
val options
output:
tuple val(meta), path("*.fastq.gz"), emit: reads
tuple val(meta), path("*.log") , emit: log
@ -25,8 +29,7 @@ process SORTMERNA {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def Refs = ""
for (i=0; i<fasta.size(); i++) { Refs+= " --ref ${fasta[i]}" }
@ -39,7 +42,7 @@ process SORTMERNA {
--workdir . \\
--aligned rRNA_reads \\
--other non_rRNA_reads \\
$ioptions.args
$options.args
gzip -f < non_rRNA_reads.fq > ${prefix}.fastq.gz
mv rRNA_reads.log ${prefix}.sortmerna.log
@ -58,7 +61,7 @@ process SORTMERNA {
--other non_rRNA_reads \\
--paired_in \\
--out2 \\
$ioptions.args
$options.args
gzip -f < non_rRNA_reads_fwd.fq > ${prefix}_1.fastq.gz
gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz

View file

@ -1,25 +1,29 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STAR_ALIGN {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
// Don't upgrade me - 2.7X indices incompatible with iGenomes.
container "quay.io/biocontainers/star:2.6.1d--0"
//container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
conda (params.conda ? "bioconda::star=2.6.1d" : null)
// Note: 2.7X indices incompatible with AWS iGenomes.
conda (params.enable_conda ? "bioconda::star=2.6.1d" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
} else {
container "quay.io/biocontainers/star:2.6.1d--0"
}
input:
tuple val(meta), path(reads)
path index
path gtf
val options
output:
tuple val(meta), path("*Aligned.out.bam") , emit: bam
tuple val(meta), path("*Log.final.out") , emit: log_final
@ -34,8 +38,7 @@ process STAR_ALIGN {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def ignore_gtf = params.star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf"
def seq_center = params.seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$params.seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'"
"""
@ -46,7 +49,7 @@ process STAR_ALIGN {
--outFileNamePrefix $prefix. \\
$ignore_gtf \\
$seq_center \\
$ioptions.args
$options.args
if [ -f ${prefix}.Unmapped.out.mate1 ]; then
mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq

View file

@ -1,23 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STAR_GENOMEGENERATE {
tag "$fasta"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
// Don't upgrade me - 2.7X indices incompatible with iGenomes.
container "quay.io/biocontainers/star:2.6.1d--0"
//container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
conda (params.conda ? "bioconda::star=2.6.1d" : null)
// Note: 2.7X indices incompatible with AWS iGenomes.
conda (params.enable_conda ? "bioconda::star=2.6.1d" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
} else {
container "quay.io/biocontainers/star:2.6.1d--0"
}
input:
path fasta
path gtf
val options
output:
path "star" , emit: index
@ -25,7 +29,6 @@ process STAR_GENOMEGENERATE {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
"""
mkdir star
@ -36,7 +39,7 @@ process STAR_GENOMEGENERATE {
--sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\
$memory \\
$ioptions.args
$options.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt
"""

View file

@ -1,23 +1,28 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process STRINGTIE {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0"
//container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0"
conda (params.conda ? "bioconda::stringtie=2.1.4" : null)
// Note: 2.7X indices incompatible with AWS iGenomes.
conda (params.enable_conda ? "bioconda::stringtie=2.1.4" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0"
} else {
container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0"
}
input:
tuple val(meta), path(bam)
path gtf
val options
output:
tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf
tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf
@ -27,8 +32,7 @@ process STRINGTIE {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def strandedness = ''
if (meta.strandedness == 'forward') {
@ -45,7 +49,7 @@ process STRINGTIE {
-A ${prefix}.gene_abundance.txt \\
-C ${prefix}.coverage.gtf \\
-b ${prefix}.ballgown \\
$ioptions.args
$options.args
stringtie --version > ${software}.version.txt
"""

View file

@ -1,22 +1,27 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process SUBREAD_FEATURECOUNTS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/subread:2.0.1--hed695b0_0"
//container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0"
conda (params.conda ? "bioconda::subread=2.0.1" : null)
// Note: 2.7X indices incompatible with AWS iGenomes.
conda (params.enable_conda ? "bioconda::subread=2.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0"
} else {
container "quay.io/biocontainers/subread:2.0.1--hed695b0_0"
}
input:
tuple val(meta), path(bams), path(annotation)
val options
output:
tuple val(meta), path("*featureCounts.txt") , emit: counts
tuple val(meta), path("*featureCounts.txt.summary"), emit: summary
@ -24,8 +29,7 @@ process SUBREAD_FEATURECOUNTS {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-p'
def strandedness = 0
@ -36,7 +40,7 @@ process SUBREAD_FEATURECOUNTS {
}
"""
featureCounts \\
$ioptions.args \\
$options.args \\
$paired_end \\
-T $task.cpus \\
-a $annotation \\

View file

@ -1,21 +1,25 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process TRIMGALORE {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/trim-galore:0.6.6--0"
//container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.6--0"
conda (params.conda ? "bioconda::trim-galore=0.6.6" : null)
conda (params.enable_conda ? "bioconda::trim-galore=0.6.6" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.6--0"
} else {
container "quay.io/biocontainers/trim-galore:0.6.6--0"
}
input:
tuple val(meta), path(reads)
val options
output:
tuple val(meta), path("*.fq.gz") , emit: reads
@ -45,13 +49,12 @@ process TRIMGALORE {
// Added soft-links to original fastqs for consistent naming in MultiQC
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
if (meta.single_end) {
"""
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz
trim_galore \\
$ioptions.args \\
$options.args \\
--cores $cores \\
--gzip \\
$c_r1 \\
@ -64,7 +67,7 @@ process TRIMGALORE {
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz
[ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz
trim_galore \\
$ioptions.args \\
$options.args \\
--cores $cores \\
--paired \\
--gzip \\

View file

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

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2
include { TRIMGALORE } from '../main.nf'
include { TRIMGALORE as TRIMGALORE_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] )
include { TRIMGALORE as TRIMGALORE_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] )
/*
* Test with single-end data
@ -13,7 +14,7 @@ workflow test_single_end {
input = [ [ id:'test', single_end:true ], // meta map
[ file("${baseDir}/input/test_single_end.fastq.gz", checkIfExists: true) ] ]
TRIMGALORE ( input, [ publish_dir:'test_single_end' ] )
TRIMGALORE_SE ( input )
}
/*
@ -26,7 +27,7 @@ workflow test_paired_end {
[ file("${baseDir}/input/test_R1.fastq.gz", checkIfExists: true),
file("${baseDir}/input/test_R2.fastq.gz", checkIfExists: true) ] ]
TRIMGALORE ( input, [ publish_dir:'test_paired_end' ] )
TRIMGALORE_PE ( input )
}
workflow {

View file

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

View file

@ -1,6 +1,9 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG {
@ -8,26 +11,26 @@ process UCSC_BEDRAPHTOBIGWIG {
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1"
//container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1"
conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null)
conda (params.enable_conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1"
} else {
container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1"
}
input:
tuple val(meta), path(bedgraph)
path sizes
val options
output:
tuple val(meta), path("*.bigWig"), emit: bigwig
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig
echo $VERSION > ${software}.version.txt

View file

@ -1,22 +1,26 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process UMITOOLS_DEDUP {
tag "$meta.id"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::umi_tools=1.0.1" : null)
conda (params.enable_conda ? "bioconda::umi_tools=1.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(bam), path(bai)
val options
output:
tuple val(meta), path("*.bam"), emit: bam
tuple val(meta), path("*.tsv"), emit: tsv
@ -24,14 +28,13 @@ process UMITOOLS_DEDUP {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
umi_tools dedup \\
-I $bam \\
-S ${prefix}.bam \\
--output-stats=$prefix \\
$ioptions.args \\
$options.args \\
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt
"""

View file

@ -1,21 +1,25 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
process UMITOOLS_EXTRACT {
tag "$meta.id"
label "process_low"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1"
//container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1"
conda (params.conda ? "bioconda::umi_tools=1.0.1" : null)
conda (params.enable_conda ? "bioconda::umi_tools=1.0.1" : null)
if (workflow.containerEngine == 'singularity' && !params.pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/umi_tools:1.0.1--py37h516909a_1"
} else {
container "quay.io/biocontainers/umi_tools:1.0.1--py37h516909a_1"
}
input:
tuple val(meta), path(reads)
val options
output:
tuple val(meta), path("*.fastq.gz"), emit: reads
@ -24,15 +28,14 @@ process UMITOOLS_EXTRACT {
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
if (meta.single_end) {
"""
umi_tools \\
extract \\
-I $reads \\
-S ${prefix}.umi_extract.fastq.gz \\
$ioptions.args \\
$options.args \\
> ${prefix}.umi_extract.log
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt
@ -45,7 +48,7 @@ process UMITOOLS_EXTRACT {
--read2-in=${reads[1]} \\
-S ${prefix}.umi_extract_1.fastq.gz \\
--read2-out=${prefix}.umi_extract_2.fastq.gz \\
$ioptions.args \\
$options.args \\
> ${prefix}.umi_extract.log
umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt