1
1
import hail as hl
2
2
import luigi
3
+ import luigi .util
3
4
4
5
from v03_pipeline .lib .logger import get_logger
5
6
from v03_pipeline .lib .misc .family_loading_failures import (
14
15
)
15
16
from v03_pipeline .lib .misc .pedigree import parse_pedigree_ht_to_families
16
17
from v03_pipeline .lib .misc .sample_ids import remap_sample_ids , subset_samples
17
- from v03_pipeline .lib .model import SampleType
18
18
from v03_pipeline .lib .paths import remapped_and_subsetted_callset_path
19
+ from v03_pipeline .lib .tasks .base .base_loading_run_params import BaseLoadingRunParams
19
20
from v03_pipeline .lib .tasks .base .base_write import BaseWriteTask
20
21
from v03_pipeline .lib .tasks .files import GCSorLocalTarget , RawFileTask
21
22
from v03_pipeline .lib .tasks .write_imported_callset import WriteImportedCallsetTask
27
28
logger = get_logger (__name__ )
28
29
29
30
31
+ @luigi .util .inherits (BaseLoadingRunParams )
30
32
class WriteRemappedAndSubsettedCallsetTask (BaseWriteTask ):
31
- sample_type = luigi .EnumParameter (enum = SampleType )
32
- callset_path = luigi .Parameter ()
33
- project_guid = luigi .Parameter ()
34
- project_remap_path = luigi .Parameter ()
35
- project_pedigree_path = luigi .Parameter ()
36
- imputed_sex_path = luigi .Parameter (default = None )
37
- ignore_missing_samples_when_remapping = luigi .BoolParameter (
38
- default = False ,
39
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
40
- )
41
- validate = luigi .BoolParameter (
42
- default = True ,
43
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
44
- )
45
- force = luigi .BoolParameter (
46
- default = False ,
47
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
48
- )
49
- check_sex_and_relatedness = luigi .BoolParameter (
50
- default = False ,
51
- parsing = luigi .BoolParameter .EXPLICIT_PARSING ,
52
- )
53
-
54
33
def complete (self ) -> luigi .Target :
55
34
return not self .force and super ().complete ()
56
35
@@ -66,20 +45,7 @@ def output(self) -> luigi.Target:
66
45
67
46
def requires (self ) -> list [luigi .Task ]:
68
47
requirements = [
69
- WriteImportedCallsetTask (
70
- reference_genome = self .reference_genome ,
71
- dataset_type = self .dataset_type ,
72
- sample_type = self .sample_type ,
73
- callset_path = self .callset_path ,
74
- imputed_sex_path = self .imputed_sex_path ,
75
- # NB: filters_path is explicitly passed as None here
76
- # to avoid carrying it throughout the rest of the pipeline.
77
- # Only the primary import task itself should be aware of it.
78
- filters_path = None ,
79
- validate = self .validate ,
80
- force = False ,
81
- check_sex_and_relatedness = self .check_sex_and_relatedness ,
82
- ),
48
+ self .clone (WriteImportedCallsetTask , force = False ),
83
49
RawFileTask (self .project_pedigree_path ),
84
50
]
85
51
if (
@@ -88,18 +54,8 @@ def requires(self) -> list[luigi.Task]:
88
54
):
89
55
requirements = [
90
56
* requirements ,
91
- WriteRelatednessCheckTableTask (
92
- self .reference_genome ,
93
- self .dataset_type ,
94
- self .sample_type ,
95
- self .callset_path ,
96
- ),
97
- WriteSexCheckTableTask (
98
- self .reference_genome ,
99
- self .dataset_type ,
100
- self .callset_path ,
101
- self .imputed_sex_path ,
102
- ),
57
+ self .clone (WriteRelatednessCheckTableTask ),
58
+ self .close (WriteSexCheckTableTask ),
103
59
]
104
60
return requirements
105
61
0 commit comments