Skip to content

Commit 35f001f

Browse files
authored
Merge pull request #736 from broadinstitute/benb/sample_lookup_table_touchups
Lookup table touchups
2 parents b37401d + 6850c1a commit 35f001f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

v03_pipeline/lib/annotations/snv_indel_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_allele_count_annotations(self) -> None:
3333
het_samples=2,
3434
hom_samples=2,
3535
),
36+
None,
3637
],
3738
[],
3839
],
@@ -46,6 +47,7 @@ def test_allele_count_annotations(self) -> None:
4647
het_samples=0,
4748
hom_samples=0,
4849
),
50+
None,
4951
],
5052
[],
5153
],

v03_pipeline/lib/misc/lookup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@ def compute_callset_lookup_ht(
3838
],
3939
),
4040
).rows()
41-
return globalize_ids(ht, project_guid)
41+
ht = globalize_ids(ht, project_guid)
42+
return ht.annotate(
43+
project_stats=[
44+
# Set a family to missing if all values are 0
45+
ht.project_stats[0].map(
46+
lambda ps: hl.or_missing(
47+
hl.sum(list(ps.values())) > 0,
48+
ps,
49+
),
50+
),
51+
],
52+
)
4253

4354

4455
def globalize_ids(ht: hl.Table, project_guid: str) -> hl.Table:

0 commit comments

Comments
 (0)