1
1
import hail as hl
2
2
import luigi
3
+ import luigi .util
3
4
4
5
from v03_pipeline .lib .misc .callsets import callset_project_pairs
5
6
from v03_pipeline .lib .misc .lookup import (
6
7
compute_callset_lookup_ht ,
7
8
join_lookup_hts ,
8
9
remove_family_guids ,
9
10
)
10
- from v03_pipeline .lib .model import SampleType
11
11
from v03_pipeline .lib .model .constants import PROJECTS_EXCLUDED_FROM_LOOKUP
12
+ from v03_pipeline .lib .tasks .base .base_loading_run_params import BaseLoadingRunParams
12
13
from v03_pipeline .lib .tasks .base .base_update_lookup_table import (
13
14
BaseUpdateLookupTableTask ,
14
15
)
17
18
)
18
19
19
20
21
+ @luigi .util .inherits (BaseLoadingRunParams )
20
22
class UpdateLookupTableTask (BaseUpdateLookupTableTask ):
21
- sample_type = luigi .EnumParameter (enum = SampleType )
22
- callset_paths = luigi .ListParameter ()
23
23
project_guids = luigi .ListParameter ()
24
24
project_remap_paths = luigi .ListParameter ()
25
25
project_pedigree_paths = luigi .ListParameter ()
26
- imputed_sex_paths = luigi .ListParameter (default = None )
27
- ignore_missing_samples_when_remapping = luigi .BoolParameter (
28
- default = False ,
29
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
30
- )
31
- validate = luigi .BoolParameter (
32
- default = True ,
33
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
34
- )
35
- force = luigi .BoolParameter (
36
- default = False ,
37
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
38
- )
39
26
40
27
def complete (self ) -> bool :
41
28
return (
@@ -47,23 +34,11 @@ def complete(self) -> bool:
47
34
[
48
35
updates .contains (
49
36
hl .Struct (
50
- callset = callset_path ,
37
+ callset = self . callset_path ,
51
38
project_guid = project_guid ,
52
39
),
53
40
)
54
- for (
55
- callset_path ,
56
- project_guid ,
57
- _ ,
58
- _ ,
59
- _ ,
60
- ) in callset_project_pairs (
61
- self .callset_paths ,
62
- self .project_guids ,
63
- self .project_remap_paths ,
64
- self .project_pedigree_paths ,
65
- self .imputed_sex_paths ,
66
- )
41
+ for project_guid in self .project_guids
67
42
],
68
43
),
69
44
hl .read_table (self .output ().path ).updates ,
@@ -73,31 +48,21 @@ def complete(self) -> bool:
73
48
74
49
def requires (self ) -> list [luigi .Task ]:
75
50
return [
76
- WriteRemappedAndSubsettedCallsetTask (
77
- self .reference_genome ,
78
- self .dataset_type ,
79
- self .sample_type ,
80
- callset_path ,
81
- project_guid ,
82
- project_remap_path ,
83
- project_pedigree_path ,
84
- imputed_sex_path ,
85
- self .ignore_missing_samples_when_remapping ,
86
- self .validate ,
87
- False ,
51
+ self .clone (
52
+ WriteRemappedAndSubsettedCallsetTask ,
53
+ project_guid = project_guid ,
54
+ project_remap_path = project_remap_path ,
55
+ project_pedigree_path = project_pedigree_path ,
88
56
)
89
57
for (
90
- callset_path ,
91
58
project_guid ,
92
59
project_remap_path ,
93
60
project_pedigree_path ,
94
- imputed_sex_path ,
95
- ) in callset_project_pairs (
96
- self .callset_paths ,
61
+ ) in zip (
97
62
self .project_guids ,
98
63
self .project_remap_paths ,
99
64
self .project_pedigree_paths ,
100
- self . imputed_sex_paths ,
65
+ strict = False ,
101
66
)
102
67
]
103
68
0 commit comments