diff --git a/conf/test_all.config b/conf/test_all.config index c1b0057f..fc2e845f 100644 --- a/conf/test_all.config +++ b/conf/test_all.config @@ -33,6 +33,7 @@ params { phase = true normalize = true compute_freq = false + chunk_model = "recursive" // Pipeline steps steps = "all" diff --git a/conf/test_dog.config b/conf/test_dog.config index 33755994..6ebc015e 100644 --- a/conf/test_dog.config +++ b/conf/test_dog.config @@ -32,6 +32,7 @@ params { normalize = false compute_freq = false rename_chr = true + chunk_model = "recursive" // Input data input = params.pipelines_testdata_base_path + "dog_data/csv/sample_dog.csv" diff --git a/conf/test_panelprep.config b/conf/test_panelprep.config index 181d81de..f62f2189 100644 --- a/conf/test_panelprep.config +++ b/conf/test_panelprep.config @@ -32,6 +32,7 @@ params { normalize = true compute_freq = true remove_samples = "HG00096,HG00097,HG00099,HG00100" + chunk_model = "recursive" // Pipeline steps steps = "panelprep" diff --git a/nextflow.config b/nextflow.config index 14781b4a..3e402c96 100644 --- a/nextflow.config +++ b/nextflow.config @@ -10,7 +10,7 @@ params { // steps - steps = null + steps = null // Input options input = null @@ -24,6 +24,7 @@ params { normalize = true compute_freq = false remove_samples = null + chunk_model = 'sequential' // ChrCheck parameters rename_chr = false diff --git a/nextflow_schema.json b/nextflow_schema.json index c51892b8..b1cb417e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -132,6 +132,13 @@ "binaryref": { "type": "string", "description": "Whether to generate a binary reference file to be used with GLIMPSE2" + }, + "chunk_model" : { + "type": "string", + "description": "Model type to use for GLIMPSE2_CHUNK", + "enum": ["recursive", "sequential", "uniform-number-variants"], + "default": "sequential", + "hidden": true } } }, diff --git a/subworkflows/local/vcf_chunk_glimpse/main.nf b/subworkflows/local/vcf_chunk_glimpse/main.nf index 64ab8692..cca84ce7 100644 --- a/subworkflows/local/vcf_chunk_glimpse/main.nf +++ b/subworkflows/local/vcf_chunk_glimpse/main.nf @@ -7,6 +7,7 @@ workflow VCF_CHUNK_GLIMPSE { take: ch_reference // channel: [ [panel, chr], vcf, csi ] ch_map // channel (optional): [ [chr], map ] + chunk_model // channel : model main: @@ -36,9 +37,6 @@ workflow VCF_CHUNK_GLIMPSE { ) .map { metaPC, it -> [metaPC, it["RegionIn"], it["RegionOut"]]} - // Make chunks with Glimpse2 (does not work with "sequential" mode) - chunk_model = "recursive" - ch_input_glimpse2 = ch_vcf_csi_chr .map{ metaPC, vcf, csi, chr -> [metaPC.subMap("chr"), metaPC, vcf, csi, chr] diff --git a/subworkflows/local/vcf_chunk_glimpse/tests/main.nf.test b/subworkflows/local/vcf_chunk_glimpse/tests/main.nf.test index c222059e..f25d7a05 100644 --- a/subworkflows/local/vcf_chunk_glimpse/tests/main.nf.test +++ b/subworkflows/local/vcf_chunk_glimpse/tests/main.nf.test @@ -47,6 +47,7 @@ nextflow_workflow { file(params.pipelines_testdata_base_path + "hum_data/reference_genome/GRCh38_21.map", checkIfExist:true) ] ) + input[2] = "recursive" """ } } @@ -87,6 +88,7 @@ nextflow_workflow { [[chr: "chr22"], []], [[chr: "chr21"], []] ) + input[2] = "recursive" """ } } diff --git a/subworkflows/local/vcf_phase_shapeit5/main.nf b/subworkflows/local/vcf_phase_shapeit5/main.nf index eef71b0c..a8950adb 100644 --- a/subworkflows/local/vcf_phase_shapeit5/main.nf +++ b/subworkflows/local/vcf_phase_shapeit5/main.nf @@ -7,19 +7,17 @@ include { BCFTOOLS_INDEX as VCF_BCFTOOLS_INDEX_2 } from '../../../modules/nf-cor workflow VCF_PHASE_SHAPEIT5 { take: - ch_vcf // channel (mandatory): [ [id, chr], vcf, csi, pedigree ] + ch_vcf // channel (mandatory) : [ [id, chr], vcf, csi, pedigree ] ch_region // channel (mandatory) : [ [chr, region], region ] - ch_ref // channel (optional) : [ [id, chr], ref, csi ] - ch_scaffold // channel (optional) : [ [id, chr], scaffold, csi ] + ch_ref // channel (optional) : [ [id, chr], ref, csi ] + ch_scaffold // channel (optional) : [ [id, chr], scaffold, csi ] ch_map // channel (mandatory) : [ [chr], map] + chunk_model // channel (mandatory) : [ model ] main: ch_versions = Channel.empty() - // Make chunks with Glimpse2 (does not work with "sequential" mode) - chunk_model = "recursive" - // Chunk with Glimpse2 ch_input_glimpse2 = ch_vcf .map{ diff --git a/subworkflows/local/vcf_phase_shapeit5/tests/main.nf.test b/subworkflows/local/vcf_phase_shapeit5/tests/main.nf.test index 4c1eed92..26b5587e 100644 --- a/subworkflows/local/vcf_phase_shapeit5/tests/main.nf.test +++ b/subworkflows/local/vcf_phase_shapeit5/tests/main.nf.test @@ -52,6 +52,7 @@ nextflow_workflow { [[chr: "chr22"],[]], [[chr: "chr21"], []] ) + input[5] = "recursive" """ } } @@ -109,6 +110,7 @@ nextflow_workflow { [ [chr: "chr22"], file(params.pipelines_testdata_base_path + "hum_data/reference_genome/GRCh38_22.map", checkIfExist:true)], [ [chr: "chr21"], file(params.pipelines_testdata_base_path + "hum_data/reference_genome/GRCh38_21.map", checkIfExist:true)] ) + input[5] = "recursive" """ } } diff --git a/workflows/phaseimpute/main.nf b/workflows/phaseimpute/main.nf index 55fd4805..4c058803 100644 --- a/workflows/phaseimpute/main.nf +++ b/workflows/phaseimpute/main.nf @@ -171,14 +171,15 @@ workflow PHASEIMPUTE { ch_region, [[],[],[]], [[],[],[]], - ch_map + ch_map, + params.chunk_model ) ch_panel_phased = VCF_PHASE_SHAPEIT5.out.vcf_tbi ch_versions = ch_versions.mix(VCF_PHASE_SHAPEIT5.out.versions) } // Create chunks from reference VCF - VCF_CHUNK_GLIMPSE(ch_panel_phased, ch_map) + VCF_CHUNK_GLIMPSE(ch_panel_phased, ch_map, params.chunk_model) ch_versions = ch_versions.mix(VCF_CHUNK_GLIMPSE.out.versions) // Assign chunks channels