Repository navigation
Severus fix #223
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
Merged
Merged
Severus fix #223
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -867,31 +867,47 @@ workflow LRSOMATIC { | |
| ) | ||
| } | ||
|
|
||
| // SEVERUS input: tumor-only and paired samples with their phased germline VCF; [] normal BAM/BAI = tumor-only mode | ||
| branched_minimap.tumor_only | ||
| .map{ meta, bam, bai -> | ||
| def new_meta = meta.subMap('id', | ||
| 'paired_data', | ||
| 'platform', | ||
| 'sex', | ||
| 'fiber', | ||
| 'clair3_model', | ||
| 'clairS_model', | ||
| 'clairSTO_model', | ||
| 'kinetics') | ||
| return[new_meta, bam, bai] | ||
| // SEVERUS input: tumor-only and paired samples with their phased germline VCF; [] normal BAM/BAI = tumor-only mode. | ||
| // Severus, Wakhan and SAVANA read the HP (haplotype) tag per read, so build it from | ||
| // PHASING_HAPLOTYPING's haplotagged BAMs rather than the unphased minimap2 BAMs. | ||
| def sv_meta_keys = ['id', 'paired_data', 'platform', 'sex', 'fiber', | ||
| 'clair3_model', 'clairS_model', 'clairSTO_model', 'kinetics'] | ||
|
|
||
| PHASING_HAPLOTYPING.out.tumor_normal_hapbams_ch | ||
| .branch { meta, _bam, _bai -> | ||
| tumor_only: !meta.paired_data | ||
| paired_tumor: meta.paired_data && meta.type == 'tumor' | ||
| paired_normal: meta.paired_data && meta.type == 'normal' | ||
| } | ||
| .map{meta, tumor_bam, tumor_bai-> | ||
| .set { branched_hapbams } | ||
|
|
||
| branched_hapbams.tumor_only | ||
| .map { meta, bam, bai -> | ||
| def normal_bam = [] | ||
| def normal_bai = [] | ||
| return [meta, tumor_bam, tumor_bai, normal_bam, normal_bai] | ||
| return [meta.subMap(sv_meta_keys), bam, bai, normal_bam, normal_bai] | ||
| } | ||
| // Mix with paired T/N input (which already has normal BAM/BAI from somatic_smallvar_input) | ||
| .mix(somatic_smallvar_input) | ||
| .set { tumoronly_hapbams } | ||
|
|
||
| branched_hapbams.paired_tumor | ||
| .map { meta, bam, bai -> return [meta.subMap(sv_meta_keys), bam, bai] } | ||
| .set { paired_tumor_hapbams } | ||
|
|
||
| branched_hapbams.paired_normal | ||
| .map { meta, bam, bai -> return [meta.subMap(sv_meta_keys), bam, bai] } | ||
| .set { paired_normal_hapbams } | ||
|
|
||
| paired_tumor_hapbams | ||
| .join(paired_normal_hapbams) | ||
| .set { paired_hapbams } | ||
| // paired_hapbams: [meta, tumor_bam, tumor_bai, normal_bam, normal_bai] | ||
|
|
||
| tumoronly_hapbams | ||
| .mix(paired_hapbams) | ||
| // Attach phased germline VCF (used by SEVERUS for phased SV calling) | ||
| .join(PHASING_HAPLOTYPING.out.phased_germline_vcf) | ||
| .set{severus_input} | ||
|
Comment on lines
907
to
909
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. Missing test coverage for the fix, and Wakhan's input change is untested.
|
||
| // severus_input: [meta, tumor_bam, tumor_bai, normal_bam, normal_bai, phased_germline_vcf, phased_germline_tbi] | ||
| // severus_input: [meta, tumor_hapbam, tumor_bai, normal_hapbam, normal_bai, phased_germline_vcf, phased_germline_tbi] | ||
| // normal_bam/bai are empty lists [] for tumor-only samples | ||
|
|
||
| // | ||
|
|
@@ -1046,55 +1062,14 @@ workflow LRSOMATIC { | |
| savana_allele_counts = channel.empty() | ||
|
|
||
| if (!params.skip_savana) { | ||
| // SAVANA reads the HP (haplotype) tag per read and its README recommends phased BAMs, | ||
| // so build its input from PHASING_HAPLOTYPING's haplotagged BAMs rather than the | ||
| // unphased ones severus_input carries. | ||
| def savana_meta_keys = ['id', 'paired_data', 'platform', 'sex', 'fiber', | ||
| 'clair3_model', 'clairS_model', 'clairSTO_model', 'kinetics'] | ||
|
|
||
| PHASING_HAPLOTYPING.out.tumor_normal_hapbams_ch | ||
| .branch { meta, _bam, _bai -> | ||
| tumor_only: !meta.paired_data | ||
| paired_tumor: meta.paired_data && meta.type == 'tumor' | ||
| paired_normal: meta.paired_data && meta.type == 'normal' | ||
| } | ||
| .set { branched_savana_hapbams } | ||
|
|
||
| branched_savana_hapbams.tumor_only | ||
| .map { meta, bam, bai -> | ||
| def normal_bam = [] | ||
| def normal_bai = [] | ||
| return [meta.subMap(savana_meta_keys), bam, bai, normal_bam, normal_bai] | ||
| } | ||
| .set { savana_tumoronly_hapbams } | ||
|
|
||
| branched_savana_hapbams.paired_tumor | ||
| .map { meta, bam, bai -> return [meta.subMap(savana_meta_keys), bam, bai] } | ||
| .set { savana_paired_tumor_hapbams } | ||
|
|
||
| branched_savana_hapbams.paired_normal | ||
| .map { meta, bam, bai -> return [meta.subMap(savana_meta_keys), bam, bai] } | ||
| .set { savana_paired_normal_hapbams } | ||
|
|
||
| savana_paired_tumor_hapbams | ||
| .join(savana_paired_normal_hapbams) | ||
| .set { savana_paired_hapbams } | ||
| // savana_paired_hapbams: [meta, tumor_bam, tumor_bai, normal_bam, normal_bai] | ||
|
|
||
| savana_tumoronly_hapbams | ||
| .mix(savana_paired_hapbams) | ||
| .join(PHASING_HAPLOTYPING.out.phased_germline_vcf) | ||
| .set { savana_input } | ||
| // savana_input: [meta, tumor_bam, tumor_bai, normal_bam, normal_bai, phased_germline_vcf, phased_germline_tbi] | ||
| // normal_bam/bai are [] for tumor-only samples | ||
|
|
||
| savana_input | ||
| // SAVANA shares severus_input: haplotagged BAMs with the phased germline VCF | ||
| severus_input | ||
| .branch { meta, _tumor_bam, _tumor_bai, normal_bam, _normal_bai, _phased_vcf, _phased_tbi -> | ||
| tumor_only: !normal_bam | ||
| paired: normal_bam | ||
| } | ||
| .set { branched_savana_input } | ||
| // branched_savana_input.tumor_only / .paired: same 7-tuple shape as savana_input | ||
| // branched_savana_input.tumor_only / .paired: same 7-tuple shape as severus_input | ||
|
|
||
| branched_savana_input.tumor_only | ||
| .map { meta, tumor_bam, tumor_bai, _normal_bam, _normal_bai, phased_vcf, phased_tbi -> | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Snapshot is not name-only for Severus. The PR description says "snapshots list Severus outputs by name only, so no snapshot changes expected". That's wrong.
tests/.nftignoreonly ignores Severus'sread_ids.csv,severus.logand the*.vcf.gz/.tbifiles.breakpoints_double.csv,read_qual.txtand{all_SVs,somatic_SVs}/breakpoint_clusters*.tsvare md5-checked intests/default.nf.test.snap(lines 612–634), anddefault.nf.testis taggedsmall.Now that Severus gets HP-tagged reads, the per-haplotype support in
breakpoints_double.csvshould change. One of two things will happen:smallCI test fails until the snapshot is regenerated, orPlease regenerate
tests/default.nf.test.snapand explain the Severus md5 changes in the PR. Also regenerate the extended snapshots (clair_only,consensus,deep_only,union,chm13) that include Severus outputs.