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 { nextflow.preview.dsl = 2
tag "FastQC - $sample_id"
publishDir "${params.outdir}/fastqc", mode: 'copy',
saveAs: {filename -> filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"}
container 'quay.io/biocontainers/fastqc:0.11.8--2' process FASTQC {
// tag "FastQC - $sample_id"
input: input:
tuple sample_id, path(reads) 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)
output: output:
path "*_fastqc.{zip,html}" 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: script:
if (verbose){
println ("[MODULE] FASTQC ARGS: " + fastqc_args)
}
""" """
fastqc -q $reads 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/ documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/
input: input:
- -
- sample_id: - name:
type: string type: string
description: Sample identifier description: Sample identifier
- reads: - reads:
@ -29,4 +29,6 @@ output:
description: FastQC report description: FastQC report
pattern: *_fastqc.{zip,html} pattern: *_fastqc.{zip,html}
authors: authors:
-
- @ewels - @ewels
- @FelixKrueger

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

@ -1,22 +1,21 @@
#!/usr/bin/env nextflow #!/usr/bin/env nextflow
nextflow.preview.dsl = 2 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 // Define input channels
readPaths = [ ch_read_files = Channel
['SRR4238351', ['../../../test-datasets/tools/fastqc/input/SRR4238351_subsamp.fastq.gz']], .fromFilePairs('../../../test-datasets/test*{1,2}.fastq.gz',size:-1)
['SRR4238355', ['../../../test-datasets/tools/fastqc/input/SRR4238355_subsamp.fastq.gz']], // .view() // to check whether the input channel works
['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 }
// Run the workflow // Run the workflow
workflow { workflow {
fastqc(ch_read_files) FASTQC (ch_read_files, params.outdir, params.fastqc_args, params.verbose)
// .check_output() // .check_output()
} }

View file

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