Unify syntax

This commit is contained in:
drpatelh 2020-09-10 16:45:11 +01:00
parent cbf8329ffd
commit e438d026bd
28 changed files with 965 additions and 963 deletions

View file

@ -53,14 +53,14 @@ process SOFTWARE_TOOL {
// e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc.
tuple val(meta), path(reads) tuple val(meta), path(reads)
// TODO nf-core: List additional required input channels/values here // TODO nf-core: List additional required input channels/values here
val options val options
output: output:
// TODO nf-core: Named file extensions MUST be emitted for ALL output channels // TODO nf-core: Named file extensions MUST be emitted for ALL output channels
// TODO nf-core: If meta is provided in "input:" section then it MUST be added to ALL output channels (except version) // TODO nf-core: If meta is provided in "input:" section then it MUST be added to ALL output channels (except version)
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
// TODO nf-core: List additional required output channels/values here // TODO nf-core: List additional required output channels/values here
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,10 +15,10 @@ process BWA_INDEX {
input: input:
path fasta path fasta
val options val options
output: output:
path "${fasta}.*", emit: index path "${fasta}.*" , emit: index
path "*.version.txt", emit: version path "*.version.txt", emit: version
script: script:

View file

@ -15,23 +15,23 @@ process BWA_MEM {
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
path fasta path fasta
val options val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def rg = meta.read_group ? "-R ${meta.read_group}" : "" def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
""" """
bwa mem \\ bwa mem \\
$ioptions.args \\ $ioptions.args \\
$rg \\ $read_group \\
-t $task.cpus \\ -t $task.cpus \\
$fasta \\ $fasta \\
$reads \\ $reads \\

View file

@ -15,13 +15,13 @@ process DEEPTOOLS_COMPUTEMATRIX {
input: input:
tuple val(meta), path(bigwig) tuple val(meta), path(bigwig)
path bed path bed
val options val options
output: output:
tuple val(meta), path("*.mat.gz"), emit: matrix tuple val(meta), path("*.mat.gz") , emit: matrix
tuple val(meta), path("*.mat.tab"), emit: table tuple val(meta), path("*.mat.tab"), emit: table
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,13 +15,13 @@ process DEEPTOOLS_PLOTFINGERPRINT {
input: input:
tuple val(meta), path(bams), path(bais) tuple val(meta), path(bams), path(bais)
val options val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf") , emit: pdf
tuple val(meta), path("*.raw.txt"), emit: matrix tuple val(meta), path("*.raw.txt") , emit: matrix
tuple val(meta), path("*.qcmetrics.txt"), emit: metrics tuple val(meta), path("*.qcmetrics.txt"), emit: metrics
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,12 +15,12 @@ process DEEPTOOLS_PLOTHEATMAP {
input: input:
tuple val(meta), path(matrix) tuple val(meta), path(matrix)
val options val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table tuple val(meta), path("*.tab"), emit: table
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,17 +15,17 @@ process DEEPTOOLS_PLOTPROFILE {
input: input:
tuple val(meta), path(matrix) tuple val(meta), path(matrix)
val options val options
output: output:
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table tuple val(meta), path("*.tab"), emit: table
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
plotProfile \\ plotProfile \\
$ioptions.args \\ $ioptions.args \\

View file

@ -15,12 +15,12 @@ process FASTQC {
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
val options val options
output: output:
tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip tuple val(meta), path("*.zip") , emit: zip
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
// Add soft-links to original FastQs for consistent naming in pipeline // Add soft-links to original FastQs for consistent naming in pipeline

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { saveFiles; getSoftwareName } from './functions'
def VERSION = '2.2.0' def VERSION = '2.2.0'

View file

@ -17,13 +17,13 @@ process HOMER_ANNOTATEPEAKS {
input: input:
tuple val(meta), path(peak) tuple val(meta), path(peak)
path fasta path fasta
path gtf path gtf
val options val options
output: output:
tuple val(meta), path("*annotatePeaks.txt"), emit: txt tuple val(meta), path("*annotatePeaks.txt"), emit: txt
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,16 +15,17 @@ process MACS2_CALLPEAK {
input: input:
tuple val(meta), path(ipbam), path(controlbam) tuple val(meta), path(ipbam), path(controlbam)
val macs2_gsize val macs2_gsize
val options val options
output: output:
tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak
tuple val(meta), path("*.xls"), emit: xls tuple val(meta), path("*.xls") , emit: xls
tuple val(meta), path("*.gappedPeak"), emit: gapped optional true path "*.version.txt" , emit: version
tuple val(meta), path("*.bed"), emit: bed optional true
tuple val(meta), path("*.bdg"), emit: bdg optional true tuple val(meta), path("*.gappedPeak"), optional:true, emit: gapped
path "*.version.txt", emit: version tuple val(meta), path("*.bed") , optional:true, emit: bed
tuple val(meta), path("*.bdg") , optional:true, emit: bdg
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -17,13 +17,13 @@ process PHANTOMPEAKQUALTOOLS {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options val options
output: output:
tuple val(meta), path("*.out"), emit: spp tuple val(meta), path("*.out") , emit: spp
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf") , emit: pdf
tuple val(meta), path("*.Rdata"), emit: rdata tuple val(meta), path("*.Rdata"), emit: rdata
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,13 +15,13 @@ process PICARD_COLLECTMULTIPLEMETRICS {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path fasta path fasta
val options val options
output: output:
tuple val(meta), path("*_metrics"), emit: metrics tuple val(meta), path("*_metrics"), emit: metrics
tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.pdf") , emit: pdf
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,12 +15,12 @@ process PICARD_MARKDUPLICATES {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.metrics.txt"), emit: metrics tuple val(meta), path("*.metrics.txt"), emit: metrics
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,11 +15,11 @@ process PICARD_MERGESAMFILES {
input: input:
tuple val(meta), path(bams) tuple val(meta), path(bams)
val options val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -16,23 +16,23 @@ process PRESEQ_LCEXTRAP {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options val options
output: output:
tuple val(meta), path("*.ccurve.txt"), emit: ccurve tuple val(meta), path("*.ccurve.txt"), emit: ccurve
tuple val(meta), path("*.log"), emit: log tuple val(meta), path("*.log") , emit: log
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def pe = meta.single_end ? '' : '-pe' def paired_end = meta.single_end ? '' : '-pe'
""" """
preseq \\ preseq \\
lc_extrap \\ lc_extrap \\
$ioptions.args \\ $ioptions.args \\
$pe \\ $paired_end \\
-output ${prefix}.ccurve.txt \\ -output ${prefix}.ccurve.txt \\
$bam $bam
cp .command.err ${prefix}.command.log cp .command.err ${prefix}.command.log

View file

@ -23,9 +23,11 @@ process QUALIMAP_RNASEQ {
path "*.version.txt" , emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-pe'
def memory = task.memory.toGiga() + "G"
def strandedness = 'non-strand-specific' def strandedness = 'non-strand-specific'
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -33,8 +35,6 @@ process QUALIMAP_RNASEQ {
} else if (meta.strandedness == 'reverse') { } else if (meta.strandedness == 'reverse') {
strandedness = 'strand-specific-reverse' strandedness = 'strand-specific-reverse'
} }
def paired_end = meta.single_end ? '' : '-pe'
def memory = task.memory.toGiga() + "G"
""" """
unset DISPLAY unset DISPLAY
mkdir tmp mkdir tmp

View file

@ -24,9 +24,10 @@ process SALMON_QUANT {
path "*.version.txt" , emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.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 strandedness = meta.single_end ? 'U' : 'IU' def strandedness = meta.single_end ? 'U' : 'IU'
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -34,7 +35,6 @@ process SALMON_QUANT {
} else if (meta.strandedness == 'reverse') { } else if (meta.strandedness == 'reverse') {
strandedness = meta.single_end ? 'SR' : 'ISR' strandedness = meta.single_end ? 'SR' : 'ISR'
} }
def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
""" """
salmon quant \\ salmon quant \\
--geneMap $gtf \\ --geneMap $gtf \\

View file

@ -14,11 +14,11 @@ process SAMTOOLS_FLAGSTAT {
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options val options
output: output:
tuple val(meta), path("*.flagstat"), emit: flagstat tuple val(meta), path("*.flagstat"), emit: flagstat
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -14,11 +14,11 @@ process SAMTOOLS_IDXSTATS {
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options val options
output: output:
tuple val(meta), path("*.idxstats"), emit: idxstats tuple val(meta), path("*.idxstats"), emit: idxstats
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -14,11 +14,11 @@ process SAMTOOLS_INDEX {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options val options
output: output:
tuple val(meta), path("*.bai"), emit: bai tuple val(meta), path("*.bai"), emit: bai
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -15,11 +15,11 @@ process SAMTOOLS_SORT {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
val options val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -14,11 +14,11 @@ process SAMTOOLS_STATS {
input: input:
tuple val(meta), path(bam), path(bai) tuple val(meta), path(bam), path(bai)
val options val options
output: output:
tuple val(meta), path("*.stats"), emit: stats tuple val(meta), path("*.stats"), emit: stats
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)

View file

@ -26,7 +26,7 @@ process STAR_GENOMEGENERATE {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
def avail_mem = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
""" """
mkdir star mkdir star
STAR \\ STAR \\
@ -35,7 +35,7 @@ process STAR_GENOMEGENERATE {
--genomeFastaFiles $fasta \\ --genomeFastaFiles $fasta \\
--sjdbGTFfile $gtf \\ --sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\ --runThreadN $task.cpus \\
$avail_mem \\ $memory \\
$ioptions.args $ioptions.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt

View file

@ -23,9 +23,10 @@ process SUBREAD_FEATURECOUNTS {
path "*.version.txt" , emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def ioptions = initOptions(options) def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def paired_end = meta.single_end ? '' : '-p'
def strandedness = 0 def strandedness = 0
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
@ -33,7 +34,6 @@ process SUBREAD_FEATURECOUNTS {
} else if (meta.strandedness == 'reverse') { } else if (meta.strandedness == 'reverse') {
strandedness = 2 strandedness = 2
} }
def paired_end = meta.single_end ? '' : '-p'
""" """
featureCounts \\ featureCounts \\
$ioptions.args \\ $ioptions.args \\

View file

@ -15,14 +15,15 @@ process TRIMGALORE {
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
val options val options
output: output:
tuple val(meta), path("*.fq.gz"), emit: reads tuple val(meta), path("*.fq.gz") , emit: reads
tuple val(meta), path("*.html"), emit: html optional true
tuple val(meta), path("*.zip"), emit: zip optional true
tuple val(meta), path("*report.txt"), emit: log tuple val(meta), path("*report.txt"), emit: log
path "*.version.txt", emit: version path "*.version.txt" , emit: version
tuple val(meta), path("*.html"), emit: html optional true
tuple val(meta), path("*.zip") , emit: zip optional true
script: script:
// Calculate number of --cores for TrimGalore based on value of task.cpus // Calculate number of --cores for TrimGalore based on value of task.cpus
@ -37,8 +38,8 @@ process TRIMGALORE {
} }
// Clipping presets have to be evaluated in the context of SE/PE // Clipping presets have to be evaluated in the context of SE/PE
def c_r1 = params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : '' def c_r1 = params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : ''
def c_r2 = params.clip_r2 > 0 ? "--clip_r2 ${params.clip_r2}" : '' def c_r2 = params.clip_r2 > 0 ? "--clip_r2 ${params.clip_r2}" : ''
def tpc_r1 = params.three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${params.three_prime_clip_r1}" : '' def tpc_r1 = params.three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${params.three_prime_clip_r1}" : ''
def tpc_r2 = params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_clip_r2}" : '' def tpc_r2 = params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_clip_r2}" : ''

View file

@ -17,12 +17,12 @@ process UCSC_BEDRAPHTOBIGWIG {
input: input:
tuple val(meta), path(bedgraph) tuple val(meta), path(bedgraph)
path sizes path sizes
val options val options
output: output:
tuple val(meta), path("*.bigWig"), emit: bigwig tuple val(meta), path("*.bigWig"), emit: bigwig
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)