From aba8443bf02b80912e56b44d7d968c5c49913de4 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 11:23:26 -0700 Subject: [PATCH 01/15] attempt switching to common validate module --- CHANGELOG.md | 1 + config/default.config | 1 - main.nf | 1 - module/align_DNA_BWA_MEM2.nf | 2 +- module/align_DNA_HISAT2.nf | 2 +- module/validation.nf | 23 ----------------------- 6 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 module/validation.nf diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c26606b..c3310eb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] ### Changed +- Replace `blcdsdockerregistry/validate:2.1.5` (out of date) with the version from [pipeline-Nextflow-module](https://github.com/uclahs-cds/pipeline-Nextflow-module/tree/main/modules/PipeVal/validate). - Update input csv according to [here](https://confluence.mednet.ucla.edu/pages/viewpage.action?spaceKey=BOUTROSLAB&title=2022-07-27+Nextflow+Working+Group+Meeting+Notes) (Section "Input structures for alignment pipelines") - `run_MarkDuplicatesSpark_GATK` now retries once with 130GB on F72, and 140GB on M64 - Update registered output function diff --git a/config/default.config b/config/default.config index aa830e5b..60caf96d 100644 --- a/config/default.config +++ b/config/default.config @@ -19,7 +19,6 @@ params { docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" docker_image_picardtools = "blcdsdockerregistry/picard:2.26.10" docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0" - docker_image_validate_params = "blcdsdockerregistry/validate:2.1.5" docker_image_gatk = "broadinstitute/gatk:4.2.4.1" docker_image_samtools = "blcdsdockerregistry/samtools:1.15.1" diff --git a/main.nf b/main.nf index b1d1b89d..863da4c0 100644 --- a/main.nf +++ b/main.nf @@ -39,7 +39,6 @@ log.info """\ - HISAT2: ${params.aligner.contains("HISAT2") ? params.docker_image_hisat2_and_samtools : "None"} - Picard Tools: ${params.docker_image_picardtools} - sha512sum: ${params.docker_image_sha512sum} - - validate_params: ${params.docker_image_validate_params} - GATK: ${params.docker_image_gatk} ------------------------------------ diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 671bea8f..b8f0fd15 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -3,7 +3,7 @@ // here it actually saves cost, time, and memory to directly pipe the output into // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from './validation.nf' +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '..external/nextflow-modules/modules/PipeVal/validate/main.nf' include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' diff --git a/module/align_DNA_HISAT2.nf b/module/align_DNA_HISAT2.nf index f2ad499d..858ed311 100644 --- a/module/align_DNA_HISAT2.nf +++ b/module/align_DNA_HISAT2.nf @@ -4,7 +4,7 @@ // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools} from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from './validation.nf' +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '..external/nextflow-modules/modules/PipeVal/validate/main.nf' include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' diff --git a/module/validation.nf b/module/validation.nf deleted file mode 100644 index ab641392..00000000 --- a/module/validation.nf +++ /dev/null @@ -1,23 +0,0 @@ -process run_validate_PipeVal { - container params.docker_image_validate_params - - publishDir path: "${log_output_dir}/${task.process.split(':')[-1].replace('_', '-')}/${task.index}", - pattern: ".command.*", - mode: "copy", - saveAs: { "log${file(it).getName()}" } - - input: - path(file_to_validate) - val(log_output_dir) - - output: - path(".command.*") - path("input_validation.txt"), emit: val_file - - script: - """ - set -euo pipefail - - python -m validate -t file-input ${file_to_validate} > "input_validation.txt" - """ - } From d6771826b8f5f98f0c429beda0e0f533cd6504f1 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 11:34:36 -0700 Subject: [PATCH 02/15] external filepath --- module/align_DNA_BWA_MEM2.nf | 2 +- module/align_DNA_HISAT2.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index b8f0fd15..a5bed807 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -3,7 +3,7 @@ // here it actually saves cost, time, and memory to directly pipe the output into // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '..external/nextflow-modules/modules/PipeVal/validate/main.nf' +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' diff --git a/module/align_DNA_HISAT2.nf b/module/align_DNA_HISAT2.nf index 858ed311..90f88c88 100644 --- a/module/align_DNA_HISAT2.nf +++ b/module/align_DNA_HISAT2.nf @@ -4,7 +4,7 @@ // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools} from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '..external/nextflow-modules/modules/PipeVal/validate/main.nf' +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' From d5bcc29dc5d076f837cdd0c5793c44d146f53218 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 13:58:17 -0700 Subject: [PATCH 03/15] dont remove docker_image_validate_params --- config/default.config | 1 + main.nf | 1 + 2 files changed, 2 insertions(+) diff --git a/config/default.config b/config/default.config index 60caf96d..c4f5437b 100644 --- a/config/default.config +++ b/config/default.config @@ -19,6 +19,7 @@ params { docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" docker_image_picardtools = "blcdsdockerregistry/picard:2.26.10" docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0" + docker_image_validate_params = "blcdsdockerregistry/validate:2.1.5" docker_image_gatk = "broadinstitute/gatk:4.2.4.1" docker_image_samtools = "blcdsdockerregistry/samtools:1.15.1" diff --git a/main.nf b/main.nf index 863da4c0..b1d1b89d 100644 --- a/main.nf +++ b/main.nf @@ -39,6 +39,7 @@ log.info """\ - HISAT2: ${params.aligner.contains("HISAT2") ? params.docker_image_hisat2_and_samtools : "None"} - Picard Tools: ${params.docker_image_picardtools} - sha512sum: ${params.docker_image_sha512sum} + - validate_params: ${params.docker_image_validate_params} - GATK: ${params.docker_image_gatk} ------------------------------------ From ea041dfe27249fe0d8c209f9140b0a0c382cd012 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 13:59:09 -0700 Subject: [PATCH 04/15] validate v2.1.6 --- config/default.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.config b/config/default.config index c4f5437b..ea4d7954 100644 --- a/config/default.config +++ b/config/default.config @@ -19,7 +19,7 @@ params { docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" docker_image_picardtools = "blcdsdockerregistry/picard:2.26.10" docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0" - docker_image_validate_params = "blcdsdockerregistry/validate:2.1.5" + docker_image_validate_params = "blcdsdockerregistry/validate:2.1.6" docker_image_gatk = "broadinstitute/gatk:4.2.4.1" docker_image_samtools = "blcdsdockerregistry/samtools:1.15.1" From 75529bba9da5717d0e6eb1ba1414aecaab2d4b01 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 14:09:20 -0700 Subject: [PATCH 05/15] validate_output_file should only take 1 input --- module/align_DNA_BWA_MEM2.nf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index a5bed807..b4538cc1 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -3,7 +3,13 @@ // here it actually saves cost, time, and memory to directly pipe the output into // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( + options: [ + docker_image_version: params.pipeval_version, + process_label: 'process_low', + main_process: "BWA-MEM2-${params.bwa_version}" + ] + ) include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' @@ -128,8 +134,7 @@ workflow align_DNA_BWA_MEM2_workflow { och_bam.mix( och_bam_index, Channel.from(params.work_dir, params.output_dir) - ), - aligner_log_dir + ) ) validate_output_file.out.val_file.collectFile( name: 'output_validation.txt', From e4677fd3014a540934e7ea70137058a9e187c553 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 14:27:45 -0700 Subject: [PATCH 06/15] dont rename run_validate_PipeVal --- config/default.config | 1 + module/align_DNA_BWA_MEM2.nf | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/default.config b/config/default.config index ea4d7954..605525a8 100644 --- a/config/default.config +++ b/config/default.config @@ -14,6 +14,7 @@ params { // tools and their versions bwa_version = "BWA-MEM2-2.2.1" hisat2_version = "HISAT2-2.2.1" + pipeval_version = "2.1.6" docker_image_bwa_and_samtools = "blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1" docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index b4538cc1..783b193f 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -3,7 +3,7 @@ // here it actually saves cost, time, and memory to directly pipe the output into // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( +include { run_validate_PipeVal } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( options: [ docker_image_version: params.pipeval_version, process_label: 'process_low', @@ -89,8 +89,7 @@ workflow align_DNA_BWA_MEM2_workflow { run_validate_PipeVal(ich_samples_validate.mix( ich_reference_fasta, ich_reference_index_files - ), - aligner_log_dir + ) ) // change validation file name depending on whether inputs or outputs are being validated @@ -130,13 +129,13 @@ workflow align_DNA_BWA_MEM2_workflow { } } generate_sha512sum(och_bam_index.mix(och_bam), aligner_output_dir) - validate_output_file( + run_validate_PipeVal( och_bam.mix( och_bam_index, Channel.from(params.work_dir, params.output_dir) ) ) - validate_output_file.out.val_file.collectFile( + run_validate_PipeVal.out.val_file.collectFile( name: 'output_validation.txt', storeDir: "${aligner_validation_dir}" ) From 73f9547232da128369aa4dc46384ec6b24226311 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 14:41:53 -0700 Subject: [PATCH 07/15] run_validate_PipeVal.out.validation_result --- module/align_DNA_BWA_MEM2.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 783b193f..9732e74d 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -94,7 +94,7 @@ workflow align_DNA_BWA_MEM2_workflow { // change validation file name depending on whether inputs or outputs are being validated //val_filename = ${task.process.split(':')[1].replace('_', '-')} == run-validate ? "input_validation.txt" : "output_validation.txt" - run_validate_PipeVal.out.val_file.collectFile( + run_validate_PipeVal.out.validation_result.collectFile( name: 'input_validation.txt', storeDir: "${aligner_validation_dir}" ) @@ -135,7 +135,7 @@ workflow align_DNA_BWA_MEM2_workflow { Channel.from(params.work_dir, params.output_dir) ) ) - run_validate_PipeVal.out.val_file.collectFile( + run_validate_PipeVal.out.validation_result.collectFile( name: 'output_validation.txt', storeDir: "${aligner_validation_dir}" ) From 26a09f4da6e37dc2d5382db96ded18f3e71c2e82 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 15:15:04 -0700 Subject: [PATCH 08/15] pipeval v 3.0.0 --- config/default.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.config b/config/default.config index 605525a8..9c9ffa19 100644 --- a/config/default.config +++ b/config/default.config @@ -14,7 +14,7 @@ params { // tools and their versions bwa_version = "BWA-MEM2-2.2.1" hisat2_version = "HISAT2-2.2.1" - pipeval_version = "2.1.6" + pipeval_version = "3.0.0" docker_image_bwa_and_samtools = "blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1" docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" From 41b03800bef85d2ae9359e0a6e56914b6353721c Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 15:28:36 -0700 Subject: [PATCH 09/15] cant call run-validate_PipeVal twice, need to rename --- module/align_DNA_BWA_MEM2.nf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 9732e74d..37f568aa 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -10,6 +10,14 @@ include { run_validate_PipeVal } from '../external/nextflow-modules/modules/Pipe main_process: "BWA-MEM2-${params.bwa_version}" ] ) +// calling run_validate_PipeVal twice causes an error. The error message says to either rename it (which I'm trying now) or to 'reuse within a different workflow context' (?) +include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( + options: [ + docker_image_version: params.pipeval_version, + process_label: 'process_low', + main_process: "BWA-MEM2-${params.bwa_version}" + ] + ) include { run_MarkDuplicate_Picard } from './mark_duplicate_picardtools.nf' include { run_MarkDuplicatesSpark_GATK } from './mark_duplicates_spark.nf' include { generate_sha512sum } from './check_512sum.nf' @@ -129,13 +137,13 @@ workflow align_DNA_BWA_MEM2_workflow { } } generate_sha512sum(och_bam_index.mix(och_bam), aligner_output_dir) - run_validate_PipeVal( + validate_output_file( och_bam.mix( och_bam_index, Channel.from(params.work_dir, params.output_dir) ) ) - run_validate_PipeVal.out.validation_result.collectFile( + validate_output_file.out.validation_result.collectFile( name: 'output_validation.txt', storeDir: "${aligner_validation_dir}" ) From 6e155a84f7d4ee1b76c76f13d7ca5c04f4df1565 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 31 Aug 2022 15:35:56 -0700 Subject: [PATCH 10/15] cant call run_validate_PipeVal twice, need to rename --- module/align_DNA_BWA_MEM2.nf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 37f568aa..41c4391d 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -3,13 +3,7 @@ // here it actually saves cost, time, and memory to directly pipe the output into // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -include { run_validate_PipeVal } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( - options: [ - docker_image_version: params.pipeval_version, - process_label: 'process_low', - main_process: "BWA-MEM2-${params.bwa_version}" - ] - ) + // calling run_validate_PipeVal twice causes an error. The error message says to either rename it (which I'm trying now) or to 'reuse within a different workflow context' (?) include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( options: [ From 6ffaa5068ff2a73d8860395cd286e8ca091db383 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Fri, 2 Sep 2022 14:24:25 -0700 Subject: [PATCH 11/15] docker validate params v 3.0.0 --- config/default.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.config b/config/default.config index 9c9ffa19..e1dc9c36 100644 --- a/config/default.config +++ b/config/default.config @@ -20,7 +20,7 @@ params { docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" docker_image_picardtools = "blcdsdockerregistry/picard:2.26.10" docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0" - docker_image_validate_params = "blcdsdockerregistry/validate:2.1.6" + docker_image_validate_params = "blcdsdockerregistry/validate:3.0.0" docker_image_gatk = "broadinstitute/gatk:4.2.4.1" docker_image_samtools = "blcdsdockerregistry/samtools:1.15.1" From 920b132680ebbed584f5ad629a9cb921b6b6e8a6 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Fri, 2 Sep 2022 14:26:06 -0700 Subject: [PATCH 12/15] docker_image_validate_params: replace validate with pipeval --- config/default.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.config b/config/default.config index e1dc9c36..a63dfa15 100644 --- a/config/default.config +++ b/config/default.config @@ -20,7 +20,7 @@ params { docker_image_hisat2_and_samtools = "blcdsdockerregistry/hisat2_samtools-1.12:2.2.1" docker_image_picardtools = "blcdsdockerregistry/picard:2.26.10" docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0" - docker_image_validate_params = "blcdsdockerregistry/validate:3.0.0" + docker_image_validate_params = "blcdsdockerregistry/pipeval:3.0.0" docker_image_gatk = "broadinstitute/gatk:4.2.4.1" docker_image_samtools = "blcdsdockerregistry/samtools:1.15.1" From b0ae698668da69eb2ca8fc67dddb5ef279b98084 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Wed, 7 Sep 2022 14:33:05 -0700 Subject: [PATCH 13/15] format --- module/align_DNA_BWA_MEM2.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 41c4391d..419fd02c 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -88,7 +88,8 @@ workflow align_DNA_BWA_MEM2_workflow { ich_reference_fasta ich_reference_index_files main: - run_validate_PipeVal(ich_samples_validate.mix( + run_validate_PipeVal( + ich_samples_validate.mix( // ich_reference_fasta, ich_reference_index_files ) From 34cf06a21d54ede7433205007a44237ee54e0721 Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Tue, 20 Sep 2022 14:54:56 -0700 Subject: [PATCH 14/15] setup run_validate_PipeVal input to be tuple cardinality 2 --- module/align_DNA_BWA_MEM2.nf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index 419fd02c..e3a0b242 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -4,7 +4,7 @@ // samtools due to the large size of the uncompressed SAM files. include { run_sort_SAMtools ; run_merge_SAMtools } from './samtools.nf' -// calling run_validate_PipeVal twice causes an error. The error message says to either rename it (which I'm trying now) or to 'reuse within a different workflow context' (?) +// need to rename run_validate_PipeVal since using twice. Use run_validate_PipeVal for input validation; validate_output_file for output validation include { run_validate_PipeVal; run_validate_PipeVal as validate_output_file } from '../external/nextflow-modules/modules/PipeVal/validate/main.nf' addParams( options: [ docker_image_version: params.pipeval_version, @@ -88,13 +88,17 @@ workflow align_DNA_BWA_MEM2_workflow { ich_reference_fasta ich_reference_index_files main: - run_validate_PipeVal( - ich_samples_validate.mix( // + + run_validate_PipeVal_inputs = ich_samples_validate.mix( // ich_reference_fasta, ich_reference_index_files ) - ) + .map { it -> ["file-input", it] } + run_validate_PipeVal( + run_validate_PipeVal_inputs + ) + // change validation file name depending on whether inputs or outputs are being validated //val_filename = ${task.process.split(':')[1].replace('_', '-')} == run-validate ? "input_validation.txt" : "output_validation.txt" run_validate_PipeVal.out.validation_result.collectFile( From 27f641a54e447e90dda375b0223f63289c9a655e Mon Sep 17 00:00:00 2001 From: Jaron Arbet <[jarbet@mednet.ucla.edu]> Date: Tue, 20 Sep 2022 15:06:17 -0700 Subject: [PATCH 15/15] setup validate_output_file process inputs to be tuple cardinality 2 --- module/align_DNA_BWA_MEM2.nf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/align_DNA_BWA_MEM2.nf b/module/align_DNA_BWA_MEM2.nf index e3a0b242..a51805ee 100644 --- a/module/align_DNA_BWA_MEM2.nf +++ b/module/align_DNA_BWA_MEM2.nf @@ -136,11 +136,14 @@ workflow align_DNA_BWA_MEM2_workflow { } } generate_sha512sum(och_bam_index.mix(och_bam), aligner_output_dir) + + validate_output_file_inputs = och_bam.mix( + och_bam_index, + Channel.from(params.work_dir, params.output_dir) + ) + .map { it -> ["file-input", it] } validate_output_file( - och_bam.mix( - och_bam_index, - Channel.from(params.work_dir, params.output_dir) - ) + validate_output_file_inputs ) validate_output_file.out.validation_result.collectFile( name: 'output_validation.txt',