
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
ShortCake是一个基于Ubuntu 22.04的单细胞分析Docker镜像,是https://hub.docker.com/repository/docker/rnakato/singlecell_jupyter%E7%9A%84%E6%9B%B4%E6%96%B0%E7%89%88%E6%9C%AC%E3%80%82%E8%AF%A5%E9%95%9C%E5%83%8F%E9%9B%86%E6%88%90%E4%BA%86%E5%A4%A7%E9%87%8F%E5%8D%95%E7%BB%86%E8%83%9E%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%EF%BC%8C%E6%8F%90%E4%BE%9B%E5%A4%9A%E7%A7%8D%E8%BD%BB%E9%87%8F%E5%8C%96%E7%89%88%E6%9C%AC%E4%BB%A5%E9%80%82%E5%BA%94%E4%B8%8D%E5%90%8C%E9%9C%80%E6%B1%82%EF%BC%8C%E6%94%AF%E6%8C%81Jupyter Notebook和RStudio,旨在实现高效、可重复的单细胞数据分析流程。
工具按功能分类如下(因未解决错误无法安装的工具已标注删除线):
数据库:
由于完整镜像体积较大(约100GB),v3版本起提供多种轻量化版本:
| 版本名 | 特点 |
|---|---|
| shortcake_seurat | 仅包含Seurat及相关包 |
| shortcake_r | 在shortcake_seurat基础上增加R包,支持Jupyter但不含Python工具 |
| shortcake_light | 在shortcake_r基础上增加shortcake_default环境,包含Seurat、Scanpy等核心工具,满足多数用户需求 |
| shortcake | 在shortcake_light基础上增加几乎所有Python虚拟环境(不含scVI和rapids_singlecell) |
| shortcake_scvi | 在shortcake_light基础上增加scVI环境 |
| shortcake_rapidsc | 在shortcake_light基础上增加rapids_singlecell环境 |
| shortcake_full | 包含所有工具的完整镜像 |
示例:运行shortcake_light v3.4.0
bashdocker run --rm -p 8888:8888 -it rnakato/shortcake_light:3.4.0 jupyternotebook.sh
适用于单细胞数据分析全流程,包括:
Docker
bash# 拉取镜像(指定版本,如3.4.0) docker pull rnakato/shortcake:<version> # 或拉取特定轻量化版本 docker pull rnakato/shortcake_light:3.4.0
Singularity/Apptainer
bash# 构建镜像(Singularity) singularity build -F shortcake.sif docker://rnakato/shortcake # 或(Apptainer) apptainer build -F shortcake.sif docker://rnakato/shortcake # 也可从Dropbox下载预构建镜像:https://www.dropbox.com/scl/fo/lptb68dirr9wcncy77wsv/h?rlkey=whhcaxuvxd1cz4fqoeyzy63bf&dl=0
Docker
bash# 交互式登录容器 docker run [--gpus all] --rm -it rnakato/shortcake /bin/bash # 启动Jupyter Notebook(挂载本地目录到/work/mnt) docker run [--gpus all] --rm -p 8888:8888 -v /本地目录:/work/mnt rnakato/shortcake jupyternotebook.sh
--gpus all:使用GPU时添加(如scvi-tools)-p 8888:8888:映射容器端口到主机,用于访问Jupyter-v:挂载本地目录,便于数据读写Singularity/Apptainer
bash# 启动Jupyter Notebook singularity exec [--nv] shortcake.sif jupyternotebook.sh # 启动RStudio Server(指定端口,如8787) singularity exec [--nv] shortcake.sif rserver.sh 8787 # 直接运行R singularity exec [--nv] shortcake.sif R
--nv:使用GPU时添加Python虚拟环境
通过micromamba管理多个Python环境,避免版本冲突:
bash# 查看环境列表 micromamba env list # 示例输出(部分环境): # base * /opt/micromamba # shortcake_default /opt/micromamba/envs/shortcake_default # cellphonedb /opt/micromamba/envs/cellphonedb
shortcake_default为默认环境,包含scanpy、scvelo等核心工具。
Jupyter Notebook
启动后通过浏览器访问http://localhost:888,选择对应kernel(如shortcake_default或R)即可使用相应环境工具。
RStudio Server
启动后访问http://localhost:<port>(如8787),默认用户名/密码:rstudio/rstudio。
命令行工具
部分工具提供命令行接口,如velocyto:
bash# 生成loom文件(Singularity示例) singularity exec shortcake.sif velocyto run10x -m repeat_msk.gtf <10X数据目录> <gtf文件> # 激活指定环境(如celloracle) singularity exec shortcake.sif run_env.sh celloracle python -c "import celloracle"
bash# 克隆仓库 git clone https://github.com/rnakato/ShortCake cd ShortCake # 配置GitHub token(用于安装GitHub包) # 1. 获取token:https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token # 2. 创建Docker_R/.env和Docker_Python/.env,内容:GITHUB_PAT=<your_token> # 构建R基础镜像 cd Docker_R/SeuratData && sh wget.sh # 下载SeuratData数据集 cd .. && docker-compose -f docker-compose.yml build # 构建shortcake_seurat和shortcake_r # 构建Python相关版本 cd ../Docker_Python && docker-compose -f docker-compose.yml build light # 构建shortcake_light
使用时请引用:
Nakato R, Nagai LAE. ShortCake: An integrated platform for efficient and reproducible single-cell analysis, Bioinformatics, 2025. DOI: 10.1093/bioinformatics/btaf559
详见:https://github.com/rnakato/ShortCake/blob/master/ChangeLog.md
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务