Skip to content

Commit

Permalink
Merge pull request #612 from broadinstitute/dm/gks_bugfix
Browse files Browse the repository at this point in the history
GKS Seqloc `new_temp_file` Bugfix
  • Loading branch information
matren395 authored Sep 29, 2023
2 parents f8e4313 + 76adffa commit 730b636
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gnomad/utils/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1932,8 +1932,8 @@ def _update_struct(

def gks_compute_seqloc_digest(
ht: hl.Table,
export_tmpfile: str = new_temp_file("gks-seqloc-pre.tsv"),
computed_tmpfile: str = new_temp_file("gks-seqloc-post.tsv"),
export_tmpfile: Optional[str] = None,
computed_tmpfile: Optional[str] = None,
):
"""
Compute sequence location digest-based id for a hail variant Table.
Expand All @@ -1943,11 +1943,16 @@ def gks_compute_seqloc_digest(
one added by add_gks_vrs, that can be used to construct ga4gh.vrs models.
:param ht: hail table with VRS annotation
:param export_tmpfile: file path to export the table to.
:param computed_tmpfile: file path to write the updated rows to,
:param export_tmpfile: Optional file path to export the table to.
:param computed_tmpfile: Optional file path to write the updated rows to,
which is then imported as a hail table
:return: a hail table with the VRS annotation updated with the new SequenceLocations
"""
if export_tmpfile is None:
export_tmpfile = new_temp_file("gks-seqloc-pre.tsv")
if computed_tmpfile is None:
computed_tmpfile = new_temp_file("gks-seqloc-post.tsv")

logger.info("Exporting ht to %s", export_tmpfile)
ht.select("vrs_json").export(export_tmpfile, header=True)

Expand Down

0 comments on commit 730b636

Please sign in to comment.