Skip to content

Commit

Permalink
fixup(data-pipeline): sort pext regions on region start in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed Nov 14, 2024
1 parent 08a0636 commit b7a8d67
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions data-pipeline/src/data_pipeline/data_types/pext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b7a8d67

Please sign in to comment.