Skip to content

Commit 6824ed0

Browse files
committed
prefer env vars for vep path
1 parent a3f9cdd commit 6824ed0

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

v03_pipeline/lib/tasks/update_variant_annotations_table_with_new_samples.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class UpdateVariantAnnotationsTableWithNewSamplesTask(BaseVariantAnnotationsTabl
5252
default='gs://hail-common/references/grch38_to_grch37.over.chain.gz',
5353
description='Path to GRCh38 to GRCh37 coordinates file',
5454
)
55-
vep_config_json_path = luigi.OptionalParameter(
56-
default=None,
57-
description='Path of hail vep config .json file',
58-
)
5955

6056
@property
6157
def other_annotation_dependencies(self) -> dict[str, hl.Table]:
@@ -216,7 +212,6 @@ def update_table(self, ht: hl.Table) -> hl.Table:
216212
new_variants_ht,
217213
self.dataset_type,
218214
self.reference_genome,
219-
self.vep_config_json_path,
220215
)
221216

222217
# 2) Select down to the formatting annotations fields and

v03_pipeline/lib/vep.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import os
2+
13
import hail as hl
24

35
from v03_pipeline.lib.model import DatasetType, ReferenceGenome
46

57

6-
def validate_vep_config_reference_genome(reference_genome, config: str) -> None:
7-
with open(config) as f:
8+
def validate_vep_config_reference_genome(reference_genome) -> None:
9+
with open(os.environ['VEP_CONFIG_PATH']) as f:
810
if reference_genome.value not in f.read():
911
msg = f'Vep config does not match supplied reference genome {reference_genome.value}'
1012
raise ValueError(msg)
@@ -14,19 +16,13 @@ def run_vep(
1416
ht: hl.Table,
1517
dataset_type: DatasetType,
1618
reference_genome: ReferenceGenome,
17-
vep_config_json_path: str | None,
1819
) -> hl.Table:
1920
if not dataset_type.veppable:
2021
return ht
21-
config = (
22-
vep_config_json_path
23-
if vep_config_json_path is not None
24-
else f'file:///vep_data/vep-{reference_genome.value}-gcloud.json'
25-
)
26-
validate_vep_config_reference_genome(reference_genome, config)
22+
validate_vep_config_reference_genome(reference_genome)
2723
return hl.vep(
2824
ht,
29-
config=config,
25+
config=os.environ['VEP_CONFIG_URI'],
3026
name='vep',
3127
block_size=1000,
3228
tolerate_parse_error=True,

0 commit comments

Comments
 (0)