返回 Skills 目錄
來源:Scientific Agent Skills
🔬

CellProfiler

🧬生物資訊

以可重現的 CellProfiler 流程分析顯微影像:細胞核分割、細胞計數、單一物件螢光量測與批次執行。

安裝教學

選擇你使用的 AI coding agent,複製指令到終端機執行

一鍵安裝(需要 Node.js)
npx skills add K-Dense-AI/scientific-agent-skills --skill cellprofiler -g -a claude-code -y
手動安裝(不使用 npx)
clone 後複製到 skills 目錄
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills.git
mkdir -p ~/.claude/skills
cp -r scientific-agent-skills/skills/cellprofiler ~/.claude/skills/cellprofiler

Skills 會以 agent 的完整權限執行,安裝前請先閱讀原始 SKILL.md。安裝後重新啟動 agent 即可使用。

使用教學

CellProfiler quantitative microscopy

Use this skill when a user needs a repeatable CellProfiler .cppipe, nuclear counts, nuclear fluorescence, or batch microscopy measurements. The bundled assay accepts one 2D grayscale TIFF nuclear channel per field, with bright nuclei on a dark background. For volumetric segmentation, multichannel cell painting, or tissue-specific models, design a separate pipeline and validate those assumptions rather than silently projecting or splitting the images.

工作流程

  1. Establish the acquisition unit: plate, well, site, time point if present, pixel size, nuclear channel identity, camera bit depth, exposure, and biological replicate. Keep original image intensities. Convert proprietary formats explicitly with Bio-Formats before using this helper.
  2. Create the CSV manifest below. image_path is absolute or relative to the manifest; sample IDs use letters, digits, dots, dashes, or underscores; sample IDs and plate/well/site combinations are unique. TIFFs must be uint8 or uint16, single plane, and nonconstant. The helper rejects RGB, z-stacks, and float images rather than guessing channels.
  3. Use assets/nuclei.cppipe as a starting pipeline: LoadData → IdentifyPrimaryObjects → intensity/size measurements → outline overlay → CSV export. The initial diameter range is 8–80 pixels, with global Otsu thresholding, no threshold smoothing, and border objects excluded. Calibrate this range from representative images and acquisition pixel size before comparing conditions.
  4. Run a small pilot spanning controls, low/high density, dim images, and plate edges. Inspect saved overlays for missed nuclei, splits, merges, and edge exclusions. Adjust thresholding and declumping in CellProfiler, export the tuned .cppipe, and pass --pipeline to preserve it. Do not choose settings separately for each treatment to make their counts agree.
  5. Freeze the tuned pipeline and analyze the batch. Review input saturation warnings, zero counts, count/area distributions, and control behavior. Aggregation for inference belongs at the biological replicate level; thousands of cells from one well are not independent wells.

Run the bounded assay

From this skill directory, create images.csv:

sample_id,image_path,plate,well,site
control_A01_1,images/control_A01_1_DAPI.tif,Plate1,A01,1
python scripts/nuclei_assay.py prepare images.csv load_data.csv
python scripts/nuclei_assay.py run images.csv results --executable cellprofiler
python scripts/nuclei_assay.py summarize results

run requires a fresh/empty output directory and executes CellProfiler with -c -r, an explicit pipeline, --data-file, and output folder. It records the command, pipeline checksum, input image checksums, and sample QC in assay_qc.json; CellProfiler output goes to cellprofiler.log. A failed process stays failed, with its log available for diagnosis. Rerun in a new output folder.

The executable can also be the CellProfiler application launcher or a local container launcher; see references/runtime-and-qc.md for the tested container, filesystem mapping, and verification evidence. prepare and summarize work without CellProfiler.

Interpret the outputs

  • Image.csv: one image/field row, including Count_Nuclei and acquisition metadata.
  • Nuclei.csv: one accepted object per row, with mean/integrated DNA intensity, area, and shape.
  • *_nuclei.png: green nuclear boundaries over the input image for visual QC.
  • assay_qc.json: count consistency and finite normalized intensity checks, plus saturation flags.

LoadData ignores camera metadata for scaling in this asset and divides by the integer storage maximum: uint8 → 255, uint16 → 65535. A 12-bit camera stored in uint16 therefore has a maximum near 0.0625. Do not compare intensities across different bit depths, exposures, gains, or staining batches without an explicit calibration. A saturated image can pass segmentation while its intensity measurement is unusable. Illumination correction and background subtraction are assay-specific additions; this starter does neither.

A count check cannot prove correct segmentation. Inspect overlays and independently annotated fields; report boundary exclusions and segmentation errors alongside the biological result. The synthetic integration test validates a known three-nucleus example, not assay performance on unseen cell types.

Sources