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

GKS Seqloc new_temp_file Bugfix #612

Merged
merged 1 commit into from
Sep 29, 2023
Merged
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
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