mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 18:58:16 +00:00
Add tests for fastqc module
This commit is contained in:
parent
167067a92e
commit
f7c42ac4fd
10 changed files with 36 additions and 25 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,6 @@
|
|||
.nextflow*
|
||||
work/
|
||||
results/
|
||||
./data
|
||||
test_output/
|
||||
.DS_Store
|
||||
*.code-workspace
|
||||
|
|
|
@ -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 "*.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
|
||||
"""
|
||||
}
|
||||
|
|
1
software/fastqc/test/data/test_R1.fastq.gz
Symbolic link
1
software/fastqc/test/data/test_R1.fastq.gz
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../../../tests/data/fastq/rna/test_R1.fastq.gz
|
1
software/fastqc/test/data/test_R2.fastq.gz
Symbolic link
1
software/fastqc/test/data/test_R2.fastq.gz
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../../../tests/data/fastq/rna/test_R2.fastq.gz
|
1
software/fastqc/test/data/test_single_end.fastq.gz
Symbolic link
1
software/fastqc/test/data/test_single_end.fastq.gz
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../../../tests/data/fastq/rna/test_single_end.fastq.gz
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
// docker.enabled = true
|
||||
params.outdir = './results/fastqc'
|
BIN
tests/data/fastq/rna/test_R1.fastq.gz
Normal file
BIN
tests/data/fastq/rna/test_R1.fastq.gz
Normal file
Binary file not shown.
BIN
tests/data/fastq/rna/test_R2.fastq.gz
Normal file
BIN
tests/data/fastq/rna/test_R2.fastq.gz
Normal file
Binary file not shown.
BIN
tests/data/fastq/rna/test_single_end.fastq.gz
Normal file
BIN
tests/data/fastq/rna/test_single_end.fastq.gz
Normal file
Binary file not shown.
Loading…
Reference in a new issue