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

@ -1,42 +1,42 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process BWA_MEM { process BWA_MEM {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
//container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0" //container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null) conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null)
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 \\
| samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam - | samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam -
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
""" """
} }

View file

@ -1,41 +1,41 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_COMPUTEMATRIX { process DEEPTOOLS_COMPUTEMATRIX {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0" container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null) conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
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)
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}"
""" """
computeMatrix \\ computeMatrix \\
$ioptions.args \\ $ioptions.args \\
--regionsFileName $bed \\ --regionsFileName $bed \\
--scoreFileName $bigwig \\ --scoreFileName $bigwig \\
--outFileName ${prefix}.computeMatrix.mat.gz \\ --outFileName ${prefix}.computeMatrix.mat.gz \\
--outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\ --outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\
--numberOfProcessors $task.cpus --numberOfProcessors $task.cpus
computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt
""" """
} }

View file

@ -1,43 +1,43 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTFINGERPRINT { process DEEPTOOLS_PLOTFINGERPRINT {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0" container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null) conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
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)
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 extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : ''
""" """
plotFingerprint \\ plotFingerprint \\
$ioptions.args \\ $ioptions.args \\
$extend \\ $extend \\
--bamfiles ${bams.join(' ')} \\ --bamfiles ${bams.join(' ')} \\
--plotFile ${prefix}.plotFingerprint.pdf \\ --plotFile ${prefix}.plotFingerprint.pdf \\
--outRawCounts ${prefix}.plotFingerprint.raw.txt \\ --outRawCounts ${prefix}.plotFingerprint.raw.txt \\
--outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\ --outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\
--numberOfProcessors $task.cpus --numberOfProcessors $task.cpus
plotFingerprint --version | sed -e "s/plotFingerprint //g" > ${software}.version.txt plotFingerprint --version | sed -e "s/plotFingerprint //g" > ${software}.version.txt
""" """
} }

View file

@ -1,38 +1,38 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTHEATMAP { process DEEPTOOLS_PLOTHEATMAP {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0" container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null) conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
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)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" """
plotHeatmap \\ plotHeatmap \\
$ioptions.args \\ $ioptions.args \\
--matrixFile $matrix \\ --matrixFile $matrix \\
--outFileName ${prefix}.plotHeatmap.pdf \\ --outFileName ${prefix}.plotHeatmap.pdf \\
--outFileNameMatrix ${prefix}.plotHeatmap.mat.tab --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab
plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt
""" """
} }

View file

@ -1,38 +1,38 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTPROFILE { process DEEPTOOLS_PLOTPROFILE {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/deeptools:3.4.3--py_0" container "quay.io/biocontainers/deeptools:3.4.3--py_0"
//container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0" //container "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null) conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
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 \\
--matrixFile $matrix \\ --matrixFile $matrix \\
--outFileName ${prefix}.plotProfile.pdf \\ --outFileName ${prefix}.plotProfile.pdf \\
--outFileNameData ${prefix}.plotProfile.tab --outFileNameData ${prefix}.plotProfile.tab
plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt
""" """
} }

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,90 +1,90 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '2.2.0' def VERSION = '2.2.0'
process HISAT2_ALIGN { process HISAT2_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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
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" //container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0"
conda (params.conda ? "bioconda::hisat2=2.2.0 bioconda::samtools=1.10" : null) conda (params.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 val options
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
tuple val(meta), path("*.log"), emit: summary tuple val(meta), path("*.log"), emit: summary
path "*.version.txt" , emit: version path "*.version.txt" , emit: version
tuple val(meta), path("*fastq.gz"), optional:true, emit: fastq tuple val(meta), path("*fastq.gz"), optional:true, emit: fastq
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 strandedness = '' def strandedness = ''
if (meta.strandedness == 'forward') { if (meta.strandedness == 'forward') {
strandedness = meta.single_end ? '--rna-strandness F' : '--rna-strandness FR' strandedness = meta.single_end ? '--rna-strandness F' : '--rna-strandness FR'
} else if (meta.strandedness == 'reverse') { } else if (meta.strandedness == 'reverse') {
strandedness = meta.single_end ? '--rna-strandness R' : '--rna-strandness RF' strandedness = meta.single_end ? '--rna-strandness R' : '--rna-strandness RF'
} }
def seq_center = params.seq_center ? "--rg-id ${prefix} --rg CN:${params.seq_center.replaceAll('\\s','_')} SM:$prefix" : "--rg-id ${prefix} --rg SM:$prefix" def seq_center = params.seq_center ? "--rg-id ${prefix} --rg CN:${params.seq_center.replaceAll('\\s','_')} SM:$prefix" : "--rg-id ${prefix} --rg SM:$prefix"
if (meta.single_end) { if (meta.single_end) {
def unaligned = params.save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' def unaligned = params.save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : ''
""" """
INDEX=`find -L ./ -name "*.1.ht2" | sed 's/.1.ht2//'` INDEX=`find -L ./ -name "*.1.ht2" | sed 's/.1.ht2//'`
hisat2 \\ hisat2 \\
-x \$INDEX \\ -x \$INDEX \\
-U $reads \\ -U $reads \\
$strandedness \\ $strandedness \\
--known-splicesite-infile $splicesites \\ --known-splicesite-infile $splicesites \\
--summary-file ${prefix}.hisat2.summary.log \\ --summary-file ${prefix}.hisat2.summary.log \\
--threads $task.cpus \\ --threads $task.cpus \\
$seq_center \\ $seq_center \\
$unaligned \\ $unaligned \\
$ioptions.args \\ $ioptions.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
""" """
} else { } else {
def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : ''
""" """
INDEX=`find -L ./ -name "*.1.ht2" | sed 's/.1.ht2//'` INDEX=`find -L ./ -name "*.1.ht2" | sed 's/.1.ht2//'`
hisat2 \\ hisat2 \\
-x \$INDEX \\ -x \$INDEX \\
-1 ${reads[0]} \\ -1 ${reads[0]} \\
-2 ${reads[1]} \\ -2 ${reads[1]} \\
$strandedness \\ $strandedness \\
--known-splicesite-infile $splicesites \\ --known-splicesite-infile $splicesites \\
--summary-file ${prefix}.hisat2.summary.log \\ --summary-file ${prefix}.hisat2.summary.log \\
--threads $task.cpus \\ --threads $task.cpus \\
$seq_center \\ $seq_center \\
$unaligned \\ $unaligned \\
--no-mixed \\ --no-mixed \\
--no-discordant \\ --no-discordant \\
$ioptions.args \\ $ioptions.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
mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz
fi fi
if [ -f ${prefix}.unmapped.fastq.2.gz ]; then if [ -f ${prefix}.unmapped.fastq.2.gz ]; then
mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz
fi fi
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
""" """
} }
} }

View file

@ -1,31 +1,31 @@
// 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'
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:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
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" //container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
conda (params.conda ? "bioconda::hisat2=2.2.0" : null) conda (params.conda ? "bioconda::hisat2=2.2.0" : null)
input: input:
path gtf path gtf
val options val options
output: output:
path "*.splice_sites.txt", emit: txt path "*.splice_sites.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)
""" """
hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
""" """
} }

View file

@ -1,43 +1,43 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '4.11' def VERSION = '4.11'
process HOMER_ANNOTATEPEAKS { process HOMER_ANNOTATEPEAKS {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2" container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2"
//container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2" //container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2"
conda (params.conda ? "bioconda::homer=4.11" : null) conda (params.conda ? "bioconda::homer=4.11" : null)
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)
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}"
""" """
annotatePeaks.pl \\ annotatePeaks.pl \\
$peak \\ $peak \\
$fasta \\ $fasta \\
$ioptions.args \\ $ioptions.args \\
-gtf $gtf \\ -gtf $gtf \\
-cpu $task.cpus \\ -cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt > ${prefix}.annotatePeaks.txt
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
""" """
} }

View file

@ -1,47 +1,48 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process MACS2_CALLPEAK { process MACS2_CALLPEAK {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0" container "quay.io/biocontainers/macs2:2.2.7.1--py37h516909a_0"
//container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0" //container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0"
conda (params.conda ? "bioconda::macs2=2.2.7.1" : null) conda (params.conda ? "bioconda::macs2=2.2.7.1" : null)
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:
def software = getSoftwareName(task.process) script:
def ioptions = initOptions(options) def software = getSoftwareName(task.process)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def ioptions = initOptions(options)
def format = meta.single_end ? 'BAM' : 'BAMPE' def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def control = controlbam ? "--control $controlbam" : '' def format = meta.single_end ? 'BAM' : 'BAMPE'
""" def control = controlbam ? "--control $controlbam" : ''
macs2 \\ """
callpeak \\ macs2 \\
$ioptions.args \\ callpeak \\
--gsize $macs2_gsize \\ $ioptions.args \\
--format $format \\ --gsize $macs2_gsize \\
--name $prefix \\ --format $format \\
--treatment $ipbam \\ --name $prefix \\
$control --treatment $ipbam \\
$control
macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt
""" macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt
} """
}

View file

@ -1,37 +1,37 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '1.2.2' def VERSION = '1.2.2'
process PHANTOMPEAKQUALTOOLS { process PHANTOMPEAKQUALTOOLS {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0" container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0"
//container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0" //container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0"
conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null) conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null)
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)
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}"
""" """
RUN_SPP=`which run_spp.R` RUN_SPP=`which run_spp.R`
Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
""" """
} }

View file

@ -1,47 +1,47 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process PICARD_COLLECTMULTIPLEMETRICS { process PICARD_COLLECTMULTIPLEMETRICS {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.2--0" container "quay.io/biocontainers/picard:2.23.2--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0" //container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0"
conda (params.conda ? "bioconda::picard=2.23.2" : null) conda (params.conda ? "bioconda::picard=2.23.2" : null)
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)
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 avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else { } else {
avail_mem = task.memory.giga avail_mem = task.memory.giga
} }
""" """
picard \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
CollectMultipleMetrics \\ CollectMultipleMetrics \\
$ioptions.args \\ $ioptions.args \\
INPUT=$bam \\ INPUT=$bam \\
OUTPUT=${prefix}.CollectMultipleMetrics \\ OUTPUT=${prefix}.CollectMultipleMetrics \\
REFERENCE_SEQUENCE=$fasta REFERENCE_SEQUENCE=$fasta
echo \$(picard CollectMultipleMetrics --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt echo \$(picard CollectMultipleMetrics --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt
""" """
} }

View file

@ -1,46 +1,46 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process PICARD_MARKDUPLICATES { process PICARD_MARKDUPLICATES {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.2--0" container "quay.io/biocontainers/picard:2.23.2--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0" //container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0"
conda (params.conda ? "bioconda::picard=2.23.2" : null) conda (params.conda ? "bioconda::picard=2.23.2" : null)
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)
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 avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else { } else {
avail_mem = task.memory.giga avail_mem = task.memory.giga
} }
""" """
picard \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
MarkDuplicates \\ MarkDuplicates \\
$ioptions.args \\ $ioptions.args \\
INPUT=$bam \\ INPUT=$bam \\
OUTPUT=${prefix}.bam \\ OUTPUT=${prefix}.bam \\
METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt
echo \$(picard MarkDuplicates --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt echo \$(picard MarkDuplicates --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt
""" """
} }

View file

@ -1,51 +1,51 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
process PICARD_MERGESAMFILES { process PICARD_MERGESAMFILES {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/picard:2.23.2--0" container "quay.io/biocontainers/picard:2.23.2--0"
//container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0" //container "https://depot.galaxyproject.org/singularity/picard:2.23.2--0"
conda (params.conda ? "bioconda::picard=2.23.2" : null) conda (params.conda ? "bioconda::picard=2.23.2" : null)
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)
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 bam_files = bams.sort() def bam_files = bams.sort()
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard MergeSamFiles] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' log.info '[Picard MergeSamFiles] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else { } else {
avail_mem = task.memory.giga avail_mem = task.memory.giga
} }
if (bam_files.size() > 1) { if (bam_files.size() > 1) {
""" """
picard \\ picard \\
-Xmx${avail_mem}g \\ -Xmx${avail_mem}g \\
MergeSamFiles \\ MergeSamFiles \\
$ioptions.args \\ $ioptions.args \\
${'INPUT='+bam_files.join(' INPUT=')} \\ ${'INPUT='+bam_files.join(' INPUT=')} \\
OUTPUT=${prefix}.bam OUTPUT=${prefix}.bam
echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt
""" """
} else { } else {
""" """
ln -s ${bam_files[0]} ${prefix}.bam ln -s ${bam_files[0]} ${prefix}.bam
echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt echo \$(picard MergeSamFiles --version 2>&1) | awk -F' ' '{print \$NF}' > ${software}.version.txt
""" """
} }
} }

View file

@ -1,42 +1,42 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
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" //container "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3"
conda (params.conda ? "bioconda::preseq=2.0.3" : null) conda (params.conda ? "bioconda::preseq=2.0.3" : null)
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
echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt
""" """
} }

View file

@ -1,54 +1,54 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
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" //container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1"
conda (params.conda ? "bioconda::qualimap=2.2.2d" : null) 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 val options
output: output:
tuple val(meta), path("${prefix}"), emit: results tuple val(meta), path("${prefix}"), emit: results
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 strandedness = 'non-strand-specific' def memory = task.memory.toGiga() + "G"
if (meta.strandedness == 'forward') {
strandedness = 'strand-specific-forward' def strandedness = 'non-strand-specific'
} else if (meta.strandedness == 'reverse') { if (meta.strandedness == 'forward') {
strandedness = 'strand-specific-reverse' strandedness = 'strand-specific-forward'
} } else if (meta.strandedness == 'reverse') {
def paired_end = meta.single_end ? '' : '-pe' strandedness = 'strand-specific-reverse'
def memory = task.memory.toGiga() + "G" }
""" """
unset DISPLAY unset DISPLAY
mkdir tmp mkdir tmp
export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp
qualimap \\ qualimap \\
--java-mem-size=$memory \\ --java-mem-size=$memory \\
rnaseq \\ rnaseq \\
$ioptions.args \\ $ioptions.args \\
-bam $bam \\ -bam $bam \\
-gtf $gtf \\ -gtf $gtf \\
-p $strandedness \\ -p $strandedness \\
$paired_end \\ $paired_end \\
-outdir $prefix -outdir $prefix
echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//' > ${software}.version.txt echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//' > ${software}.version.txt
""" """
} }

View file

@ -1,50 +1,50 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
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" //container "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
conda (params.conda ? "bioconda::salmon=1.3.0" : null) 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 val options
output: output:
tuple val(meta), path("${prefix}"), emit: results tuple val(meta), path("${prefix}"), emit: results
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'
if (meta.strandedness == 'forward') { def strandedness = meta.single_end ? 'U' : 'IU'
strandedness = meta.single_end ? 'SF' : 'ISF' if (meta.strandedness == 'forward') {
} else if (meta.strandedness == 'reverse') { strandedness = meta.single_end ? 'SF' : 'ISF'
strandedness = meta.single_end ? 'SR' : 'ISR' } 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 \\ salmon quant \\
--geneMap $gtf \\ --geneMap $gtf \\
--threads $task.cpus \\ --threads $task.cpus \\
--libType=$strandedness \\ --libType=$strandedness \\
--index $index \\ --index $index \\
$endedness \\ $endedness \\
$ioptions.args \\ $ioptions.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

@ -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

@ -1,43 +1,43 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
// Don't upgrade me - 2.7X indices incompatible with iGenomes. // Don't upgrade me - 2.7X indices incompatible with iGenomes.
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" //container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
conda (params.conda ? "bioconda::star=2.6.1d" : null) conda (params.conda ? "bioconda::star=2.6.1d" : null)
input: input:
path fasta path fasta
path gtf path gtf
val options val options
output: output:
path "star" , emit: index path "star" , emit: index
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 avail_mem = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
""" """
mkdir star mkdir star
STAR \\ STAR \\
--runMode genomeGenerate \\ --runMode genomeGenerate \\
--genomeDir star/ \\ --genomeDir star/ \\
--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

@ -1,49 +1,49 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
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" //container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0"
conda (params.conda ? "bioconda::subread=2.0.1" : null) 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 val options
output: output:
tuple val(meta), path("*featureCounts.txt") , emit: counts tuple val(meta), path("*featureCounts.txt") , emit: counts
tuple val(meta), path("*featureCounts.txt.summary"), emit: summary tuple val(meta), path("*featureCounts.txt.summary"), emit: summary
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
if (meta.strandedness == 'forward') { def strandedness = 0
strandedness = 1 if (meta.strandedness == 'forward') {
} else if (meta.strandedness == 'reverse') { strandedness = 1
strandedness = 2 } else if (meta.strandedness == 'reverse') {
} strandedness = 2
def paired_end = meta.single_end ? '' : '-p' }
""" """
featureCounts \\ featureCounts \\
$ioptions.args \\ $ioptions.args \\
$paired_end \\ $paired_end \\
-T $task.cpus \\ -T $task.cpus \\
-a $annotation \\ -a $annotation \\
-s $strandedness \\ -s $strandedness \\
-o ${prefix}.featureCounts.txt \\ -o ${prefix}.featureCounts.txt \\
${bams.join(' ')} ${bams.join(' ')}
echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g" > ${software}.version.txt echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g" > ${software}.version.txt
""" """
} }

View file

@ -1,79 +1,80 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/trim-galore:0.6.5--0" container "quay.io/biocontainers/trim-galore:0.6.5--0"
//container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.5--0" //container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.5--0"
conda (params.conda ? "bioconda::trim-galore=0.6.5" : null) conda (params.conda ? "bioconda::trim-galore=0.6.5" : null)
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("*report.txt"), emit: log
tuple val(meta), path("*.zip"), emit: zip optional true path "*.version.txt" , emit: version
tuple val(meta), path("*report.txt"), emit: log
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 script:
// See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019 // Calculate number of --cores for TrimGalore based on value of task.cpus
// See: https://github.com/nf-core/atacseq/pull/65 // See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019
def cores = 1 // See: https://github.com/nf-core/atacseq/pull/65
if (task.cpus) { def cores = 1
cores = (task.cpus as int) - 4 if (task.cpus) {
if (meta.single_end) cores = (task.cpus as int) - 3 cores = (task.cpus as int) - 4
if (cores < 1) cores = 1 if (meta.single_end) cores = (task.cpus as int) - 3
if (cores > 4) cores = 4 if (cores < 1) cores = 1
} if (cores > 4) cores = 4
}
// Clipping presets have to be evaluated in the context of SE/PE
def c_r1 = params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : '' // Clipping presets have to be evaluated in the context of SE/PE
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 tpc_r1 = params.three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${params.three_prime_clip_r1}" : '' def c_r2 = params.clip_r2 > 0 ? "--clip_r2 ${params.clip_r2}" : ''
def tpc_r2 = params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_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}" : ''
// Added soft-links to original fastqs for consistent naming in MultiQC
def software = getSoftwareName(task.process) // Added soft-links to original fastqs for consistent naming in MultiQC
def ioptions = initOptions(options) def software = getSoftwareName(task.process)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" def ioptions = initOptions(options)
if (meta.single_end) { def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
""" if (meta.single_end) {
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz """
trim_galore \\ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz
$ioptions.args \\ trim_galore \\
--cores $cores \\ $ioptions.args \\
--gzip \\ --cores $cores \\
$c_r1 \\ --gzip \\
$tpc_r1 \\ $c_r1 \\
${prefix}.fastq.gz $tpc_r1 \\
echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt ${prefix}.fastq.gz
""" echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt
} else { """
""" } else {
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz """
[ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz
trim_galore \\ [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz
$ioptions.args \\ trim_galore \\
--cores $cores \\ $ioptions.args \\
--paired \\ --cores $cores \\
--gzip \\ --paired \\
$c_r1 \\ --gzip \\
$c_r2 \\ $c_r1 \\
$tpc_r1 \\ $c_r2 \\
$tpc_r2 \\ $tpc_r1 \\
${prefix}_1.fastq.gz \\ $tpc_r2 \\
${prefix}_2.fastq.gz ${prefix}_1.fastq.gz \\
echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt ${prefix}_2.fastq.gz
""" echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt
} """
} }
}

View file

@ -1,35 +1,35 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '377' def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG { process UCSC_BEDRAPHTOBIGWIG {
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:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1" container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1"
//container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1" //container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1"
conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null) conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null)
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)
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}"
""" """
bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig
echo $VERSION > ${software}.version.txt echo $VERSION > ${software}.version.txt
""" """
} }