-
Notifications
You must be signed in to change notification settings - Fork 591
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
Vs 1416 modify ingest to correctly handle ploidy differences in dragen 3 7 8 samples #8994
Open
koncheto-broad
wants to merge
15
commits into
ah_var_store
Choose a base branch
from
VS-1416-modify-ingest-to-correctly-handle-ploidy-differences-in-dragen-3-7-8-samples
base: ah_var_store
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0ed9e22
Pushing naive implementation to test for correctness
koncheto-broad 9fb61c3
stupid dockstore error
koncheto-broad 34ce046
Updates to track down weird bugs
koncheto-broad 44f8c89
Updating fix to only scan reference blocks in RefCreator
koncheto-broad 7a41da6
Finally verified the successful ploidy run based on this code
koncheto-broad e442dd6
Merge branch 'ah_var_store' into VS-1416-modify-ingest-to-correctly-h…
koncheto-broad 3d724f7
updating gatk version
koncheto-broad d697019
cleaning things up a bit
koncheto-broad bd0a99c
cleaning things up a bit v2
koncheto-broad c685c88
PR feedback
koncheto-broad c875267
Merge branch 'ah_var_store' into VS-1416-modify-ingest-to-correctly-h…
koncheto-broad 9366d91
Updating the docker image
koncheto-broad fef7938
dockstore
koncheto-broad f8450df
dockstore
koncheto-broad 187c194
updating the CORRECT image this time
koncheto-broad 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 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 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 | ||||
---|---|---|---|---|---|---|
|
@@ -28,6 +28,7 @@ workflow GvsAssignIds { | |||||
String vcf_header_lines_schema_json = '[{"name":"vcf_header_lines_hash","type":"STRING","mode":"REQUIRED"}, {"name":"vcf_header_lines","type":"STRING","mode":"REQUIRED"},{"name":"is_expected_unique","type":"BOOLEAN","mode":"REQUIRED"}]' | ||||||
String sample_vcf_header_schema_json = '[{"name": "sample_id","type": "INTEGER","mode": "REQUIRED"}, {"name":"vcf_header_lines_hash","type":"STRING","mode":"REQUIRED"}]' | ||||||
String sample_load_status_schema_json = '[{"name": "sample_id","type": "INTEGER","mode": "REQUIRED"},{"name":"status","type":"STRING","mode":"REQUIRED"}, {"name":"event_timestamp","type":"TIMESTAMP","mode":"REQUIRED"}]' | ||||||
String sample_chromosome_ploidy_schema_json = '[{"name": "sample_id","type": "INTEGER","mode": "REQUIRED"},{"name": "chromosome","type": "INTEGER","mode": "REQUIRED"},{"name": "ploidy","type": "INTEGER","mode": "REQUIRED"}]' | ||||||
|
||||||
if (!defined(git_hash) || !defined(cloud_sdk_docker)) { | ||||||
call Utils.GetToolVersions { | ||||||
|
@@ -71,6 +72,20 @@ workflow GvsAssignIds { | |||||
cloud_sdk_docker = effective_cloud_sdk_docker, | ||||||
} | ||||||
|
||||||
call GvsCreateTables.CreateTables as CreateSamplePloidyMapTable { | ||||||
input: | ||||||
project_id = project_id, | ||||||
dataset_name = dataset_name, | ||||||
go = ValidateSamples.done, | ||||||
datatype = "sample_chromosome_ploidy", | ||||||
schema_json = sample_chromosome_ploidy_schema_json, | ||||||
max_table_id = 1, | ||||||
superpartitioned = "false", | ||||||
partitioned = "false", | ||||||
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.
Suggested change
|
||||||
clustering_field = "sample_id", | ||||||
cloud_sdk_docker = effective_cloud_sdk_docker, | ||||||
} | ||||||
|
||||||
if (load_vcf_headers) { | ||||||
call GvsCreateTables.CreateTables as CreateScratchVCFHeaderLinesTable { | ||||||
input: | ||||||
|
This file contains 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 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
59 changes: 59 additions & 0 deletions
59
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/PloidyUtils.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.broadinstitute.hellbender.tools.gvs.common; | ||
|
||
import htsjdk.samtools.util.CollectionUtil; | ||
import htsjdk.samtools.util.Interval; | ||
import htsjdk.samtools.util.Lazy; | ||
import htsjdk.variant.variantcontext.VariantContext; | ||
|
||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Holds static methods for determining whether a particular location falls within a PAR, for the purposes of accurately determining the correct ploidy | ||
* <p> | ||
* Some methods, due to their implementation, make implicit hg38 assumptions. If we choose to support other references, we'll need to update this class. | ||
*/ | ||
public class PloidyUtils { | ||
/** | ||
* This copies the PAR definition used in the tool FindMendelianViolations with the addition of the Y regions | ||
* @see picard.vcf.MendelianViolations.FindMendelianViolations | ||
* https://github.com/broadinstitute/picard/blob/63138fc8b7ae33eb0490a8ef707b61befa2f51d4/src/main/java/picard/vcf/MendelianViolations/FindMendelianViolations.java#L203 | ||
* Wikipedia data: https://en.wikipedia.org/wiki/Pseudoautosomal_region | ||
*/ | ||
private static final Set<String> PSEUDO_AUTOSOMAL_REGIONS_DEFINITION = CollectionUtil.makeSet("X:60001-2699520", "X:154931044-155260560", "chrX:10001-2781479", "chrX:155701383-156030895", "Y:10001-2649520", "Y:59034050-59363566", "chrY:10001-2781479", "chrY:56887903-57217415"); | ||
|
||
public static Lazy<Set<Interval>> ParIntervals = new Lazy<>(() -> Collections.unmodifiableSet(parseIntervalLists(PSEUDO_AUTOSOMAL_REGIONS_DEFINITION))); | ||
|
||
public static boolean doesVariantOverlapPAR(VariantContext variant) { | ||
return doesIntervalOverlapPAR(variant.getContig(), variant.getStart(), variant.getEnd()); | ||
} | ||
|
||
public static boolean isLocationInPAR(long location) { | ||
// Note: SchemaUtils.decodeContig makes implicit hg38 assumptions. If we support different references, we'll | ||
// need to factor that into how we do our mapping from pure location numbers to contigs and positions | ||
koncheto-broad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return doesIntervalOverlapPAR(SchemaUtils.decodeContig(location), SchemaUtils.decodePosition(location), SchemaUtils.decodePosition(location) + 1); | ||
} | ||
|
||
public static boolean doesIntervalOverlapPAR(String chrom, int positionStart, int positionEnd) { | ||
Interval locationAsInterval = new Interval(chrom, positionStart, positionEnd); | ||
for (Interval par : ParIntervals.get()) { | ||
if (par.intersects(locationAsInterval)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
private static Set<Interval> parseIntervalLists(final Set<String> intervalLists){ | ||
// Parse the PARs | ||
final Set<Interval> intervals = new HashSet<>(intervalLists.size()); | ||
for (final String par : intervalLists) { | ||
final String[] splits1 = par.split(":"); | ||
final String[] splits2 = splits1[1].split("-"); | ||
intervals.add(new Interval(splits1[0], Integer.parseInt(splits2[0]), Integer.parseInt(splits2[1]))); | ||
} | ||
return intervals; | ||
} | ||
|
||
} |
This file contains 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 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 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 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
Oops, something went wrong.
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.