Skip to content
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

Don't put withdrawn sample data in alt_allele table [VS-369] #7762

Merged
merged 8 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/variantstore/wdl/GvsCreateAltAllele.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ task PopulateAltAlleleTable {
$SERVICE_ACCOUNT_STANZA
>>>
runtime {
docker: "us.gcr.io/broad-dsde-methods/variantstore:ah_var_store_20220211"
docker: "us.gcr.io/broad-dsde-methods/variantstore:rsa_alt_allele_withdrawn_2022_04_07"
memory: "3 GB"
disks: "local-disk 10 HDD"
cpu: 1
Expand Down
5 changes: 3 additions & 2 deletions scripts/variantstore/wdl/extract/populate_alt_allele_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def populate_alt_allele_table(query_project, vet_table_name, fq_dataset, sa_key_
alt_allele_temp_function = Path('alt_allele_temp_function.sql').read_text()
alt_allele_positions = Path('alt_allele_positions.sql').read_text()
fq_vet_table = f"{fq_dataset}.{vet_table_name}"
fq_sample_info = f"{fq_dataset}.sample_info"
query_with = f"""INSERT INTO `{fq_dataset}.alt_allele`
WITH
position1 as (select * from `{fq_vet_table}` WHERE call_GT IN ('0/1', '1/0', '1/1', '0|1', '1|0', '1|1', '0/2', '0|2','2/0', '2|0')),
position2 as (select * from `{fq_vet_table}` WHERE call_GT IN ('1/2', '1|2', '2/1', '2|1'))"""
position1 as (select * from `{fq_vet_table}` WHERE call_GT IN ('0/1', '1/0', '1/1', '0|1', '1|0', '1|1', '0/2', '0|2','2/0', '2|0') AND sample_id NOT IN (SELECT sample_id from {fq_sample_info} WHERE withdrawn IS NOT NULL)),
position2 as (select * from `{fq_vet_table}` WHERE call_GT IN ('1/2', '1|2', '2/1', '2|1') AND sample_id NOT IN (SELECT sample_id from {fq_sample_info} WHERE withdrawn IS NOT NULL))"""

sql = alt_allele_temp_function + query_with + alt_allele_positions
result = utils.execute_with_retry(client, f"into alt allele from {vet_table_name}", sql)
Expand Down