Skip to content

Commit 49da02e

Browse files
committed
conditionalize
1 parent 794fafe commit 49da02e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

v03_pipeline/lib/reference_data/clinvar.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ def download_and_import_latest_clinvar_vcf(
126126
Env.HAIL_TMP_DIR,
127127
os.path.basename(tmp_file.name),
128128
)
129-
hfs.copy(tmp_file.name, cached_tmp_file_name)
129+
# In cases where HAIL_TMP_DIR is a remote path, copy the
130+
# file there. If it's local, do nothing.
131+
if tmp_file.name != cached_tmp_file_name:
132+
hfs.copy(tmp_file.name, cached_tmp_file_name)
130133
mt = hl.import_vcf(
131134
cached_tmp_file_name,
132135
reference_genome=reference_genome.value,
@@ -189,7 +192,10 @@ def download_and_import_clinvar_submission_summary() -> hl.Table:
189192
Env.HAIL_TMP_DIR,
190193
os.path.basename(unzipped_tmp_file.name),
191194
)
192-
hfs.copy(unzipped_tmp_file.name, cached_tmp_file_name)
195+
# In cases where HAIL_TMP_DIR is a remote path, copy the
196+
# file there. If it's local, do nothing.
197+
if unzipped_tmp_file.name != cached_tmp_file_name:
198+
hfs.copy(unzipped_tmp_file.name, cached_tmp_file_name)
193199
return import_submission_table(cached_tmp_file_name)
194200

195201

0 commit comments

Comments
 (0)