File tree Expand file tree Collapse file tree 5 files changed +27
-2
lines changed Expand file tree Collapse file tree 5 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 36
36
run : ruff . --output-format github
37
37
- name : Unit Tests
38
38
run : |
39
+ export GRCH37_TO_GRCH38_LIFTOVER_REF_PATH=v03_pipeline/var/test/liftover/grch37_to_grch38.over.chain.gz
40
+ export GRCH38_TO_GRCH37_LIFTOVER_REF_PATH=v03_pipeline/var/test/liftover/grch38_to_grch37.over.chain.gz
39
41
export ACCESS_PRIVATE_REFERENCE_DATASETS=1
40
42
export PYSPARK_SUBMIT_ARGS='--driver-memory 8G pyspark-shell'
41
43
nosetests --with-coverage --cover-package v03_pipeline/lib v03_pipeline/lib
Original file line number Diff line number Diff line change @@ -15,3 +15,12 @@ def add_rg37_liftover(grch37_to_grch38_liftover_ref_path: str) -> None:
15
15
rg38 = hl .get_reference (ReferenceGenome .GRCh38 .value )
16
16
if not rg37 .has_liftover (rg38 ):
17
17
rg37 .add_liftover (grch37_to_grch38_liftover_ref_path , rg38 )
18
+
19
+
20
+ def remove_liftover ():
21
+ rg37 = hl .get_reference (ReferenceGenome .GRCh37 .value )
22
+ rg38 = hl .get_reference (ReferenceGenome .GRCh38 .value )
23
+ if rg37 .has_liftover (rg38 ):
24
+ rg37 .remove_liftover (rg38 )
25
+ if rg38 .has_liftover (rg37 ):
26
+ rg38 .remove_liftover (rg37 )
Original file line number Diff line number Diff line change 1
1
import hail as hl
2
2
import luigi
3
3
4
+ from v03_pipeline .lib .annotations .liftover import remove_liftover
4
5
from v03_pipeline .lib .logger import get_logger
5
6
from v03_pipeline .lib .model import Env
6
7
from v03_pipeline .lib .tasks .base .base_loading_pipeline_params import (
@@ -27,6 +28,13 @@ def init_hail(self):
27
28
# Interval ref data join causes shuffle death, this prevents it
28
29
hl ._set_flags (use_new_shuffle = '1' , no_whole_stage_codegen = '1' ) # noqa: SLF001
29
30
31
+ # Ensure any cached liftover files within Hail are cleared
32
+ # to provide a clean context free of hidden state.
33
+ # This runs "before" a task to account for situations where
34
+ # the Hail write fails and we do not have the chance to
35
+ # run this method in the "after".
36
+ remove_liftover ()
37
+
30
38
31
39
# NB: these are defined over luigi.Task instead of the BaseHailTableTask so that
32
40
# they work on file dependencies.
Original file line number Diff line number Diff line change 44
44
from v03_pipeline .lib .test .mocked_dataroot_testcase import MockedDatarootTestCase
45
45
from v03_pipeline .var .test .vep .mock_vep_data import MOCK_37_VEP_DATA , MOCK_38_VEP_DATA
46
46
47
+ GRCH38_TO_GRCH37_LIFTOVER_REF_PATH = (
48
+ 'v03_pipeline/var/test/liftover/grch38_to_grch37.over.chain.gz'
49
+ )
47
50
TEST_MITO_MT = 'v03_pipeline/var/test/callsets/mito_1.mt'
48
51
TEST_SNV_INDEL_VCF = 'v03_pipeline/var/test/callsets/1kg_30variants.vcf'
49
52
TEST_SV_VCF = 'v03_pipeline/var/test/callsets/sv_1.vcf'
@@ -248,6 +251,7 @@ def test_multiple_update_vat(
248
251
{'ENST00000327044' : 'NM_015658.4' },
249
252
)
250
253
# make register_alleles return CAIDs for 4 of 30 variants
254
+ mock_env .GRCH38_TO_GRCH37_LIFTOVER_REF_PATH = GRCH38_TO_GRCH37_LIFTOVER_REF_PATH
251
255
mock_env .SHOULD_REGISTER_ALLELES = True
252
256
mock_register_alleles .side_effect = [
253
257
iter (
Original file line number Diff line number Diff line change 12
12
from v03_pipeline .lib .misc .callsets import get_callset_ht
13
13
from v03_pipeline .lib .misc .io import remap_pedigree_hash
14
14
from v03_pipeline .lib .misc .math import constrain
15
- from v03_pipeline .lib .model import Env , ReferenceDatasetCollection
15
+ from v03_pipeline .lib .model import (
16
+ Env ,
17
+ ReferenceDatasetCollection ,
18
+ )
16
19
from v03_pipeline .lib .paths import (
17
20
new_variants_table_path ,
18
21
variant_annotations_table_path ,
@@ -214,7 +217,6 @@ def create_table(self) -> hl.Table:
214
217
):
215
218
ar_ht = ar_ht .union (ar_ht_chunk )
216
219
new_variants_ht = new_variants_ht .join (ar_ht , 'left' )
217
-
218
220
return new_variants_ht .select_globals (
219
221
updates = {
220
222
hl .Struct (
You can’t perform that action at this time.
0 commit comments