Skip to content

Commit

Permalink
Set params.chunk_model
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisLeNezet committed Nov 8, 2024
1 parent ca6c5a5 commit 7a5938b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
1 change: 1 addition & 0 deletions conf/test_all.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ params {
phase = true
normalize = true
compute_freq = false
chunk_model = "recursive"

// Pipeline steps
steps = "all"
Expand Down
1 change: 1 addition & 0 deletions conf/test_dog.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions conf/test_panelprep.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ params {
normalize = true
compute_freq = true
remove_samples = "HG00096,HG00097,HG00099,HG00100"
chunk_model = "recursive"

// Pipeline steps
steps = "panelprep"
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
params {

// steps
steps = null
steps = null

// Input options
input = null
Expand All @@ -24,6 +24,7 @@ params {
normalize = true
compute_freq = false
remove_samples = null
chunk_model = 'sequential'

// ChrCheck parameters
rename_chr = false
Expand Down
7 changes: 7 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions subworkflows/local/vcf_chunk_glimpse/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions subworkflows/local/vcf_chunk_glimpse/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ nextflow_workflow {
file(params.pipelines_testdata_base_path + "hum_data/reference_genome/GRCh38_21.map", checkIfExist:true)
]
)
input[2] = "recursive"
"""
}
}
Expand Down Expand Up @@ -87,6 +88,7 @@ nextflow_workflow {
[[chr: "chr22"], []],
[[chr: "chr21"], []]
)
input[2] = "recursive"
"""
}
}
Expand Down
10 changes: 4 additions & 6 deletions subworkflows/local/vcf_phase_shapeit5/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions subworkflows/local/vcf_phase_shapeit5/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ nextflow_workflow {
[[chr: "chr22"],[]],
[[chr: "chr21"], []]
)
input[5] = "recursive"
"""
}
}
Expand Down Expand Up @@ -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"
"""
}
}
Expand Down
5 changes: 3 additions & 2 deletions workflows/phaseimpute/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a5938b

Please sign in to comment.