From b3c6ecbdd9c6e1d40ae905aef36f9eb8beac6928 Mon Sep 17 00:00:00 2001 From: Caitlin Winkler Date: Fri, 15 Nov 2024 06:51:15 -0700 Subject: [PATCH 1/4] Have fq lint module exit on failed validation --- modules/nf-core/fq/lint/main.nf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/nf-core/fq/lint/main.nf b/modules/nf-core/fq/lint/main.nf index 943314c87f4..4209257c1e5 100644 --- a/modules/nf-core/fq/lint/main.nf +++ b/modules/nf-core/fq/lint/main.nf @@ -1,6 +1,7 @@ process FQ_LINT { tag "$meta.id" label 'process_low' + errorStrategy 'terminate' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -29,5 +30,10 @@ process FQ_LINT { "${task.process}": fq: \$(echo \$(fq lint --version | sed 's/fq-lint //g')) END_VERSIONS + + if ! tail -n 1 ${prefix}.fq_lint.txt | grep -q 'fq-lint end'; then + echo "ERROR: Linting failure detected for ${meta.id}. See ${prefix}.fq_lint.txt for details." + exit 1 + fi """ } From 4e8ef402a8fbee52baf68b32f53d6253e47b4d35 Mon Sep 17 00:00:00 2001 From: Caitlin Winkler Date: Fri, 15 Nov 2024 07:01:31 -0700 Subject: [PATCH 2/4] Update subworkflow --- .../fastq_qc_trim_filter_setstrandedness/main.nf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf index c655af41588..e7f023e7145 100644 --- a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf +++ b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf @@ -4,6 +4,7 @@ include { BBMAP_BBSPLIT } from '../../../modules/nf-core/bbmap include { CAT_FASTQ } from '../../../modules/nf-core/cat/fastq/main' include { SORTMERNA } from '../../../modules/nf-core/sortmerna/main' include { SORTMERNA as SORTMERNA_INDEX } from '../../../modules/nf-core/sortmerna/main' +include { FQ_LINT } from '../../../modules/nf-core/fq/lint/main' include { FASTQ_SUBSAMPLE_FQ_SALMON } from '../fastq_subsample_fq_salmon' include { FASTQ_FASTQC_UMITOOLS_TRIMGALORE } from '../fastq_fastqc_umitools_trimgalore' @@ -106,6 +107,7 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS { umi_discard_read // integer: 0, 1 or 2 stranded_threshold // float: The fraction of stranded reads that must be assigned to a strandedness for confident assignment. Must be at least 0.5 unstranded_threshold // float: The difference in fraction of stranded reads assigned to 'forward' and 'reverse' below which a sample is classified as 'unstranded' + skip_linting // boolean: true/false main: @@ -114,6 +116,16 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS { ch_trim_read_count = Channel.empty() ch_multiqc_files = Channel.empty() + // + // MODULE: Lint FastQ files + // + if(!skip_linting) { + FQ_LINT ( + ch_fastq_lint.map{ meta, fastqs -> [meta, fastqs.flatten()] } + ) + ch_versions = ch_versions.mix(FQ_LINT.out.versions.first()) + } + ch_reads .branch { meta, fastqs -> From cc79afc7346daecf43e413003f62371a320a30bf Mon Sep 17 00:00:00 2001 From: Caitlin Winkler Date: Fri, 15 Nov 2024 11:13:37 -0700 Subject: [PATCH 3/4] Add module output to subworkflow --- .../nf-core/fastq_qc_trim_filter_setstrandedness/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf index e7f023e7145..76b7131dfbb 100644 --- a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf +++ b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf @@ -124,6 +124,7 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS { ch_fastq_lint.map{ meta, fastqs -> [meta, fastqs.flatten()] } ) ch_versions = ch_versions.mix(FQ_LINT.out.versions.first()) + ch_lint_log = FQ_LINT.out.lint } ch_reads @@ -324,6 +325,7 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS { emit: + lint_log = ch_lint_log reads = ch_strand_inferred_fastq trim_read_count = ch_trim_read_count From 98a21059c5e70c4285d76a4f84fd770a8708fc91 Mon Sep 17 00:00:00 2001 From: Caitlin Winkler Date: Mon, 18 Nov 2024 09:48:19 -0700 Subject: [PATCH 4/4] Remove custom changes from fq lint main.nf --- modules/nf-core/fq/lint/main.nf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/nf-core/fq/lint/main.nf b/modules/nf-core/fq/lint/main.nf index 4209257c1e5..943314c87f4 100644 --- a/modules/nf-core/fq/lint/main.nf +++ b/modules/nf-core/fq/lint/main.nf @@ -1,7 +1,6 @@ process FQ_LINT { tag "$meta.id" label 'process_low' - errorStrategy 'terminate' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -30,10 +29,5 @@ process FQ_LINT { "${task.process}": fq: \$(echo \$(fq lint --version | sed 's/fq-lint //g')) END_VERSIONS - - if ! tail -n 1 ${prefix}.fq_lint.txt | grep -q 'fq-lint end'; then - echo "ERROR: Linting failure detected for ${meta.id}. See ${prefix}.fq_lint.txt for details." - exit 1 - fi """ }