-
Notifications
You must be signed in to change notification settings - Fork 23
Add parameter glimpse version #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
d5a13aa
de8bce4
68ca6c1
2c408e1
5869c21
4314540
535852e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ workflow NFCORE_PHASEIMPUTE { | |
| rename_chr // parameter: rename chromosome prefix | ||
| max_chr_names // parameter: max number of chr to show in message | ||
| params_simulate // map: parameters use for simulation step [depth: float, genotype: path] | ||
| params_panelprep // map: parameters use for panelprep step [normalize: boolean, remove_samples: string, compute_freq: boolean, phase: boolean, chunk_model: string ] | ||
| params_panelprep // map: parameters use for panelprep step [normalize: boolean, remove_samples: string, compute_freq: boolean, phase: boolean, chunk_model: string, chunk_version: string ] | ||
| params_impute // map: parameters use for imputation step [batch_size: integer, k_val: integer, n_gen: integer, buffer: integer] | ||
| params_validate // map: parameters use for validation step [bins: string, min_val_gl: float, min_val_dp: integer] | ||
| params_multiqc // map: parameters use for multiqc report [config: path, logo: path, methods_description: string] | ||
|
|
@@ -166,7 +166,8 @@ workflow { | |
| remove_samples: params.remove_samples, | ||
| compute_freq : params.compute_freq, | ||
| phase : params.phase, | ||
| chunk_model : params.chunk_model | ||
| chunk_model : params.chunk_model, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chunk model won't apply to both v1 and v2, right? Should we have a warning if you provide a v2 model and request a v1 version?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a test case can be added to cover for this scenario as well |
||
| chunk_version : params.chunk_version | ||
| ] | ||
|
|
||
| def params_impute = [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,52 +6,30 @@ workflow VCF_CHUNK_GLIMPSE { | |
| take: | ||
| ch_reference // channel (mandatory): [ [panel_id, chr], vcf, csi ] | ||
| ch_map // channel (optional) : [ [panel_id, chr], map ] | ||
| chunk_model // channel : model | ||
| chunk_model // value : model | ||
| chunk_version // value : glimpse version to use | ||
|
|
||
| main: | ||
|
|
||
| // Add chromosome to channel | ||
| ch_vcf_csi_chr = ch_reference | ||
| .map{metaPC, vcf, csi -> [metaPC, vcf, csi, metaPC.chr]} | ||
|
|
||
| // Make chunks with Glimpse1 | ||
| GLIMPSE_CHUNK(ch_vcf_csi_chr) | ||
|
|
||
| // Rearrange chunks into channel for QUILT | ||
| ch_chunks_quilt = GLIMPSE_CHUNK.out.chunk_chr | ||
| .splitText() | ||
| .map { metaPC, line -> | ||
| def fields = line.split("\t") | ||
| def startEnd = fields[2].split(':')[1].split('-') | ||
| [metaPC, metaPC.chr, startEnd[0], startEnd[1]] | ||
| } | ||
|
|
||
| // Rearrange chunks into channel for GLIMPSE1 and GLIMPSE2 | ||
| ch_chunks_glimpse1 = GLIMPSE_CHUNK.out.chunk_chr | ||
| .splitCsv( | ||
| header: ['ID', 'Chr', 'RegionIn', 'RegionOut', 'Size1', 'Size2'], | ||
| sep: "\t", skip: 0 | ||
| ) | ||
| .map { metaPC, it -> [metaPC, it["RegionIn"], it["RegionOut"]]} | ||
|
|
||
| ch_input_glimpse2 = ch_vcf_csi_chr | ||
| .combine(ch_map, by:0) | ||
|
|
||
| GLIMPSE2_CHUNK(ch_input_glimpse2, chunk_model) | ||
|
|
||
| // Rearrange channels | ||
| ch_chunks_glimpse2 = GLIMPSE2_CHUNK.out.chunk_chr | ||
| .splitCsv( | ||
| header: [ | ||
| 'ID', 'Chr', 'RegionBuf', 'RegionCnk', 'WindowCm', | ||
| 'WindowMb', 'NbTotVariants', 'NbComVariants' | ||
| ], sep: "\t", skip: 0 | ||
| ) | ||
| .map { metaPC, it -> [metaPC, it["RegionBuf"], it["RegionCnk"]]} | ||
| if (chunk_version == "V1") { | ||
| // Make chunks with Glimpse1 | ||
| GLIMPSE_CHUNK(ch_vcf_csi_chr) | ||
|
|
||
| ch_chunks = GLIMPSE_CHUNK.out.chunk_chr | ||
| } else if (chunk_version == "V2") { | ||
| ch_input_glimpse2 = ch_vcf_csi_chr | ||
| .combine(ch_map, by:0) | ||
|
|
||
| GLIMPSE2_CHUNK(ch_input_glimpse2, chunk_model) | ||
| ch_chunks = GLIMPSE2_CHUNK.out.chunk_chr | ||
| } else { | ||
| error ("Parameter chunk_version should be V1 or V2, found: ${chunk_version}.") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not needed since it should fail before this if a different one is provided. It should fail and error due to the schema which only allows enums. |
||
| } | ||
|
|
||
| emit: | ||
| chunks = GLIMPSE_CHUNK.out.chunk_chr // channel: [ [panel_id, chr], txt ] | ||
| chunks_quilt = ch_chunks_quilt // channel: [ [panel_id, chr], chr, start, end ] | ||
| chunks_glimpse1 = ch_chunks_glimpse1 // channel: [ [panel_id, chr], chr, region1, region2 ] | ||
| chunks_glimpse2 = ch_chunks_glimpse2 // channel: [ [panel_id, chr], chr, region1, region2 ] | ||
| chunks = ch_chunks // channel: [ [panel_id, chr], txt ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update usage.md to document these new changes, please? Thank you :)