mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +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*
|
.nextflow*
|
||||||
work/
|
work/
|
||||||
results/
|
results/
|
||||||
./data
|
test_output/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
|
@ -3,21 +3,21 @@ nextflow.preview.dsl = 2
|
||||||
process FASTQC {
|
process FASTQC {
|
||||||
input:
|
input:
|
||||||
tuple val(name), path(reads)
|
tuple val(name), path(reads)
|
||||||
val (fastqc_args)
|
|
||||||
val (outputdir)
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(name), path ("*fastqc*"), emit: all
|
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",
|
publishDir "${params.out_dir}", mode: params.publish_dir_mode
|
||||||
mode: "copy", overwrite: true
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
"""
|
"""
|
||||||
fastqc $fastqc_args -q -t 2 $reads
|
fastqc ${params.fastqc_args} -t ${task.cpus} $reads
|
||||||
fastqc --version &> fastqc.version.txt
|
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
|
#!/usr/bin/env nextflow
|
||||||
nextflow.preview.dsl = 2
|
nextflow.preview.dsl = 2
|
||||||
|
|
||||||
params.outdir = "." // gets set in nextflow.config file (as './results/fastqc')
|
params.out_dir = "test_output"
|
||||||
params.fastqc_args = ''
|
params.fastqc_args = ''
|
||||||
params.verbose = false
|
params.publish_dir_mode = "copy"
|
||||||
|
|
||||||
// TODO: check the output files in some way
|
include { FASTQC } from '../main.nf'
|
||||||
// include '../../../tests/functions/check_process_outputs.nf'
|
|
||||||
include '../main.nf'
|
|
||||||
|
|
||||||
// Define input channels
|
/**
|
||||||
ch_read_files = Channel
|
* Test if FASTQC runs with single-end data
|
||||||
.fromFilePairs('../../../test-datasets/test*{1,2}.fastq.gz',size:-1)
|
*/
|
||||||
// .view() // to check whether the input channel works
|
workflow test_single_end {
|
||||||
|
input_files = Channel.fromPath("data/test_single_end.fastq.gz")
|
||||||
// Run the workflow
|
.map {f -> [f.baseName, f]}
|
||||||
workflow {
|
input_files.view()
|
||||||
FASTQC (ch_read_files, params.outdir, params.fastqc_args, params.verbose)
|
FASTQC(input_files)
|
||||||
// .check_output()
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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