bio-spatial-transcriptomics-spatial-visualization
БесплатноЗапускает вложенные скриптыНе проверенPlots spatial transcriptomics expression, clusters, and annotations on tissue using Squidpy and Scanpy. Use when choosing the plotter and spot size by…
от lilinji★ 18 звёзд на GitHubОб этом скилле
Version Compatibility
Reference examples tested with: squidpy 1.4+, scanpy 1.10+, anndata 0.10+, matplotlib 3.8+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Spatial Visualization
"Plot expression / clusters / a score on my tissue section" -> Render per-feature values at their real spatial coordinates, optionally over the histology image, without inventing structure the assay did not measure.
- Spot/capture fork (Visium, Visium HD, Slide-seq):
scanpy.pl.spatialorsquidpy.pl.spatial_scatterWITH the dataset'sscalefactorsand aspot_size/sizeset to the real capture diameter. - Imaging/FOV fork (Xenium, MERFISH/MERSCOPE, CosMx):
squidpy.pl.spatial_scatterwithshape=Nonefor the cell/molecule point cloud, or polygon shapes for segmentation overlays, or a platform viewer (Xenium Explorer, napari, Vitessce, TissUUmaps).
Governing Principle
Plotting differs by the platform-class fork, and rendering choices can manufacture pattern that is not in the data.
The first decision is which side of the fork the data sits on, because it selects the plotter and the meaning of marker size. Spot/capture data carries a histology image and a scalefactors block that maps array coordinates to image pixels; the plotted spot stands for a real capture spot (a 55 um Visium spot is a 1-10-cell mixture, not a cell) and the marker size should reflect that capture diameter. Imaging/FOV data is a point cloud of segmented cells or individual transcript molecules with no Visium-style hex lattice; forcing it through a spot plotter or oversizing markers paints continuous tissue coverage over what is actually sparse, discrete detections. Using the wrong plotter or an arbitrary spot size silently misrepresents the tissue.
The deeper trap is that several common rendering choices invent structure. Smoothing, kernel-density, kriging, or contouring a sparse spatial field produces a continuous surface that looks like high-resolution biology but is interpolated -- the apparent gradients and domains can be artifacts of the kernel, and any spatial statistic (Moran's I, domain calls) computed on the smoothed field is partly circular. Oversized markers are rhetorical: in scanpy.pl.spatial size is a scaling factor on the spot diameter, so inflating it merges neighbors and fakes contiguity the assay never resolved. A perceptually non-uniform colormap (jet/rainbow) invents banding and edges in a smooth gradient and is unreadable under color-vision deficiency, and silent vmin/vmax clipping can erase or exaggerate differences. Finally, UMAP/tSNE distances are NOT metric (the same caveat as single-cell/clustering) -- gaps and cluster spacing in an embedding carry no spatial meaning and must not be read as tissue conclusions. Honest spatial visualization shows the raw points, names the transform and any clipping, and never lets a plotting parameter assert biology the measurement did not contain.
Plot genre by platform fork
| Plot genre | Spot/capture fork (Visium, Slide-seq) | Imaging/FOV fork (Xenium, MERFISH, CosMx) | Honesty pitfall to avoid |
|---|---|---|---|
| Expression / cluster on tissue | sc.pl.spatial (uses scalefactors) or sq.pl.spatial_scatter |
sq.pl.spatial_scatter(shape=None) point cloud |
Oversized spot_size/size faking coverage |
| Histology overlay | sc.pl.spatial(img_key='hires'); scalefactor maps coords->pixels |
sq.pl.spatial_scatter(img=True, img_res_key=...) with the registered image |
Wrong coordinate frame (micron vs pixel) -> points off image |
| Single-molecule / transcript map | not applicable (no molecule table) | scatter the transcript x,y table, or Xenium Explorer / napari | Treating segmented matrix as raw molecules |
| Segmentation / boundary overlay | not applicable | sq.pl.spatial_scatter polygon shapes, or napari/TissUUmaps |
Hiding segmentation error behind tidy cell polygons |
| Continuous field / heatmap | per-spot color, NO interpolation | per-cell color, NO interpolation | KDE/kriging/contour manufacturing gradients |
| Embedding (UMAP/tSNE) | sc.pl.umap for QC only |
sc.pl.umap for QC only |
Reading non-metric embedding distance as spatial |
When competing rendering options exist (point cloud vs polygon overlay, sequential vs diverging colormap), verify the current platform viewer and Squidpy plotting docs before committing -- spatial tooling and platform exports change quickly.
Spot/Capture Plot with Real Scalefactors and Spot Size
Goal: Show expression or cluster labels at true spot positions on a spot/capture section with a marker size that reflects the c
Установить bio-spatial-transcriptomics-spatial-visualization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bio-spatial-transcriptomics-spatial-visualization?
Plots spatial transcriptomics expression, clusters, and annotations on tissue using Squidpy and Scanpy. Use when choosing the plotter and spot size by platform fork (sc.pl.spatial / sq.pl.spatial_scatter with real scalefactors and capture diameter for spot/capture data like Visium and Slide-seq, versus molecule/segmentation overlays for imaging/FOV data like Xenium, MERFISH, and CosMx); getting the histology coordinate-frame transform right (micron<->pixel, scalefactors) so points land on the image; and avoiding the honest-visualization traps where interpolation/KDE manufactures spatial pattern not in the data, oversized markers fake tissue coverage, jet and other non-uniform colormaps distort structure, and non-metric UMAP/tSNE distances are misread as spatial conclusions.
Как установить скилл bio-spatial-transcriptomics-spatial-visualization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bio-spatial-transcriptomics-spatial-visualization запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic