Skip to content

Commit 3d317cf

Browse files
committed
format
1 parent 6e2d31e commit 3d317cf

File tree

3 files changed

+16
-83
lines changed

3 files changed

+16
-83
lines changed

v03_pipeline/lib/tasks/update_lookup_table.py

Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import hail as hl
22
import luigi
3+
import luigi.util
34

45
from v03_pipeline.lib.misc.callsets import callset_project_pairs
56
from v03_pipeline.lib.misc.lookup import (
67
compute_callset_lookup_ht,
78
join_lookup_hts,
89
remove_family_guids,
910
)
10-
from v03_pipeline.lib.model import SampleType
1111
from v03_pipeline.lib.model.constants import PROJECTS_EXCLUDED_FROM_LOOKUP
12+
from v03_pipeline.lib.tasks.base.base_loading_run_params import BaseLoadingRunParams
1213
from v03_pipeline.lib.tasks.base.base_update_lookup_table import (
1314
BaseUpdateLookupTableTask,
1415
)
@@ -17,25 +18,11 @@
1718
)
1819

1920

21+
@luigi.util.inherits(BaseLoadingRunParams)
2022
class UpdateLookupTableTask(BaseUpdateLookupTableTask):
21-
sample_type = luigi.EnumParameter(enum=SampleType)
22-
callset_paths = luigi.ListParameter()
2323
project_guids = luigi.ListParameter()
2424
project_remap_paths = luigi.ListParameter()
2525
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-
)
3926

4027
def complete(self) -> bool:
4128
return (
@@ -47,23 +34,11 @@ def complete(self) -> bool:
4734
[
4835
updates.contains(
4936
hl.Struct(
50-
callset=callset_path,
37+
callset=self.callset_path,
5138
project_guid=project_guid,
5239
),
5340
)
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
6742
],
6843
),
6944
hl.read_table(self.output().path).updates,
@@ -73,31 +48,21 @@ def complete(self) -> bool:
7348

7449
def requires(self) -> list[luigi.Task]:
7550
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,
8856
)
8957
for (
90-
callset_path,
9158
project_guid,
9259
project_remap_path,
9360
project_pedigree_path,
94-
imputed_sex_path,
95-
) in callset_project_pairs(
96-
self.callset_paths,
61+
) in zip(
9762
self.project_guids,
9863
self.project_remap_paths,
9964
self.project_pedigree_paths,
100-
self.imputed_sex_paths,
65+
strict=False,
10166
)
10267
]
10368

v03_pipeline/lib/tasks/update_lookup_table_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_skip_update_lookup_table_task(self) -> None:
1919
reference_genome=ReferenceGenome.GRCh38,
2020
dataset_type=DatasetType.SNV_INDEL,
2121
sample_type=SampleType.WGS,
22-
callset_paths=[TEST_VCF],
22+
callset_path=TEST_VCF,
2323
project_guids=[
2424
'R0555_seqr_demo',
2525
], # a project excluded from the lookup table
@@ -52,7 +52,7 @@ def test_update_lookup_table_task(self) -> None:
5252
reference_genome=ReferenceGenome.GRCh38,
5353
dataset_type=DatasetType.SNV_INDEL,
5454
sample_type=SampleType.WGS,
55-
callset_paths=[TEST_VCF],
55+
callset_path=TEST_VCF,
5656
project_guids=['R0113_test_project'],
5757
project_remap_paths=[TEST_REMAP],
5858
project_pedigree_paths=[TEST_PEDIGREE_3],

v03_pipeline/lib/tasks/update_project_table.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,19 @@
88
join_family_entries_hts,
99
remove_family_guids,
1010
)
11-
from v03_pipeline.lib.model import SampleType
11+
from v03_pipeline.lib.tasks.base.base_loading_run_params import BaseLoadingRunParams
1212
from v03_pipeline.lib.tasks.base.base_update_project_table import (
1313
BaseUpdateProjectTableTask,
1414
)
1515
from v03_pipeline.lib.tasks.write_remapped_and_subsetted_callset import (
1616
WriteRemappedAndSubsettedCallsetTask,
1717
)
18-
from v03_pipeline.lib.tasks.base.base_loading_run_params import BaseLoadingRunParams
1918

2019

2120
@luigi.util.inherits(BaseLoadingRunParams)
2221
class UpdateProjectTableTask(BaseUpdateProjectTableTask):
23-
sample_type = luigi.EnumParameter(enum=SampleType)
24-
callset_path = luigi.Parameter()
2522
project_remap_path = luigi.Parameter()
2623
project_pedigree_path = luigi.Parameter()
27-
imputed_sex_path = luigi.Parameter(default=None)
28-
ignore_missing_samples_when_remapping = luigi.BoolParameter(
29-
default=False,
30-
parsing=luigi.BoolParameter.EXPLICIT_PARSING,
31-
)
32-
validate = luigi.BoolParameter(
33-
default=True,
34-
parsing=luigi.BoolParameter.EXPLICIT_PARSING,
35-
)
36-
force = luigi.BoolParameter(
37-
default=False,
38-
parsing=luigi.BoolParameter.EXPLICIT_PARSING,
39-
)
40-
is_new_gcnv_joint_call = luigi.BoolParameter(
41-
default=False,
42-
description='Is this a fully joint-called callset.',
43-
)
4424

4525
def complete(self) -> bool:
4626
return (
@@ -54,19 +34,7 @@ def complete(self) -> bool:
5434
)
5535

5636
def requires(self) -> luigi.Task:
57-
return WriteRemappedAndSubsettedCallsetTask(
58-
self.reference_genome,
59-
self.dataset_type,
60-
self.sample_type,
61-
self.callset_path,
62-
self.project_guid,
63-
self.project_remap_path,
64-
self.project_pedigree_path,
65-
self.imputed_sex_path,
66-
self.ignore_missing_samples_when_remapping,
67-
self.validate,
68-
False,
69-
)
37+
return self.clone(WriteRemappedAndSubsettedCallsetTask, force=False)
7038

7139
def update_table(self, ht: hl.Table) -> hl.Table:
7240
callset_mt = hl.read_matrix_table(self.input().path)

0 commit comments

Comments
 (0)