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.
tuple val(meta), path(reads)
// TODO nf-core: List additional required input channels/values here
val options
val options
output:
// TODO nf-core: Named file extensions MUST be emitted for ALL output channels
// TODO nf-core: If meta is provided in "input:" section then it MUST be added to ALL output channels (except version)
tuple val(meta), path("*.bam"), emit: bam
// TODO nf-core: List additional required output channels/values here
path "*.version.txt", emit: version
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)

View file

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

View file

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

View file

@ -15,13 +15,13 @@ process DEEPTOOLS_COMPUTEMATRIX {
input:
tuple val(meta), path(bigwig)
path bed
val options
path bed
val options
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
path "*.version.txt", emit: version
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -26,7 +26,7 @@ process STAR_GENOMEGENERATE {
script:
def software = getSoftwareName(task.process)
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
STAR \\
@ -35,7 +35,7 @@ process STAR_GENOMEGENERATE {
--genomeFastaFiles $fasta \\
--sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\
$avail_mem \\
$memory \\
$ioptions.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt

View file

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

View file

@ -15,14 +15,15 @@ process TRIMGALORE {
input:
tuple val(meta), path(reads)
val options
val options
output:
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("*.fq.gz") , emit: reads
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:
// 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
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_r1 = params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : ''
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_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:
tuple val(meta), path(bedgraph)
path sizes
val options
path sizes
val options
output:
tuple val(meta), path("*.bigWig"), emit: bigwig
path "*.version.txt", emit: version
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)