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

@ -1,42 +1,42 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process BWA_MEM {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null)
input:
tuple val(meta), path(reads)
path index
path fasta
val options
output:
tuple val(meta), path("*.bam"), emit: bam
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}" : ""
"""
bwa mem \\
$ioptions.args \\
$rg \\
-t $task.cpus \\
$fasta \\
$reads \\
| samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam -
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process BWA_MEM {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
conda (params.conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.10" : null)
input:
tuple val(meta), path(reads)
path index
path fasta
val options
output:
tuple val(meta), path("*.bam"), emit: bam
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 read_group = meta.read_group ? "-R ${meta.read_group}" : ""
"""
bwa mem \\
$ioptions.args \\
$read_group \\
-t $task.cpus \\
$fasta \\
$reads \\
| samtools view $ioptions.args2 -@ $task.cpus -bS -o ${prefix}.bam -
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""
}

View file

@ -1,41 +1,41 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_COMPUTEMATRIX {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(bigwig)
path bed
val options
output:
tuple val(meta), path("*.mat.gz"), emit: matrix
tuple val(meta), path("*.mat.tab"), emit: table
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}"
"""
computeMatrix \\
$ioptions.args \\
--regionsFileName $bed \\
--scoreFileName $bigwig \\
--outFileName ${prefix}.computeMatrix.mat.gz \\
--outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\
--numberOfProcessors $task.cpus
computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_COMPUTEMATRIX {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(bigwig)
path bed
val options
output:
tuple val(meta), path("*.mat.gz") , emit: matrix
tuple val(meta), path("*.mat.tab"), emit: table
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}"
"""
computeMatrix \\
$ioptions.args \\
--regionsFileName $bed \\
--scoreFileName $bigwig \\
--outFileName ${prefix}.computeMatrix.mat.gz \\
--outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\
--numberOfProcessors $task.cpus
computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt
"""
}

View file

@ -1,43 +1,43 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTFINGERPRINT {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(bams), path(bais)
val options
output:
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
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : ''
"""
plotFingerprint \\
$ioptions.args \\
$extend \\
--bamfiles ${bams.join(' ')} \\
--plotFile ${prefix}.plotFingerprint.pdf \\
--outRawCounts ${prefix}.plotFingerprint.raw.txt \\
--outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\
--numberOfProcessors $task.cpus
plotFingerprint --version | sed -e "s/plotFingerprint //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTFINGERPRINT {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(bams), path(bais)
val options
output:
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
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : ''
"""
plotFingerprint \\
$ioptions.args \\
$extend \\
--bamfiles ${bams.join(' ')} \\
--plotFile ${prefix}.plotFingerprint.pdf \\
--outRawCounts ${prefix}.plotFingerprint.raw.txt \\
--outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\
--numberOfProcessors $task.cpus
plotFingerprint --version | sed -e "s/plotFingerprint //g" > ${software}.version.txt
"""
}

View file

@ -1,38 +1,38 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTHEATMAP {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
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}"
"""
plotHeatmap \\
$ioptions.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotHeatmap.pdf \\
--outFileNameMatrix ${prefix}.plotHeatmap.mat.tab
plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTHEATMAP {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
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}"
"""
plotHeatmap \\
$ioptions.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotHeatmap.pdf \\
--outFileNameMatrix ${prefix}.plotHeatmap.mat.tab
plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt
"""
}

View file

@ -1,38 +1,38 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTPROFILE {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
"""
plotProfile \\
$ioptions.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotProfile.pdf \\
--outFileNameData ${prefix}.plotProfile.tab
plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process DEEPTOOLS_PLOTPROFILE {
tag "$meta.id"
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/deeptools:3.4.3--py_0"
conda (params.conda ? "bioconda::deeptools=3.4.3" : null)
input:
tuple val(meta), path(matrix)
val options
output:
tuple val(meta), path("*.pdf"), emit: pdf
tuple val(meta), path("*.tab"), emit: table
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}"
"""
plotProfile \\
$ioptions.args \\
--matrixFile $matrix \\
--outFileName ${prefix}.plotProfile.pdf \\
--outFileNameData ${prefix}.plotProfile.tab
plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt
"""
}

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

View file

@ -1,31 +1,31 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '2.2.0'
process HISAT2_EXTRACTSPLICESITES {
tag "$gtf"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
conda (params.conda ? "bioconda::hisat2=2.2.0" : null)
input:
path gtf
val options
output:
path "*.splice_sites.txt", emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
"""
hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt
echo $VERSION > ${software}.version.txt
"""
}
// Import generic module functions
include { saveFiles; getSoftwareName } from './functions'
def VERSION = '2.2.0'
process HISAT2_EXTRACTSPLICESITES {
tag "$gtf"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4"
conda (params.conda ? "bioconda::hisat2=2.2.0" : null)
input:
path gtf
val options
output:
path "*.splice_sites.txt", emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
"""
hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt
echo $VERSION > ${software}.version.txt
"""
}

View file

@ -1,43 +1,43 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '4.11'
process HOMER_ANNOTATEPEAKS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2"
conda (params.conda ? "bioconda::homer=4.11" : null)
input:
tuple val(meta), path(peak)
path fasta
path gtf
val options
output:
tuple val(meta), path("*annotatePeaks.txt"), emit: txt
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}"
"""
annotatePeaks.pl \\
$peak \\
$fasta \\
$ioptions.args \\
-gtf $gtf \\
-cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt
echo $VERSION > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '4.11'
process HOMER_ANNOTATEPEAKS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2"
conda (params.conda ? "bioconda::homer=4.11" : null)
input:
tuple val(meta), path(peak)
path fasta
path gtf
val options
output:
tuple val(meta), path("*annotatePeaks.txt"), emit: txt
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}"
"""
annotatePeaks.pl \\
$peak \\
$fasta \\
$ioptions.args \\
-gtf $gtf \\
-cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt
echo $VERSION > ${software}.version.txt
"""
}

View file

@ -1,47 +1,48 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process MACS2_CALLPEAK {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0"
conda (params.conda ? "bioconda::macs2=2.2.7.1" : null)
input:
tuple val(meta), path(ipbam), path(controlbam)
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
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def format = meta.single_end ? 'BAM' : 'BAMPE'
def control = controlbam ? "--control $controlbam" : ''
"""
macs2 \\
callpeak \\
$ioptions.args \\
--gsize $macs2_gsize \\
--format $format \\
--name $prefix \\
--treatment $ipbam \\
$control
macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process MACS2_CALLPEAK {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py37h516909a_0"
conda (params.conda ? "bioconda::macs2=2.2.7.1" : null)
input:
tuple val(meta), path(ipbam), path(controlbam)
val macs2_gsize
val options
output:
tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak
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)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
def format = meta.single_end ? 'BAM' : 'BAMPE'
def control = controlbam ? "--control $controlbam" : ''
"""
macs2 \\
callpeak \\
$ioptions.args \\
--gsize $macs2_gsize \\
--format $format \\
--name $prefix \\
--treatment $ipbam \\
$control
macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt
"""
}

View file

@ -1,37 +1,37 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '1.2.2'
process PHANTOMPEAKQUALTOOLS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0"
conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null)
input:
tuple val(meta), path(bam)
val options
output:
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
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
"""
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
echo $VERSION > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '1.2.2'
process PHANTOMPEAKQUALTOOLS {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0"
conda (params.conda ? "bioconda::phantompeakqualtools=1.2.2" : null)
input:
tuple val(meta), path(bam)
val options
output:
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
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
"""
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
echo $VERSION > ${software}.version.txt
"""
}

View file

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

View file

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

View file

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

View file

@ -1,42 +1,42 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process PRESEQ_LCEXTRAP {
tag "$meta.id"
label 'process_medium'
label 'error_ignore'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3"
conda (params.conda ? "bioconda::preseq=2.0.3" : null)
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.ccurve.txt"), emit: ccurve
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'
"""
preseq \\
lc_extrap \\
$ioptions.args \\
$pe \\
-output ${prefix}.ccurve.txt \\
$bam
cp .command.err ${prefix}.command.log
echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process PRESEQ_LCEXTRAP {
tag "$meta.id"
label 'process_medium'
label 'error_ignore'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/preseq:2.0.3--hf53bd2b_3"
conda (params.conda ? "bioconda::preseq=2.0.3" : null)
input:
tuple val(meta), path(bam)
val options
output:
tuple val(meta), path("*.ccurve.txt"), emit: ccurve
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 paired_end = meta.single_end ? '' : '-pe'
"""
preseq \\
lc_extrap \\
$ioptions.args \\
$paired_end \\
-output ${prefix}.ccurve.txt \\
$bam
cp .command.err ${prefix}.command.log
echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt
"""
}

View file

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

View file

@ -1,50 +1,50 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process SALMON_QUANT {
tag "$meta.id"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
conda (params.conda ? "bioconda::salmon=1.3.0" : null)
input:
tuple val(meta), path(reads)
path index
path gtf
val options
output:
tuple val(meta), path("${prefix}"), emit: results
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 strandedness = meta.single_end ? 'U' : 'IU'
if (meta.strandedness == 'forward') {
strandedness = meta.single_end ? 'SF' : 'ISF'
} 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 \\
--threads $task.cpus \\
--libType=$strandedness \\
--index $index \\
$endedness \\
$ioptions.args \\
-o $prefix
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process SALMON_QUANT {
tag "$meta.id"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/salmon:1.3.0--hf69c8f4_0"
conda (params.conda ? "bioconda::salmon=1.3.0" : null)
input:
tuple val(meta), path(reads)
path index
path gtf
val options
output:
tuple val(meta), path("${prefix}"), emit: results
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 endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def strandedness = meta.single_end ? 'U' : 'IU'
if (meta.strandedness == 'forward') {
strandedness = meta.single_end ? 'SF' : 'ISF'
} else if (meta.strandedness == 'reverse') {
strandedness = meta.single_end ? 'SR' : 'ISR'
}
"""
salmon quant \\
--geneMap $gtf \\
--threads $task.cpus \\
--libType=$strandedness \\
--index $index \\
$endedness \\
$ioptions.args \\
-o $prefix
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
"""
}

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

@ -1,43 +1,43 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process STAR_GENOMEGENERATE {
tag "$fasta"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
// Don't upgrade me - 2.7X indices incompatible with iGenomes.
container "quay.io/biocontainers/star:2.6.1d--0"
//container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
conda (params.conda ? "bioconda::star=2.6.1d" : null)
input:
path fasta
path gtf
val options
output:
path "star" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def avail_mem = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
"""
mkdir star
STAR \\
--runMode genomeGenerate \\
--genomeDir star/ \\
--genomeFastaFiles $fasta \\
--sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\
$avail_mem \\
$ioptions.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process STAR_GENOMEGENERATE {
tag "$fasta"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:'') }
// Don't upgrade me - 2.7X indices incompatible with iGenomes.
container "quay.io/biocontainers/star:2.6.1d--0"
//container "https://depot.galaxyproject.org/singularity/star:2.6.1d--0"
conda (params.conda ? "bioconda::star=2.6.1d" : null)
input:
path fasta
path gtf
val options
output:
path "star" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
"""
mkdir star
STAR \\
--runMode genomeGenerate \\
--genomeDir star/ \\
--genomeFastaFiles $fasta \\
--sjdbGTFfile $gtf \\
--runThreadN $task.cpus \\
$memory \\
$ioptions.args
STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt
"""
}

View file

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

View file

@ -1,79 +1,80 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process TRIMGALORE {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/trim-galore:0.6.5--0"
conda (params.conda ? "bioconda::trim-galore=0.6.5" : null)
input:
tuple val(meta), path(reads)
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("*report.txt"), emit: log
path "*.version.txt", emit: version
script:
// Calculate number of --cores for TrimGalore based on value of task.cpus
// See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019
// See: https://github.com/nf-core/atacseq/pull/65
def cores = 1
if (task.cpus) {
cores = (task.cpus as int) - 4
if (meta.single_end) cores = (task.cpus as int) - 3
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}" : ''
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}" : ''
// Added soft-links to original fastqs for consistent naming in MultiQC
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
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 \\
$ioptions.args \\
--cores $cores \\
--gzip \\
$c_r1 \\
$tpc_r1 \\
${prefix}.fastq.gz
echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt
"""
} 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
trim_galore \\
$ioptions.args \\
--cores $cores \\
--paired \\
--gzip \\
$c_r1 \\
$c_r2 \\
$tpc_r1 \\
$tpc_r2 \\
${prefix}_1.fastq.gz \\
${prefix}_2.fastq.gz
echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt
"""
}
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
process TRIMGALORE {
tag "$meta.id"
label 'process_high'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/trim-galore:0.6.5--0"
conda (params.conda ? "bioconda::trim-galore=0.6.5" : null)
input:
tuple val(meta), path(reads)
val options
output:
tuple val(meta), path("*.fq.gz") , emit: reads
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
// See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019
// See: https://github.com/nf-core/atacseq/pull/65
def cores = 1
if (task.cpus) {
cores = (task.cpus as int) - 4
if (meta.single_end) cores = (task.cpus as int) - 3
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}" : ''
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}" : ''
// Added soft-links to original fastqs for consistent naming in MultiQC
def software = getSoftwareName(task.process)
def ioptions = initOptions(options)
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 \\
$ioptions.args \\
--cores $cores \\
--gzip \\
$c_r1 \\
$tpc_r1 \\
${prefix}.fastq.gz
echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt
"""
} 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
trim_galore \\
$ioptions.args \\
--cores $cores \\
--paired \\
--gzip \\
$c_r1 \\
$c_r2 \\
$tpc_r1 \\
$tpc_r2 \\
${prefix}_1.fastq.gz \\
${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
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1"
conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null)
input:
tuple val(meta), path(bedgraph)
path sizes
val options
output:
tuple val(meta), path("*.bigWig"), emit: bigwig
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}"
"""
bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig
echo $VERSION > ${software}.version.txt
"""
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
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 "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1"
conda (params.conda ? "bioconda::ucsc-bedgraphtobigwig=377" : null)
input:
tuple val(meta), path(bedgraph)
path sizes
val options
output:
tuple val(meta), path("*.bigWig"), emit: bigwig
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}"
"""
bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig
echo $VERSION > ${software}.version.txt
"""
}