mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
FastQC: actually run a test
This commit is contained in:
parent
ef486a908b
commit
eb41e5ebba
7 changed files with 48 additions and 24 deletions
14
nf-core/module_testing/check_process_outputs.nf
Normal file
14
nf-core/module_testing/check_process_outputs.nf
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
nextflow.preview.dsl = 2
|
||||||
|
|
||||||
|
cheers = Channel.from 'Bonjour', 'Ciao', 'Hello', 'Hola'
|
||||||
|
|
||||||
|
process check_output {
|
||||||
|
input:
|
||||||
|
val x from cheers
|
||||||
|
|
||||||
|
script:
|
||||||
|
"""
|
||||||
|
echo '$x world!'
|
||||||
|
"""
|
||||||
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
process fastqc {
|
process fastqc {
|
||||||
tag "$sample_id"
|
tag "FastQC - $sample_id"
|
||||||
publishDir "${params.outdir}/fastqc", mode: 'copy',
|
publishDir "${params.outdir}/fastqc", mode: 'copy',
|
||||||
saveAs: {filename -> filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"}
|
saveAs: {filename -> filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"}
|
||||||
|
|
||||||
container: 'quay.io/biocontainers/fastqc:0.11.8--2'
|
container 'quay.io/biocontainers/fastqc:0.11.8--2'
|
||||||
|
|
||||||
input:
|
input:
|
||||||
set val(sample_id), file(reads)
|
tuple sample_id, path(reads)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
file "*_fastqc.{zip,html}"
|
path "*_fastqc.{zip,html}"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
#!/usr/bin/env nextflow
|
#!/usr/bin/env nextflow
|
||||||
echo true
|
nextflow.preview.dsl = 2
|
||||||
|
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
|
||||||
|
include '../main.nf' params(params)
|
||||||
|
|
||||||
cheers = Channel.from 'Bonjour', 'Ciao', 'Hello', 'Hola'
|
// Define input channels
|
||||||
|
readPaths = [
|
||||||
|
['SRR389222_sub1', ['https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz']],
|
||||||
|
['SRR389222_sub2', ['https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz']],
|
||||||
|
['SRR389222_sub3', ['https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub3.fastq.gz']]
|
||||||
|
]
|
||||||
|
Channel
|
||||||
|
.from(readPaths)
|
||||||
|
.map { row -> [ row[0], [row[1][0]]] }
|
||||||
|
.set { ch_read_files }
|
||||||
|
|
||||||
process sayHello {
|
// Run the workflow
|
||||||
input:
|
workflow {
|
||||||
val x from cheers
|
fastqc(ch_read_files)
|
||||||
script:
|
// .check_output()
|
||||||
"""
|
|
||||||
echo '$x world!'
|
|
||||||
"""
|
|
||||||
}
|
}
|
||||||
|
|
2
tools/fastqc/test/nextflow.config
Normal file
2
tools/fastqc/test/nextflow.config
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
docker.enabled = true
|
||||||
|
params.outdir = './results'
|
|
@ -1,13 +1,13 @@
|
||||||
process samtools_index {
|
process samtools_index {
|
||||||
tag "${bam.baseName}"
|
tag "${bam.baseName}"
|
||||||
|
|
||||||
container: 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
|
container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
|
||||||
|
|
||||||
input:
|
input:
|
||||||
set file(bam)
|
path(bam)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
file "*.sorted.bam"
|
path "*.sorted.bam"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def suff_mem = ("${(task.memory.toBytes() - 6000000000) / task.cpus}" > 2000000000) ? 'true' : 'false'
|
def suff_mem = ("${(task.memory.toBytes() - 6000000000) / task.cpus}" > 2000000000) ? 'true' : 'false'
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
process samtools_index {
|
process samtools_index {
|
||||||
tag "${bam.baseName}"
|
tag "${bam.baseName}"
|
||||||
|
|
||||||
container: 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
|
container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
|
||||||
|
|
||||||
input:
|
input:
|
||||||
set file(bam)
|
path(bam)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
file "*.bam.bai"
|
path "*.bam.bai"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -7,15 +7,15 @@ process fastqc {
|
||||||
else filename
|
else filename
|
||||||
}
|
}
|
||||||
|
|
||||||
container: 'quay.io/biocontainers/trim-galore:0.6.5--0'
|
container 'quay.io/biocontainers/trim-galore:0.6.5--0'
|
||||||
|
|
||||||
input:
|
input:
|
||||||
set val(sample_id), file(reads)
|
tuple sample_id, path(reads)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
set val(name), file("*fq.gz")
|
tuple name, path("*fq.gz")
|
||||||
file "*trimming_report.txt"
|
path "*trimming_report.txt"
|
||||||
file "*_fastqc.{zip,html}"
|
path "*_fastqc.{zip,html}"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
c_r1 = clip_r1 > 0 ? "--clip_r1 ${clip_r1}" : ''
|
c_r1 = clip_r1 > 0 ? "--clip_r1 ${clip_r1}" : ''
|
||||||
|
|
Loading…
Reference in a new issue