From a6f7296e22f508d00cdc5c04a83518b9d160b7d8 Mon Sep 17 00:00:00 2001 From: FelixKrueger Date: Fri, 6 Mar 2020 13:21:17 +0000 Subject: [PATCH 1/3] Initial commit --- tools/fastq_screen/main.nf | 35 +++++++++++++++++++++++++++++++++++ tools/fastq_screen/meta.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 tools/fastq_screen/main.nf create mode 100644 tools/fastq_screen/meta.yml diff --git a/tools/fastq_screen/main.nf b/tools/fastq_screen/main.nf new file mode 100644 index 00000000..4f489be1 --- /dev/null +++ b/tools/fastq_screen/main.nf @@ -0,0 +1,35 @@ +nextflow.preview.dsl=2 + +process FASTQ_SCREEN { + + // depending on the number of genomes and the type of genome (e.g. plants!), memory needs to be ample! + // label 'bigMem' + // label 'multiCore' + + input: + tuple val(name), path(reads) + val (outputdir) + val (fastq_screen_args) + val (verbose) + + output: + path "*png", emit: png + path "*html", emit: html + path "*txt", emit: report + + publishDir "$outputdir", + mode: "link", overwrite: true + + script: + fastq_screen_args = fastq_screen_args.replaceAll(/'/,"") + + if (verbose){ + println ("[MODULE] FASTQ SCREEN ARGS: "+ fastq_screen_args) + } + + """ + module load fastq_screen + fastq_screen $fastq_screen_args $reads + """ + +} \ No newline at end of file diff --git a/tools/fastq_screen/meta.yml b/tools/fastq_screen/meta.yml new file mode 100644 index 00000000..90b4a94f --- /dev/null +++ b/tools/fastq_screen/meta.yml @@ -0,0 +1,32 @@ +name: FastQ Screen +description: Run FastQ Screen on sequenced reads +keywords: + - Quality Control + - Species Screen + - Contamination +tools: + - fastqc: + description: | + FastQC gives general quality metrics about your reads. + It provides information about the quality score distribution + across your reads, the per base sequence content (%A/C/G/T). + You get information about adapter contamination and other + overrepresented sequences. + homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/ + documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/_build/html/index.html +input: + - + - sample_id: + type: string + description: Sample identifier + - reads: + type: file + description: Input FastQ file +output: + - + - report: + type: file + description: FastQC report + pattern: *_fastqc.{zip,html} +authors: + - @felix From d9a3b02b0094667d28056af0be2b207d636afbc1 Mon Sep 17 00:00:00 2001 From: FelixKrueger Date: Tue, 10 Mar 2020 14:13:36 +0000 Subject: [PATCH 2/3] Updated yaml description --- tools/fastq_screen/meta.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/fastq_screen/meta.yml b/tools/fastq_screen/meta.yml index 90b4a94f..4b4e56bd 100644 --- a/tools/fastq_screen/meta.yml +++ b/tools/fastq_screen/meta.yml @@ -1,5 +1,5 @@ name: FastQ Screen -description: Run FastQ Screen on sequenced reads +description: Run FastQ Screen on sequenced reads for Species Identification keywords: - Quality Control - Species Screen @@ -7,11 +7,9 @@ keywords: tools: - fastqc: description: | - FastQC gives general quality metrics about your reads. - It provides information about the quality score distribution - across your reads, the per base sequence content (%A/C/G/T). - You get information about adapter contamination and other - overrepresented sequences. + FastQ Screen allows you to screen a library of sequences in + FastQ format against a set of sequence databases so you can + see if the composition of the library matches with what you expect. homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/ documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/_build/html/index.html input: @@ -26,7 +24,8 @@ output: - - report: type: file - description: FastQC report - pattern: *_fastqc.{zip,html} + description: FastQ Screen report + pattern: *_screen.{txt,html,png} + optional_pattern: *_screen.bisulfite_orientation.png authors: - - @felix + - @FelixKrueger From 0ceb45068e3ec40aab1c17919385df4a611d1c48 Mon Sep 17 00:00:00 2001 From: FelixKrueger Date: Tue, 10 Mar 2020 22:14:25 +0000 Subject: [PATCH 3/3] FastQ Screen works with E coli paired-end test file --- tools/fastq_screen/main.nf | 9 +++++--- tools/fastq_screen/test/main.nf | 30 +++++++++++++++++++++++++ tools/fastq_screen/test/nextflow.config | 2 ++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100755 tools/fastq_screen/test/main.nf create mode 100644 tools/fastq_screen/test/nextflow.config diff --git a/tools/fastq_screen/main.nf b/tools/fastq_screen/main.nf index 4f489be1..be088ff5 100644 --- a/tools/fastq_screen/main.nf +++ b/tools/fastq_screen/main.nf @@ -9,7 +9,9 @@ process FASTQ_SCREEN { input: tuple val(name), path(reads) val (outputdir) - val (fastq_screen_args) + // fastq_screen_args are best passed in to the workflow in the following manner: + // --fastq_screen_args="--subset 200000 --force" + val (fastq_screen_args) val (verbose) output: @@ -21,8 +23,9 @@ process FASTQ_SCREEN { mode: "link", overwrite: true script: - fastq_screen_args = fastq_screen_args.replaceAll(/'/,"") - + println(name) + println(reads) + println(outputdir) if (verbose){ println ("[MODULE] FASTQ SCREEN ARGS: "+ fastq_screen_args) } diff --git a/tools/fastq_screen/test/main.nf b/tools/fastq_screen/test/main.nf new file mode 100755 index 00000000..be2b486e --- /dev/null +++ b/tools/fastq_screen/test/main.nf @@ -0,0 +1,30 @@ +#!/usr/bin/env nextflow +nextflow.preview.dsl = 2 + +params.outdir = "." +params.fastq_screen_args = '' +// fastq_screen_args are best passed in to the workflow in the following manner: +// --fastq_screen_args="--subset 200000 --force" + +params.verbose = false + +if (params.verbose){ + println ("[WORKFLOW] FASTQ SCREEN ARGS ARE: " + params.fastq_screen_args) +} + +// TODO: include '../../../nf-core/module_testing/check_process_outputs.nf' +include '../main.nf' + +// Define input channels + +ch_read_files = Channel + .fromFilePairs('../../../test-datasets/Ecoli*{1,2}.fastq.gz',size:-1) + // .view() // to check whether the input channel works + +// Run the workflow +workflow { + main: + FASTQ_SCREEN(ch_read_files, params.outdir, params.fastq_screen_args, params.verbose) + + // TODO .check_output() +} diff --git a/tools/fastq_screen/test/nextflow.config b/tools/fastq_screen/test/nextflow.config new file mode 100644 index 00000000..63c458ca --- /dev/null +++ b/tools/fastq_screen/test/nextflow.config @@ -0,0 +1,2 @@ +// docker.enabled = true +params.outdir = './results'