Skip to content

use_new_shuffle=None #818

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 3 commits into from
Jun 24, 2024
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
15 changes: 3 additions & 12 deletions v03_pipeline/lib/reference_data/clinvar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import gzip
import os
import shutil
import subprocess
import tempfile
import urllib
Expand Down Expand Up @@ -166,7 +165,6 @@ def join_to_submission_summary_ht(vcf_ht: hl.Table) -> hl.Table:
Submitters=hl.agg.collect(ht.Submitter),
Conditions=hl.agg.collect(ht.ReportedPhenotypeInfo),
)
ht = ht.key_by('VariationID')
return vcf_ht.annotate(
submitters=ht[vcf_ht.rsid].Submitters,
conditions=ht[vcf_ht.rsid].Conditions,
Expand All @@ -177,20 +175,13 @@ def download_and_import_clinvar_submission_summary() -> hl.Table:
with tempfile.NamedTemporaryFile(
suffix='.txt.gz',
delete=False,
) as tmp_file, tempfile.NamedTemporaryFile(
suffix='.txt',
delete=False,
) as unzipped_tmp_file:
) as tmp_file:
urllib.request.urlretrieve(CLINVAR_SUBMISSION_SUMMARY_URL, tmp_file.name) # noqa: S310
# Unzip the gzipped file first to fix gzip files being read by hail with single partition
with gzip.open(tmp_file.name, 'rb') as f_in, open(unzipped_tmp_file.name, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)

gcs_tmp_file_name = os.path.join(
Env.HAIL_TMPDIR,
os.path.basename(unzipped_tmp_file.name),
os.path.basename(tmp_file.name),
)
safely_move_to_gcs(unzipped_tmp_file.name, gcs_tmp_file_name)
safely_move_to_gcs(tmp_file.name, gcs_tmp_file_name)
return hl.import_table(
gcs_tmp_file_name,
force=True,
Expand Down
4 changes: 4 additions & 0 deletions v03_pipeline/lib/reference_data/dataset_table_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ def update_or_create_joined_ht(
continue

# Join the new one!
hl._set_flags(use_new_shuffle=None, no_whole_stage_codegen='1') # noqa: SLF001
dataset_ht = get_dataset_ht(dataset, reference_genome)
dataset_ht, _ = checkpoint(dataset_ht)
hl._set_flags(use_new_shuffle='1', no_whole_stage_codegen='1') # noqa: SLF001
joined_ht = joined_ht.join(dataset_ht, 'outer')
joined_ht = annotate_dataset_globals(joined_ht, dataset, dataset_ht)

Expand Down Expand Up @@ -214,8 +216,10 @@ def join_hts(
),
)
for dataset in reference_dataset_collection.datasets(dataset_type):
hl._set_flags(use_new_shuffle=None, no_whole_stage_codegen='1') # noqa: SLF001
dataset_ht = get_dataset_ht(dataset, reference_genome)
dataset_ht, _ = checkpoint(dataset_ht)
hl._set_flags(use_new_shuffle='1', no_whole_stage_codegen='1') # noqa: SLF001
joined_ht = joined_ht.join(dataset_ht, 'outer')
joined_ht = annotate_dataset_globals(joined_ht, dataset, dataset_ht)
return joined_ht
Loading