From b7a8d67390b5506593bc9ac4af9566b814cfd7d6 Mon Sep 17 00:00:00 2001 From: Riley Grant Date: Thu, 14 Nov 2024 08:16:18 -0600 Subject: [PATCH] fixup(data-pipeline): sort pext regions on region start in pipeline --- data-pipeline/src/data_pipeline/data_types/pext.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/data-pipeline/src/data_pipeline/data_types/pext.py b/data-pipeline/src/data_pipeline/data_types/pext.py index e833db780..780c557b9 100644 --- a/data-pipeline/src/data_pipeline/data_types/pext.py +++ b/data-pipeline/src/data_pipeline/data_types/pext.py @@ -189,10 +189,15 @@ def reshape_pext_data_to_tissue_array(pext_struct_path): ds = ds.annotate(flags=hl.empty_array(hl.tstr)) ds = ds.annotate( - regions=ds.regions.map( - lambda region: region.annotate( - tissues=hl.array([hl.struct(tissue=tissue, value=region.tissues[tissue]) for tissue in region.tissues]) - ) + regions=hl.sorted( + ds.regions.map( + lambda region: region.annotate( + tissues=hl.array( + [hl.struct(tissue=tissue, value=region.tissues[tissue]) for tissue in region.tissues] + ) + ) + ), + key=lambda region: region.start, ) ) return ds