2020-07-15 08:16:48 +00:00
|
|
|
def MODULE = "fastqc"
|
2020-07-15 08:55:52 +00:00
|
|
|
params.publish_dir = MODULE
|
|
|
|
params.publish_results = "default"
|
2019-12-05 14:35:51 +00:00
|
|
|
|
2020-07-11 11:42:13 +00:00
|
|
|
process FASTQC {
|
2020-07-15 11:00:10 +00:00
|
|
|
publishDir "${params.out_dir}/${params.publish_dir}",
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
saveAs: { filename ->
|
|
|
|
if (params.publish_results == "none") null
|
|
|
|
else filename }
|
2019-12-05 14:35:51 +00:00
|
|
|
|
2020-07-15 08:55:52 +00:00
|
|
|
container "docker.pkg.github.com/nf-core/$MODULE"
|
2020-07-15 11:00:10 +00:00
|
|
|
|
2020-07-14 18:37:35 +00:00
|
|
|
conda "${moduleDir}/environment.yml"
|
2019-12-05 14:35:51 +00:00
|
|
|
|
2020-07-15 11:00:10 +00:00
|
|
|
input:
|
|
|
|
tuple val(name), val(single_end), path(reads)
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(name), val(single_end), path("*.html"), emit: html
|
|
|
|
tuple val(name), val(single_end), path("*.zip"), emit: zip
|
|
|
|
path "*.version.txt", emit: version
|
2020-03-16 14:17:38 +00:00
|
|
|
|
2020-07-11 11:42:13 +00:00
|
|
|
script:
|
2020-07-15 11:00:10 +00:00
|
|
|
// Add soft-links to original FastQs for consistent naming in pipeline
|
|
|
|
if (single_end) {
|
|
|
|
"""
|
|
|
|
[ ! -f ${name}.fastq.gz ] && ln -s $reads ${name}.fastq.gz
|
|
|
|
fastqc ${params.fastqc_args} --threads $task.cpus ${name}.fastq.gz
|
|
|
|
fastqc --version | sed -n "s/.*\\(v.*\$\\)/\\1/p" > fastqc.version.txt
|
|
|
|
"""
|
|
|
|
} else {
|
2020-07-11 11:42:13 +00:00
|
|
|
"""
|
2020-07-15 11:00:10 +00:00
|
|
|
[ ! -f ${name}_1.fastq.gz ] && ln -s ${reads[0]} ${name}_1.fastq.gz
|
|
|
|
[ ! -f ${name}_2.fastq.gz ] && ln -s ${reads[1]} ${name}_2.fastq.gz
|
|
|
|
fastqc ${params.fastqc_args} --threads $task.cpus ${name}_1.fastq.gz ${name}_2.fastq.gz
|
2020-07-14 15:38:20 +00:00
|
|
|
fastqc --version | sed -n "s/.*\\(v.*\$\\)/\\1/p" > fastqc.version.txt
|
2020-07-11 11:42:13 +00:00
|
|
|
"""
|
2020-07-15 11:00:10 +00:00
|
|
|
}
|
2019-12-05 14:35:51 +00:00
|
|
|
}
|