Skip to content

Commit 79a8920

Browse files
authored
Ensure gnomad sv missing migration (#1085)
1 parent ad08766 commit 79a8920

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import hail as hl
2+
3+
from v03_pipeline.lib.migration.base_migration import BaseMigration
4+
from v03_pipeline.lib.model import DatasetType, ReferenceGenome
5+
6+
7+
class EnsureGnomadSVMissing(BaseMigration):
8+
reference_genome_dataset_types: frozenset[tuple[ReferenceGenome, DatasetType]] = (
9+
frozenset(
10+
((ReferenceGenome.GRCh38, DatasetType.SV),),
11+
)
12+
)
13+
14+
@staticmethod
15+
def migrate(ht: hl.Table, **_) -> hl.Table:
16+
return ht.annotate(
17+
gnomad_svs=hl.or_missing(
18+
hl.any([hl.is_defined(x) for x in ht.gnomad_svs.values()]),
19+
ht.gnomad_svs,
20+
),
21+
)

0 commit comments

Comments
 (0)