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

@ -60,7 +60,7 @@ process SOFTWARE_TOOL {
// 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

@ -18,7 +18,7 @@ process BWA_INDEX {
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

@ -21,17 +21,17 @@ process BWA_MEM {
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

@ -19,9 +19,9 @@ process DEEPTOOLS_COMPUTEMATRIX {
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

@ -18,10 +18,10 @@ process DEEPTOOLS_PLOTFINGERPRINT {
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

@ -20,7 +20,7 @@ process DEEPTOOLS_PLOTHEATMAP {
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

@ -20,12 +20,12 @@ process DEEPTOOLS_PLOTPROFILE {
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

@ -19,8 +19,8 @@ process FASTQC {
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

@ -23,7 +23,7 @@ process HOMER_ANNOTATEPEAKS {
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

@ -20,11 +20,12 @@ process MACS2_CALLPEAK {
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

@ -20,10 +20,10 @@ process PHANTOMPEAKQUALTOOLS {
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

@ -20,8 +20,8 @@ process PICARD_COLLECTMULTIPLEMETRICS {
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

@ -18,9 +18,9 @@ process PICARD_MARKDUPLICATES {
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

@ -19,7 +19,7 @@ process PICARD_MERGESAMFILES {
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

@ -20,19 +20,19 @@ process PRESEQ_LCEXTRAP {
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

@ -26,6 +26,8 @@ process QUALIMAP_RNASEQ {
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

@ -27,6 +27,7 @@ process SALMON_QUANT {
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

@ -18,7 +18,7 @@ process SAMTOOLS_FLAGSTAT {
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

@ -18,7 +18,7 @@ process SAMTOOLS_IDXSTATS {
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

@ -18,7 +18,7 @@ process SAMTOOLS_INDEX {
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

@ -19,7 +19,7 @@ process SAMTOOLS_SORT {
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

@ -18,7 +18,7 @@ process SAMTOOLS_STATS {
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

@ -26,6 +26,7 @@ process SUBREAD_FEATURECOUNTS {
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

@ -18,11 +18,12 @@ process TRIMGALORE {
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

View file

@ -22,7 +22,7 @@ process UCSC_BEDRAPHTOBIGWIG {
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)