From ddb6d9a87b7178b6927821a3a2c1de2f2efa6e7f Mon Sep 17 00:00:00 2001 From: Sorel Fitz-Gibbon Date: Tue, 12 Mar 2024 16:12:57 -0700 Subject: [PATCH 1/3] standardize input structure --- config/custom_schema_types.config | 5 ++- config/methods.config | 2 +- config/schema.yaml | 55 ++++++++++++++------------ input/example-multiple-samples.yaml | 17 ++++---- input/example.yaml | 15 +++---- test/yaml/a_mini-multiple-samples.yaml | 18 ++++----- test/yaml/a_mini.yaml | 14 +++---- 7 files changed, 68 insertions(+), 58 deletions(-) diff --git a/config/custom_schema_types.config b/config/custom_schema_types.config index c454cb1..0e5df32 100644 --- a/config/custom_schema_types.config +++ b/config/custom_schema_types.config @@ -1,5 +1,8 @@ custom_schema_types { allowed_input_types = [ + 'BAM' + ] + allowed_bam_types = [ 'normal', 'tumor' ] @@ -55,7 +58,7 @@ custom_schema_types { } types = [ - 'BAMEntryList': custom_schema_types.check_list_of_namespace, + 'MapList': custom_schema_types.check_list_of_namespace, 'ResourceUpdateNamespace': custom_schema_types.check_resource_update_namespace, 'ResourceUpdateList': custom_schema_types.check_resource_update_list ] diff --git a/config/methods.config b/config/methods.config index 01f0663..ae8786b 100644 --- a/config/methods.config +++ b/config/methods.config @@ -7,7 +7,7 @@ includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/retry/retr methods { get_ids_from_bams = { params.samples_to_process = [] as Set - params.input.each { k, v -> + params.input['BAM'].each { k, v -> v.each { sampleMap -> def bam_path = sampleMap['path'] def bam_header = bam_parser.parse_bam_header(bam_path) diff --git a/config/schema.yaml b/config/schema.yaml index 2c295bd..25c226a 100644 --- a/config/schema.yaml +++ b/config/schema.yaml @@ -107,31 +107,36 @@ input: required: true help: 'Input to process' elements: - normal: - type: 'BAMEntryList' - required: false - help: 'Normal sample input specifications' + BAM: + type: 'InputBAMNamespace' + required: true + help: 'BAM input specifications' elements: - path: - type: 'Path' - mode: 'r' - required: true - help: 'Absolute path to normal sample BAM files' - read_length: - type: 'Integer' + normal: + type: 'MapList' required: false - help: 'Length of the reads in the BAM file' - tumor: - type: 'BAMEntryList' - required: false - help: 'Tumor sample input specifications' - elements: - path: - type: 'Path' - mode: 'r' - required: true - help: 'Absolute path to tumor sample BAM files' - read_length: - type: 'Integer' + help: 'Normal sample input specifications' + elements: + path: + type: 'Path' + mode: 'r' + required: true + help: 'Absolute path to normal sample BAM files' + read_length: + type: 'Integer' + required: false + help: 'Length of the reads in the BAM file' + tumor: + type: 'MapList' required: false - help: 'Length of the reads in the BAM file' + help: 'Tumor sample input specifications' + elements: + path: + type: 'Path' + mode: 'r' + required: true + help: 'Absolute path to tumor sample BAM files' + read_length: + type: 'Integer' + required: false + help: 'Length of the reads in the BAM file' diff --git a/input/example-multiple-samples.yaml b/input/example-multiple-samples.yaml index 0f1bf76..648b9e1 100644 --- a/input/example-multiple-samples.yaml +++ b/input/example-multiple-samples.yaml @@ -2,11 +2,12 @@ patient_id: 'patient_id' dataset_id: 'dataset_id' input: - normal: - - path: /absolute/path/to/normal.bam - read_length: length - tumor: - - path: /absolute/path/to/first.tumor.bam - read_length: length - - path: /absolute/path/to/second.tumor.bam - read_length: length + BAM: + normal: + - path: /absolute/path/to/normal.bam + read_length: length + tumor: + - path: /absolute/path/to/first.tumor.bam + read_length: length + - path: /absolute/path/to/second.tumor.bam + read_length: length diff --git a/input/example.yaml b/input/example.yaml index 87cb163..99caef9 100644 --- a/input/example.yaml +++ b/input/example.yaml @@ -1,10 +1,11 @@ --- patient_id: 'patient_id' dataset_id: 'dataset_id' -input: - normal: - - path: /absolute/path/to/normal.bam - read_length: length - tumor: - - path: /absolute/path/to/tumor.bam - read_length: length +BAM: + input: + normal: + - path: /absolute/path/to/normal.bam + read_length: length + tumor: + - path: /absolute/path/to/tumor.bam + read_length: length diff --git a/test/yaml/a_mini-multiple-samples.yaml b/test/yaml/a_mini-multiple-samples.yaml index 042f9f3..5f0d477 100644 --- a/test/yaml/a_mini-multiple-samples.yaml +++ b/test/yaml/a_mini-multiple-samples.yaml @@ -2,12 +2,12 @@ patient_id: 'TWGSAMIN000001' dataset_id: 'TWGSAMIN' input: - normal: - - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/HG002.N-n2.bam - read_length: 150 - - tumor: - - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n2.bam - read_length: 150 - - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n1_SMadjust.bam - read_length: 150 + BAM: + normal: + - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/HG002.N-n2.bam + read_length: 150 + tumor: + - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n2.bam + read_length: 150 + - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n1_SMadjust.bam + read_length: 150 diff --git a/test/yaml/a_mini.yaml b/test/yaml/a_mini.yaml index c839abf..7677047 100644 --- a/test/yaml/a_mini.yaml +++ b/test/yaml/a_mini.yaml @@ -2,10 +2,10 @@ patient_id: 'TWGSAMIN000001' dataset_id: 'TWGSAMIN' input: - normal: - - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/HG002.N-n2.bam - read_length: 150 - - tumor: - - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n2.bam - read_length: 150 + BAM: + normal: + - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/HG002.N-n2.bam + read_length: 150 + tumor: + - path: /hot/software/pipeline/pipeline-generate-SQC-BAM/Nextflow/development/test-input/S2.T-n2.bam + read_length: 150 From d77c6e1e8bb3847a850bdbd30399c4fc73e49a01 Mon Sep 17 00:00:00 2001 From: Sorel Fitz-Gibbon Date: Tue, 12 Mar 2024 16:18:16 -0700 Subject: [PATCH 2/3] update version and changelog --- CHANGELOG.md | 4 ++++ nextflow.config | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad52e37..4fd1623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed +## [1.0.0] - 2024-03-12 +### Changed +- Standardized input structure + ## [1.0.0-rc.1] - 2024-03-08 ### Added - Add `schema.yaml` diff --git a/nextflow.config b/nextflow.config index b4f3feb..ed9ca34 100644 --- a/nextflow.config +++ b/nextflow.config @@ -3,5 +3,5 @@ manifest { name = 'generate-SQC-BAM' author = 'Sorel Fitz-Gibbon' description = 'Sample level QC for DNA sequencing data' - version = '1.0.0-rc.1' + version = '1.0.0' } From 42a8ca32eb41668eb00887ec848a0a2e30e19d88 Mon Sep 17 00:00:00 2001 From: Sorel Fitz-Gibbon Date: Tue, 12 Mar 2024 16:56:40 -0700 Subject: [PATCH 3/3] typo --- input/example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/example.yaml b/input/example.yaml index 99caef9..6a1a7ec 100644 --- a/input/example.yaml +++ b/input/example.yaml @@ -1,8 +1,8 @@ --- patient_id: 'patient_id' dataset_id: 'dataset_id' -BAM: - input: +input: + BAM: normal: - path: /absolute/path/to/normal.bam read_length: length