Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nimbusimage-xenium-ingest

БесплатноБез исполняемых скриптовНе проверен

Load a 10x Xenium spatial-transcriptomics bundle into NimbusImage: the morphology and H&E images, cell segmentation polygons, a gene-expression marker panel…

arjunrajlaboratoryот arjunrajlaboratory★ 22 звезды на GitHub

Об этом скилле

NimbusImage — Xenium ingest

End-to-end runbook for getting a 10x Xenium output bundle (XOA 1.3–4, including Prime 5K and the XOA 4 protein panels) into NimbusImage as images + cell polygons + per-cell data. Every step below was measured on one of these:

Worked example XOA Cells Features Morphology H&E Extras
FFPE Human Lymph Node (Prime 5K) pre-4 708,983 4,624 genes 4 ch, 0.2125 µm/px own grid, M scale 1.289 cell types csv
FFPE Human Kidney RCC, protein 4.0.0.19 465,534 405 genes + 27 proteins 35 ch 24096×60680, rotated 90°, 0.2738 µm/px 77M molecules, 9-region GeoJSON

Kidney timings: polygons 74 s (morphology) / 144 s (H&E), UMAP 207 s, clusters + UMAP properties ~90 s, table build 115 MB in 1 s + register 3 s, transcripts register 13 s, region summary over 9 regions ~11 s.

Every step lives in the nimbusimage package as nimbusimage.xenium (≥ 0.3.0), usable from Python or as the nimbusimage-xenium command (one subcommand per step; also python -m nimbusimage.xenium). nimbusimage-xenium <step> --help lists each step's flags. The command reads credentials from the environment only:

export NI_API_URL=http://localhost:8080/api/v1
export NI_API_KEY=...            # or NI_USERNAME + NI_PASSWORD; never commit a key
pip install 'nimbusimage[xenium]'          # 'nimbusimage[xenium-umap]' adds the UMAP step

From a clone, pip install -e 'nimbusimage[xenium]', and run from outside the repo root (trap 12). The same pipeline from Python:

import nimbusimage as ni
from nimbusimage import xenium

client = ni.connect()
bundle = xenium.XeniumBundle("extracted")
ds = xenium.upload_morphology(client, bundle, "Lymph node")
cells = xenium.upload_polygons(ds, bundle)        # a CellMap; keep it
cells.save("cells_morph.npz")                     # later: xenium.open_cells(ds, bundle, path)
xenium.upload_gene_panel(ds, bundle, cells, ["CD3E", "MS4A1"])
xenium.upload_clusters(ds, bundle, cells)
xenium.upload_umap(ds, bundle, cells, xenium.compute_umap(bundle))
xenium.upload_cell_types(ds, bundle, cells, "cell_types.csv")
table = xenium.build_spatial_table(bundle, cells, "spatial.zarr.zip",
                                   cell_types="cell_types.csv")
xenium.upload_spatial_table(ds, table)            # refuses a table built for another dataset
xenium.register_transcripts(ds, bundle, cells)     # the polygons' frame; checked vs ds
xenium.upload_regions(ds, "annotation.geojson", cells, drawn_in="he",
                      alignment="he_align.csv")    # adds M to the morphology frame

# the H&E image: its own frame and its own cell map
he_frame = xenium.ImageFrame.create(bundle=bundle, alignment="he_align.csv")
he_cells = xenium.upload_polygons(he_ds, bundle, he_frame)

Two objects carry what the steps share, so nothing has to be passed twice. Transcripts and regions take the dataset's CellMap (or an explicit ImageFrame) and never fall back to a default frame: nothing verifies their coordinates, so a guess would silently misplace every molecule on an H&E dataset. On the command line that means --cells, or --image/--alignment/--pixel-size; a mistyped --cells path is an error.

  • ImageFrame — how microns land on one dataset's pixels: which image (morphology or he), the pixel size, the alignment. Validated when built (pixel size > 0, a 3×3 invertible alignment). Every coordinate-producing step takes the same frame, so a pixel-size override or an alignment cannot reach one step and miss another.
  • CellMap — every cell's annotation id, with the dataset they belong to, the frame they were drawn with, and the polygon set. Always one slot per cell (None where a polygon was degenerate or past --limit). Every per-cell step refuses a map of another dataset, of nuclei, or of another bundle before writing anything, and open_cells spot-checks a saved map against the server before it is used.

Every step raises xenium.XeniumError instead of writing wrong data (a missing gene, a malformed alignment, polygons out of cell_index order); the command prints it and exits 1.

0. The whole pipeline

X=nimbusimage-xenium
# 1. URLs are JS-rendered on the 10x page — grep the HTML
curl -sL "<dataset-page-url>" | grep -oE 'https://cf\.10xgenomics\.com[^"]*' | sort -u
# 2. Download: the bundle (~8.5 GB), the standalone H&E, its alignment, the cell types
curl -sL -C - --retry 5 -o outs.zip "<prefix>_xe_outs.zip"
curl -sL -C - --retry 5 -o he.ome.tif "<prefix>_he_image.ome.tif"
curl -sL -o he_align.csv "<prefix>_he_imagealignment.csv"
curl -sL -o cell_types.csv "<prefix>_cell_types.csv"
# 3. Extract only what is needed
#    (transcripts.zarr.zip, ~4.7 GB, only for the step-9 overlay: add it then)
unzip -o outs.zip 'morphology_focus/*' cells.zarr.zip cell_feature_matrix.zarr.zip \
      analysis.zarr.zip experiment.xenium -d extracted/
# 4. Images: one dataset from morp
Полный SKILL.md на GitHub

Установить nimbusimage-xenium-ingest в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlreferences/api-overview.mdreferences/gotchas.md

FAQ

Что делает скилл nimbusimage-xenium-ingest?

Load a 10x Xenium spatial-transcriptomics bundle into NimbusImage: the morphology and H&E images, cell segmentation polygons, a gene-expression marker panel, clustering, a computed UMAP, and cell types as tags. Use this skill when the user mentions Xenium, 10x spatial data, cells.zarr, cell_feature_matrix, transcripts, he_imagealignment, or wants Xenium / spatial-omics cells and per-cell data in NimbusImage. Covers bundle anatomy, micron-to-pixel transforms, H&E alignment, orientation validation, bulk upload, nested property values, and every trap hit on a 709k-cell dataset.

Как установить скилл nimbusimage-xenium-ingest?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nimbusimage-xenium-ingest запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nimbusimage-xenium-ingest с