Add tests for fastqc module

This commit is contained in:
Gregor Sturm 2020-07-14 17:38:20 +02:00
parent 167067a92e
commit f7c42ac4fd
10 changed files with 36 additions and 25 deletions

2
.gitignore vendored
View file

@ -1,6 +1,6 @@
.nextflow*
work/
results/
./data
test_output/
.DS_Store
*.code-workspace

View file

@ -3,21 +3,21 @@ nextflow.preview.dsl = 2
process FASTQC {
input:
tuple val(name), path(reads)
val (fastqc_args)
val (outputdir)
output:
tuple val(name), path ("*fastqc*"), emit: all
path "*.zip", emit: report // e.g. for MultiQC later
path "*.version.txt", emit: version
container 'quay.io/biocontainers/fastqc:0.11.8--2'
container 'docker.pkg.github.com/nf-core/fastqc'
// see https://github.com/nextflow-io/nextflow/issues/1674
conda "../environment.yml"
publishDir "$outputdir",
mode: "copy", overwrite: true
publishDir "${params.out_dir}", mode: params.publish_dir_mode
script:
"""
fastqc $fastqc_args -q -t 2 $reads
fastqc --version &> fastqc.version.txt
fastqc ${params.fastqc_args} -t ${task.cpus} $reads
fastqc --version | sed -n "s/.*\\(v.*\$\\)/\\1/p" > fastqc.version.txt
"""
}

View file

@ -0,0 +1 @@
../../../../tests/data/fastq/rna/test_R1.fastq.gz

View file

@ -0,0 +1 @@
../../../../tests/data/fastq/rna/test_R2.fastq.gz

View file

@ -0,0 +1 @@
../../../../tests/data/fastq/rna/test_single_end.fastq.gz

View file

@ -1,21 +1,31 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
params.outdir = "." // gets set in nextflow.config file (as './results/fastqc')
params.out_dir = "test_output"
params.fastqc_args = ''
params.verbose = false
params.publish_dir_mode = "copy"
// TODO: check the output files in some way
// include '../../../tests/functions/check_process_outputs.nf'
include '../main.nf'
include { FASTQC } from '../main.nf'
// Define input channels
ch_read_files = Channel
.fromFilePairs('../../../test-datasets/test*{1,2}.fastq.gz',size:-1)
// .view() // to check whether the input channel works
// Run the workflow
workflow {
FASTQC (ch_read_files, params.outdir, params.fastqc_args, params.verbose)
// .check_output()
/**
* Test if FASTQC runs with single-end data
*/
workflow test_single_end {
input_files = Channel.fromPath("data/test_single_end.fastq.gz")
.map {f -> [f.baseName, f]}
input_files.view()
FASTQC(input_files)
}
/**
* Test if FASTQC runs with paired end data
*/
workflow test_paired_end {
input_files = Channel.fromFilePairs("data/test_R{1,2}.fastq.gz")
FASTQC(input_files)
}
workflow {
test_single_end()
test_paired_end()
}

View file

@ -1,2 +0,0 @@
// docker.enabled = true
params.outdir = './results/fastqc'

Binary file not shown.

Binary file not shown.

Binary file not shown.