Merge pull request #27 from FelixKrueger/fastqc

FastQC module is working and now accepting arguments
This commit is contained in:
Phil Ewels 2020-07-11 13:23:41 +02:00 committed by GitHub
commit c627da09cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 31 deletions

View file

@ -1,20 +1,37 @@
process fastqc {
tag "FastQC - $sample_id"
publishDir "${params.outdir}/fastqc", mode: 'copy',
saveAs: {filename -> filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"}
nextflow.preview.dsl = 2
container 'quay.io/biocontainers/fastqc:0.11.8--2'
process FASTQC {
input:
tuple sample_id, path(reads)
// tag "FastQC - $sample_id"
output:
path "*_fastqc.{zip,html}"
input:
tuple val(name), path(reads)
val (outputdir)
// fastqc_args are best passed into the workflow in the following manner:
// --fastqc_args="--nogroup -a custom_adapter_file.txt"
val (fastqc_args)
val (verbose)
script:
"""
fastqc -q $reads
output:
tuple val(name), path ("*fastqc*"), emit: all
path "*.zip", emit: report // e.g. for MultiQC later
// container 'quay.io/biocontainers/fastqc:0.11.8--2'
publishDir "$outputdir",
mode: "copy", overwrite: true
script:
if (verbose){
println ("[MODULE] FASTQC ARGS: " + fastqc_args)
}
"""
module load fastqc
fastqc $fastqc_args -q -t 2 $reads
fastqc --version &> fastqc.version.txt
"""
fastqc --version &> fastqc.version.txt
"""
}

View file

@ -16,7 +16,7 @@ tools:
documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/
input:
-
- sample_id:
- name:
type: string
description: Sample identifier
- reads:
@ -29,4 +29,6 @@ output:
description: FastQC report
pattern: *_fastqc.{zip,html}
authors:
- @ewels
-
- @ewels
- @FelixKrueger

25
tools/fastqc/test/main.nf Normal file → Executable file
View file

@ -1,22 +1,21 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
include '../main.nf' params(params)
params.outdir = "." // gets set in nextflow.config file (as './results/fastqc')
params.fastqc_args = ''
params.verbose = false
// TODO: check the output files in some way
// include '../../../nf-core/module_testing/check_process_outputs.nf'
include '../main.nf'
// Define input channels
readPaths = [
['SRR4238351', ['../../../test-datasets/tools/fastqc/input/SRR4238351_subsamp.fastq.gz']],
['SRR4238355', ['../../../test-datasets/tools/fastqc/input/SRR4238355_subsamp.fastq.gz']],
['SRR4238359', ['../../../test-datasets/tools/fastqc/input/SRR4238359_subsamp.fastq.gz']],
['SRR4238379', ['../../../test-datasets/tools/fastqc/input/SRR4238379_subsamp.fastq.gz']]
]
Channel
.from(readPaths)
.map { row -> [ row[0], [ file(row[1][0]) ] ] }
.set { ch_read_files }
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)
FASTQC (ch_read_files, params.outdir, params.fastqc_args, params.verbose)
// .check_output()
}

View file

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