정보
DeepSpot-M은 H&E 조직학 타일로부터 전사체 전역의 가상 공간 전사체학을 생성합니다. 이 기술은 심볼로 쿼리된 단백질 코딩 유전자에 대한 log1p-CPM 발현을 예측하며, 타일링 후 전체 슬라이드에 걸쳐 추론을 실행할 수 있습니다. 본 기술을 사용하려면 `deepspotm` PyPI 패키지를 설치하고 Hugging Face에서 제한된 모델 가중치에 접근해야 합니다.
빠른 설치
Claude Code
추천npx skills add K-Dense-AI/claude-scientific-skills -a claude-code/plugin add https://github.com/K-Dense-AI/claude-scientific-skillsgit clone https://github.com/K-Dense-AI/claude-scientific-skills.git ~/.claude/skills/deepspot-mClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
DeepSpot-M
Overview
DeepSpot-M is a multimodal foundation model that maps a 224x224 H&E histology tile to spatial gene expression in log1p-CPM. The output is virtual spatial transcriptomics: one value per queried gene per tile, laid out on the grid the tiles came from.
A LoRA-adapted pathology foundation backbone (Midnight) tokenises the tile. A
cross-attention gene decoder lets each gene query attend to the patch tokens, and a gene
router hypernetwork builds gene-specific projections from frozen biological embeddings
(Evo 2, Orthrus, ProtT5, scGPT, Apertus). Genes enter the model as queryable embeddings
rather than fixed output slots, so the released model covers a ~19k protein-coding gene
panel including genes unseen in training. The panel ships with the weights as
tokens.csv and is exposed as model.gene_names; genes outside it cannot be queried in
this release.
Applied to TCGA, the model produced a virtual spatial transcriptomics atlas of 28,664 slides across 32 cancer types.
Licensing
The code is PolyForm Noncommercial 1.0.0 and the weights are CC-BY-NC-SA-4.0. Use it for noncommercial research and check both licences before redistributing outputs.
Installation
uv pip install deepspotm==1.0.0
Version 1.0.0 targets Python 3.10 to 3.13 and pulls in PyTorch. Install the PyTorch build that matches your CUDA version first if you want GPU inference.
Model access
The weights are gated:
- Open https://huggingface.co/ratschlab/DeepSpotM and request access.
- Once access is granted, authenticate the machine that will download them:
huggingface-cli login
from_pretrained reads that cached token, so a login is needed once per machine.
Quick start
from deepspotm import DeepSpotM
model, image_processor = DeepSpotM.from_pretrained("ratschlab/DeepSpotM", source="scgpt")
vals = model.predict_genes(image_processor(pil_tile).unsqueeze(0), ["EPCAM", "CD3D"])
pil_tile is a PIL image of exactly 224x224 pixels. image_processor turns it into a
tensor, unsqueeze(0) adds the batch dimension, and predict_genes takes the batch plus a
list of HGNC gene symbols. Values come back in log1p-CPM, aligned with the gene list you
passed, so keep that list beside the output to keep the columns labelled. Symbols must be
in the released ~19k-gene panel (model.gene_names); an unknown symbol raises KeyError
naming the offending genes.
Tile requirements
Tiles must be 224x224 RGB at roughly 20x magnification (about 0.5 microns per pixel). Check the size at the boundary of your pipeline rather than passing an unchecked crop through:
TILE_PX = 224
def require_tile(tile):
"""Return an RGB 224x224 tile, or raise if the crop is the wrong size."""
if tile.size != (TILE_PX, TILE_PX):
raise ValueError(
f"DeepSpot-M expects a {TILE_PX}x{TILE_PX} tile at about 20x "
f"(~0.5 microns per pixel); got {tile.size[0]}x{tile.size[1]}. "
"Re-tile at the matching level or resample the crop."
)
return tile.convert("RGB")
Extract tiles at the slide level whose resolution is nearest 0.5 microns per pixel, then crop to 224x224 there. Resampling from a coarser level changes the texture the backbone reads.
Keep the dependency optional
deepspotm and its weights are a heavy, gated dependency. Import it inside the function
that needs it so the surrounding project installs, imports and tests without it, and turn
an ImportError into a message that names every step:
DEEPSPOTM_HELP = (
"DeepSpot-M is unavailable. Install it with `uv pip install deepspotm==1.0.0`, request "
"access to the gated weights at https://huggingface.co/ratschlab/DeepSpotM, then "
"authenticate with `huggingface-cli login`."
)
def load_deepspotm(source="scgpt"):
try:
from deepspotm import DeepSpotM
except ImportError as exc:
raise RuntimeError(DEEPSPOTM_HELP) from exc
return DeepSpotM.from_pretrained("ratschlab/DeepSpotM", source=source)
Embedding sources
source selects which frozen gene embedding the router builds projections from. It is one
of five values:
source | Gene embedding |
|---|---|
evo2 | genomic sequence |
orthrus | RNA |
prott5 | protein sequence |
scgpt | single-cell expression |
apertus | language model |
Each gives a different view of gene identity. Pick one per run, and run the same tiles
through more than one source when the choice matters to your analysis. See
references/api.md for the full call surface, batching and device placement, gene symbol
handling and output units.
Whole slide workflow
Prediction is per tile, so a slide-scale run is a tiling step followed by batched inference:
- Extract 224x224 tiles on a grid with the
histolabskill, keeping each tile's coordinates. - Process and stack tiles into batches with
torch.stack. - Call
predict_genesonce per batch with the same gene list. - Concatenate the batches into a tiles-by-genes matrix and attach the coordinates.
That matrix is the virtual spatial transcriptomics map for the slide, and it drops
straight into AnnData for downstream spatial analysis. references/whole_slide.md has a
worked loop, batch sizing and an AnnData assembly step.
Common use cases
- Spatial expression maps for marker genes across a tumour section.
- Transcriptome-wide prediction over a slide cohort with no matching assay run.
- Querying any of the ~19k panel genes by symbol, including genes unseen in training — far beyond the few hundred genes of a typical spatial assay panel.
- Adding an expression channel to a morphology-only histology pipeline.
- Building a slide-level cohort atlas, as done for TCGA.
Detailed references
references/api.md:from_pretrainedandpredict_genesin full, the five embedding sources and how to choose, batching, device placement, gene symbol handling, and converting log1p-CPM output.references/whole_slide.md: tiling with histolab, a slide-scale prediction loop, assembling and storing a tiles-by-genes matrix, and cohort-scale runs.
Primary sources
- Paper: https://doi.org/10.64898/2026.06.19.26356060 (medRxiv, posted 22 June 2026)
- Code: https://github.com/ratschlab/DeepSpotM
- Weights: https://huggingface.co/ratschlab/DeepSpotM
- PyPI: https://pypi.org/project/deepspotm/
GitHub 저장소
자주 묻는 질문
deepspot-m Skill이란 무엇인가요?
deepspot-m은(는) K-Dense-AI이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 deepspot-m 관련 작업을 수행할 수 있게 합니다.
deepspot-m은(는) 어떻게 설치하나요?
이 페이지의 설치 명령을 사용하세요. deepspot-m을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.
deepspot-m은(는) 어떤 카테고리에 속하나요?
deepspot-m은(는) 메타 카테고리에 속합니다.
deepspot-m은(는) 무료로 사용할 수 있나요?
네. deepspot-m은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.
연관 스킬
이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
