Skip to content

Commit

Permalink
Fix compound key in hail (#1127)
Browse files Browse the repository at this point in the history
* Correction to previous PR

* Bump version: 1.35.3 → 1.35.4
  • Loading branch information
MattWellie authored Jan 31, 2025
1 parent 9d69a59 commit 94808cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.35.3
current_version = 1.35.4
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read

env:
VERSION: 1.35.3
VERSION: 1.35.4

jobs:
docker:
Expand Down
11 changes: 4 additions & 7 deletions cpg_workflows/scripts/vep_json_to_ht.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,11 @@ def vep_json_to_ht(vep_result_paths: list[str], out_path: str):

ht = hl.import_table(paths=vep_result_paths, no_header=True, types={'f0': json_schema})
ht = ht.transmute(vep=ht.f0)
# Can't use ht.vep.start for start because it can be modified by VEP (e.g. it
# happens for indels). So instead parsing POS from the original VCF line stored
# as ht.vep.input field.
original_vcf_line = ht.vep.input
start = hl.parse_int(original_vcf_line.split('\t')[1])
chrom = ht.vep.seq_region_name
ht = ht.annotate(locus=hl.locus(chrom, start))
# we're using split multiallelics, so we need to compound key on chr/pos/ref/alt
ht = ht.annotate(
locus=hl.locus(ht.vep.seq_region_name, hl.parse_int(ht.vep.input.split('\t')[1])),
alleles=ht.vep.allele_string.split('/'),
)
ht = ht.key_by(ht.locus, ht.alleles)
ht.write(out_path, overwrite=True)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name='cpg_workflows',
# This tag is automatically updated by bumpversion
version='1.35.3',
version='1.35.4',
description='CPG workflows for Hail Batch',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 94808cc

Please sign in to comment.