create-singlecell-env-lite

创建最小单细胞环境:配置一个用于标准单细胞 RNA-seq 分析的最小 conda 环境,仅包含 Seurat 核心流程,不含高级整合、轨迹推断或注释包。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "create-singlecell-env-lite":https://skillpi.com/zh/skills/deepskill-e4da4c88709778d88b102577d8107d2d701675dd8b2906f582f679d3159d233d。安装前核对上游来源和版本:https://skillhub.cn/skills/org-ekt13cme/create-singlecell-env。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

创建最小单细胞环境:配置一个用于标准单细胞 RNA-seq 分析的最小 conda 环境,仅包含 Seurat 核心流程,不含高级整合、轨迹推断或注释包。

0 下载

介绍来源: third_party · org-ekt13cme · 1.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: "create-singlecell-env-lite"
description: "Configure a minimal conda environment for standard single-cell RNA-seq analysis (Seurat core workflow only, no advanced integration/trajectory/annotation packages)"
alwaysAllow: ["Bash"]

Single Cell Analysis Environment Setup (Lite)

This is a trimmed-down version of create-singlecell-env. It installs only what's needed to run the standard Seurat workflow: QC → normalize → PCA → cluster → UMAP → marker genes → plot.

Skips: harmony/batchelor (integration), monocle3/slingshot/tradeSeq (trajectory), DoubletFinder (doublet detection), SingleR/scmap (annotation), DESeq2/edgeR/limma (bulk DE), clusterProfiler/fgsea/GSVA/enrichR (enrichment), CellChat (cell-cell communication), scran/scater/scuttle (Bioconductor alt framework), Python/scanpy integration, and example datasets. Install any of those later, on demand, with BiocManager::install('PackageName') inside the env — they're not needed to run the standard pipeline.

Step 0: Detect and Install Conda

CRITICAL: Always start by locating the real Conda executable. Do not rely only on command -v conda: desktop apps, non-interactive shells, and shells without conda init may have Conda installed without exposing it on PATH.

Set CONDA_EXE once and use "$CONDA_EXE" for every automated Conda command in this skill. Shell initialization is not required when invoking Conda by absolute path.

discover_conda() {
    local candidate="" login_shell="${SHELL:-}"

    if [[ -n "${CONDA_EXE:-}" ]] && [[ -x "$CONDA_EXE" ]]; then
        candidate="$CONDA_EXE"
    elif candidate="$(type -P conda 2>/dev/null)" && [[ -x "$candidate" ]]; then
        :
    else
        candidate=""
    fi

    if [[ -z "$candidate" ]] && [[ -x "$login_shell" ]]; then
        local login_env="" login_path=""
        login_env="$("$login_shell" -lic env 2>/dev/null)"
        candidate="$(printf '%s\n' "$login_env" | sed -n 's/^CONDA_EXE=//p' | tail -n 1)"

        if [[ ! -x "$candidate" ]]; then
            candidate=""
            login_path="$(printf '%s\n' "$login_env" | sed -n 's/^PATH=//p' | tail -n 1)"
            if [[ -n "$login_path" ]]; then
                candidate="$(PATH="$login_path" type -P conda 2>/dev/null)"
            fi
        fi
        [[ -x "$candidate" ]] || candidate=""
    fi

    [[ -n "$candidate" ]] || return 1
    CONDA_EXE="$(cd "$(dirname "$candidate")" && pwd -P)/$(basename "$candidate")"
    export CONDA_EXE
}

if discover_conda; then
    echo "✓ Conda is installed: $CONDA_EXE"
    "$CONDA_EXE" --version
else
    echo "✗ Conda is not exposed by the current environment or the user's login shell"
fi

There is no universal Conda installation registry on macOS/Linux. If Conda is installed but neither PATH, CONDA_EXE, nor the login-shell configuration references it, do not crawl the whole filesystem or guess installation directories. Ask the user for the executable path, then verify it with /absolute/path/to/conda --version before offering to install another distribution.

If Conda is not installed at all, offer the standard Miniconda install (see create-singlecell-env Step 0 for the full OS-detection install script) or point the user to https://docs.anaconda.com/free/miniconda/index.html.

Step 1: Create Conda Environment

Detect architecture and create the environment. Use a distinct env name (scrnaseq-lite) so it never collides with a full scrnaseq environment the user may already have.

ARCH=$(uname -m)

if "$CONDA_EXE" env list | grep -q "^scrnaseq-lite"; then
    echo "⚠️  Environment 'scrnaseq-lite' already exists."
    echo "   Activate with: conda activate scrnaseq-lite"
    echo "   To recreate, first run: conda env remove -n scrnaseq-lite"
fi

if [[ "$ARCH" == "arm64" ]]; then
    "$CONDA_EXE" create -n scrnaseq-lite "r-base>=4.4,<4.5" r-essentials -c conda-forge -y
else
    "$CONDA_EXE" create -n scrnaseq-lite "r-base>=4.4,<4.5" r-essentials -c conda-forge -y
fi

Verify:

"$CONDA_EXE" env list | grep -q "^scrnaseq-lite" \
    && echo "✓ Environment 'scrnaseq-lite' created successfully" \
    || echo "✗ Environment creation failed"

Step 2: Activate Environment

IMPORTANT: conda activate relies on shell hooks that are only loaded in an interactive login shell. In non-interactive contexts (scripts, CI, subprocesses) it can silently fail to update PATH, causing compiled-package installs to fail with errors like x86_64-conda-linux-gnu-cc: not found.

Always use "$CONDA_EXE" run -n scrnaseq-lite <command> for every automated command in this skill.

"$CONDA_EXE" run -n scrnaseq-lite R --version

"$CONDA_EXE" run -n scrnaseq-lite bash -c 'command -v ${CC:-cc} || command -v x86_64-conda-linux-gnu-cc || command -v gcc' \
    || { echo "✗ No C compiler found on PATH inside the env — install one first: conda install -n scrnaseq-lite compilers -c conda-forge -y"; exit 1; }

Step 3: Configure R Environment

Note on failure detection: install.packages(...) usually exits 0 even on failure. Always verify with installed.packages() after each install (see install_and_verify helper below).

"$CONDA_EXE" run -n scrnaseq-lite Rscript -e "
options(repos = c(CRAN = 'https://cloud.r-project.org'))
"

Step 4: Install Core Packages Only

The minimal set needed to run the standard Seurat workflow (QC, normalization, PCA, clustering, UMAP, FindAllMarkers, plotting):

echo "Installing minimal single-cell package set..."

install_and_verify() {
    local install_expr="$1"; shift
    local pkgs=("$@")
    "$CONDA_EXE" run -n scrnaseq-lite Rscript -e "$install_expr"
    local check_expr="miss <- c($(printf "'%s'," "${pkgs[@]}" | sed 's/,$//'))[!c($(printf "'%s'," "${pkgs[@]}" | sed 's/,$//')) %in% installed.packages()[,1]]; if (length(miss)) { cat('MISSING:', paste(miss, collapse=', '), '\n'); quit(status=1) } else { cat('OK\n') }"
    "$CONDA_EXE" run -n scrnaseq-lite Rscript -e "$check_expr" || { echo "✗ Failed to install: ${pkgs[*]}"; return 1; }
    echo "✓ Verified installed: ${pkgs[*]}"
}

# Core framework
install_and_verify "install.packages(c('Seurat', 'SeuratObject'), repos = 'https://cloud.r-project.org')" Seurat SeuratObject || exit 1

# Visualization + data wrangling
install_and_verify "install.packages(c('ggplot2', 'patchwork', 'dplyr'), repos = 'https://cloud.r-project.org')" ggplot2 patchwork dplyr || exit 1

That's it — no Bioconductor packages, no BiocManager needed for this minimal set.

Verification

"$CONDA_EXE" run -n scrnaseq-lite Rscript -e "
suppressMessages({
  library(Seurat); library(SeuratObject); library(ggplot2); library(patchwork); library(dplyr)
})
cat('R version:', R.version.string, '\n')
cat('Seurat version:', as.character(packageVersion('Seurat')), '\n')
cat('All core packages load OK\n')
"

Quick Reference Package List

Category Packages
Core Framework Seurat, SeuratObject
Visualization ggplot2, patchwork
Data wrangling dplyr

Total: 5 packages (vs. ~25 in the full create-singlecell-env skill).

Upgrading to the Full Environment

If the user later needs integration, trajectory inference, annotation, DE, enrichment, or cell-cell communication analysis, point them to the full create-singlecell-env skill, or install the specific Bioconductor package(s) they need directly into scrnaseq-lite:

"$CONDA_EXE" run -n scrnaseq-lite Rscript -e "
if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager')
BiocManager::install('PackageName', ask = FALSE)
"

Default Behavior When Invoked

  1. First: Run discover_conda from Step 0; never treat a PATH miss alone as proof Conda is absent
  2. If discovered: Verify with "$CONDA_EXE" --version and use that absolute path thereafter
  3. If not discovered: Ask for a custom Conda path before offering installation instructions
  4. If installed: Check if scrnaseq-lite already exists using "$CONDA_EXE" env list
  5. If environment exists: Warn user and suggest how to proceed (use or recreate)
  6. If environment doesn't exist: Proceed with environment creation (Steps 1-4)
  7. Always: Verify each step completes successfully before moving to the next
  8. Report: Give clear feedback on the executable path, installation, and current progress

当前收录版本

1.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值82/100

亮点

  • 针对单细胞 RNA-seq 分析提供轻量化、精准的最小环境配置,满足 Seurat 核心流程刚需
  • 明确区分轻量版与完整版,帮助用户按需选择,避免过度安装
触发精准95/100

亮点

  • description 清晰界定功能范围(仅核心流程,不含高级模块),边界明确
  • frontmatter 描述完整,无截断或错位
结构规范95/100

亮点

  • 步骤划分清晰(Step 0-4),每步有明确目标和验证机制
  • 包含端到端可执行示例和最终验证脚本,frontmatter 完整
执行可靠92/100

亮点

  • 覆盖 Conda 未暴露、环境已存在、编译器缺失、包安装失败等主要异常场景
  • 使用 CONDA_EXE 绝对路径和 conda run 避免 shell hook 问题,关键操作有验证机制
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • cloud.r-project.org
  • docs.anaconda.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。