Skip to content

Commit f13df93

Browse files
authored
additional semi join (#947)
1 parent a515c2c commit f13df93

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

v03_pipeline/lib/tasks/update_variant_annotations_table_with_new_samples.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ def update_table(self, ht: hl.Table) -> hl.Table:
7474
# and either present or not present in the existing annotations table.
7575
callset_variants_ht = ht.semi_join(callset_ht)
7676
ht = ht.anti_join(callset_ht)
77+
lookup_ht = hl.read_table(
78+
lookup_table_path(
79+
self.reference_genome,
80+
self.dataset_type,
81+
),
82+
)
7783
callset_variants_ht = callset_variants_ht.annotate(
7884
**get_fields(
7985
callset_variants_ht,
@@ -89,6 +95,11 @@ def update_table(self, ht: hl.Table) -> hl.Table:
8995
)
9096
ht = ht.union(callset_variants_ht, unify=True)
9197

98+
# Variants may have fallen out of the callset and
99+
# have been removed from the lookup table during modification.
100+
# Ensure we don't proceed with those variants.
101+
ht = ht.semi_join(lookup_ht)
102+
92103
# Fix up the globals and mark the table as updated with these callset/project pairs.
93104
ht = self.annotate_globals(ht)
94105
return ht.annotate_globals(

0 commit comments

Comments
 (0)