Remove functions file

This commit is contained in:
drpatelh 2020-10-14 18:29:50 +01:00
parent a6aab020df
commit 14525ed50d
32 changed files with 393 additions and 357 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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