Skip to content

[main] Add xeniumranger element to segger export - #89

Open
Tobiaspk wants to merge 3 commits into
mainfrom
feat/export-xeniumranger
Open

Tobiaspk wants to merge 3 commits into
mainfrom
feat/export-xeniumranger

Conversation

@Tobiaspk

@Tobiaspk Tobiaspk commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Adds a xeniumranger element to segger export:

  • Requires -i/--source-path (just for suggesting the path though
  • xenium_transcript_assignment.csv: the transcript-assignment CSV xeniumranger import-segmentation expects, with headers transcript_id,cell,is_noise. cell_id is reassigned to segger's calls; unassigned transcripts are dropped.
  • xenium_cell_boundaries.geojson: the same boundary computation as segger export boundaries, written as GeoJSON instead of parquet.
  • Prints the exact xeniumranger import-segmentation command to run against these two files.

Example

segger export xeniumranger \
   -s "$PATH_OUTPUT/segger_segmentation.parquet" \
   -i "$PATH_INPUT/xenium_bundle" \
   -o "$PATH_OUTPUT/xenium_export"

Closes #88

Writes a transcript-assignment CSV with the headers xeniumranger expects
(transcript_id/cell_id/overlaps_nucleus/feature_name/x_location/y_location/
z_location/qv), joining transcript_id/qv/overlaps_nucleus back from the raw
Xenium transcripts via -i since segger's own output drops them. Cell
boundaries are written as GeoJSON instead of parquet. Prints the exact
xeniumranger import-segmentation command to run afterward.

Fixes #88
Fix .not() -> .not_() (not is a reserved keyword, invalid as an attribute name).
assigned drops the filtered column, so building is_noise off it crashed with
ColumnNotFoundError. tx already carries filtered, and already went through
load_transcripts' legacy join if the segmentation predates it, so reuse that
instead of joining again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Export compatible with xeniumranger import-segmentation

1 participant