基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/BrainStOrmics/Spateo-Skills --skill spateo-slice-alignment命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | spateo-slice-alignment |
| description | Spatial alignment of tissue slices — 2D→3D registration |
Register multiple tissue slices into a common coordinate space using morpho_align and morpho_align_ref.
# Align two slices
python -m skills.02_slice_alignment.two_slice \
--slice1 ./data/slice_a.h5ad --slice2 ./data/slice_b.h5ad
# Align multiple slices (z-splitting + 3D concat)
python -m skills.02_slice_alignment.multi_slice \
--input ./data/slices_dir/ --outdir ./output/
# Two-stage 3D alignment (point cloud + reference-based)
python -m skills.02_slice_alignment.two_stage_3d \
--stage1 ./data/stage1.h5ad --stage2 ./data/stage2.h5ad
two_slice.py — Two-slice alignmentfrom skills.02_slice_alignment.two_slice import (
TwoSliceConfig, TwoSliceResult, run_two_slice_pipeline,
)
config = TwoSliceConfig(
slice1_path="./data/slice_a.h5ad",
slice2_path="./data/slice_b.h5ad",
preprocess=True,
use_downsampling=False,
max_iter=300,
)
result = run_two_slice_pipeline(config)
Key APIs: st.align.morpho_align, st.align.morpho_align_ref
multi_slice.py — Multi-slice continuous alignmentSplits data by z-coordinate, aligns consecutive pairs, concatenates in 3D.
from skills.02_slice_alignment.multi_slice import (
MultiSliceConfig, run_multi_slice_pipeline,
)
config = MultiSliceConfig(
input_path="./data/slices/",
z_key="z_coord",
groupby="tissue_type",
max_iter=300,
)
result = run_multi_slice_pipeline(config)
two_stage_3d.py — Two-stage 3D reconstruction + alignmentStage 1: Build point cloud/mesh from individual slices.
Stage 2: Align using reference-based morpho_align_ref.
from skills.02_slice_alignment.two_stage_3d import (
TwoStage3DConfig, run_two_stage_3d_pipeline,
)
Input: AnnData files with .obsm["spatial"] (2D coordinates per slice).
Output: AnnData with .obsm["align_spatial"] (registered coordinates) or concatenated 3D AnnData.
| Parameter | Purpose | Default |
|---|---|---|
slice1_path, slice2_path | Input slice paths | — |
preprocess | Run spateo preprocessing pipeline | True |
spatial_key | Key for input coordinates | "spatial" |
key_added | Key for output coordinates | "align_spatial" |
max_iter | Alignment iterations | 300 |
use_downsampling | Use reference-based alignment | False |
beta | Spatial smoothness weight | 1.0 |
lambdaVF | Vector field regularization | 1.0 |
device | CPU/GPU device | Auto-detected |
| Problem | Fix |
|---|---|
| OOM on GPU | Set use_downsampling=True or device="cpu" |
| Missing spatial key | Verify .obsm["spatial"] exists in input |
| NaN in aligned coords | Check for NaN/Inf in input spatial coords |