Skip to main content

MSP logo: distinct cell populations sharing sample colors

MSP: Multi-Sample Pipeline

Find recurring noise and annotate cell types across samples.

Python 3.10 or newer MIT license Part of the ECA-RSI ecosystem

Why MSP   ·   Workflow   ·   Get started   ·   Results   ·   Documentation

MSP uses cross-sample integration to identify recurring noisy populations and annotate cell types in single-cell RNA-seq data. It combines Harmony, cluster structure, and QC evidence in a browser report, with optional AI agents for inspection and annotation. Start from OSP outputs or your own compatible H5AD files.

Why review samples together?

Outliers are scarce within one sample, but similar noisy cells can recur across many samples. After integration, they can accumulate into dense groups, separating from the main populations while retaining traces of their cell-type identity. This repeated core-and-satellite pattern, or fractal structure, makes noise that was scattered within samples easier to locate and assess together. Recurrence across samples can therefore reveal shared technical effects as well as shared biology.

From structure to noise filtering

MSP locates separated fragments within broad cell populations and compares their QC profiles with core cells. Contamination, doublet, stress, mitochondrial, and inherited QC evidence contribute removal candidates. AI inspection checks markers, sample composition, and cluster structure; annotation applies removals and records their sources. A detached group needs supporting evidence before being interpreted as noise.

How it works

Integration builds the shared map and finds fragments. Inspection reviews quality and biological evidence. Annotation assigns broad and fine labels, merges groups judged to represent the same population, and writes a filtered dataset. The report brings the structures, evidence, and decisions together.

Sample H5AD files enter integration to reveal core and satellite fragments; optional AI inspection reviews QC and markers without removing cells; annotation applies labels, merges, and removals to a separate dataset. Each stage updates the HTML report.

Get started

1. Install

Use Python 3.10 or newer in a separate environment. Install from PyPI with AI support; omit [agent] if you only need integration. No GPU or torch is needed: Harmony runs on the CPU through harmonypy 2.

python -m pip install "msp-sc[agent]"

For the development version, install from GitHub instead:

python -m pip install "msp-sc[agent] @ git+https://github.com/chansigit/msp.git"

2. Prepare your samples

Provide one H5AD per sample, with raw counts in layers["counts"] and a sample column in obs. Files must share the same genes in the same order, and cell IDs must be unique across files. Replace the paths and sample_id below with your own; see the user guide for details.

3. Run the analysis

This command integrates samples and creates msp_out/report.html without an API key. To include AI inspection and annotation, follow the example below it.

python -m msp A/clustered.h5ad B/clustered.h5ad \
    --batch-col sample_id --species human --outdir msp_out
Add AI inspection and annotation

This example uses Doubao through Volcengine Ark and requires an Ark API key with model access; provider charges may apply. --annotate also runs inspection. For other runtimes, see AI configuration.

export ARK_API_KEY="YOUR_ARK_API_KEY"
python -m msp A/clustered.h5ad B/clustered.h5ad \
    --batch-col sample_id --species human --outdir msp_out \
    --annotate --harness openai --model doubao-seed-2-1-turbo-260628

Find and understand your results

Open msp_out/report.html in your browser; download it first if you ran on a server. Start with sample composition and cell maps, then compare flagged groups against their markers and QC. Review the proposed labels, merges, and removals before downstream analysis. The HTML embeds its plots and can be shared as one file.

Output What you get
report.html Cell maps, quality evidence, and completed AI reviews.
integrated.h5ad All input cells in the shared space, with inspection proposals when available.
annotated.h5ad Retained cells with broad and fine cell-type labels after annotation.
annotation_removed.csv Removed cell IDs and the sources of each removal decision.

FAQ

Does MSP remove cells?

Integration and inspection retain all cells. Annotation applies the union of integration's removal candidates, inspection's drop proposals, and its own removal decisions. It writes survivors to annotated.h5ad, preserves integrated.h5ad, and records removed cells in annotation_removed.csv.

Can I continue or rerun an analysis?

Repeat the command to reuse completed steps. Use --force or a new output directory when replacing input contents at the same path or changing the AI model. Rerunning a stage archives its previous outputs and invalidates later stages; see rerunning.

Do I need OSP or ECA-RSI?

MSP runs independently with compatible inputs. OSP handles sample-level QC and annotation; ZMIP continues with closer analysis of individual lineages. ECA-RSI coordinates these steps and iterative review, starting from data prepared with ECA-PP.

Documentation

Read the user guide for input preparation, report reading, and reruns, or the developer guide for APIs, data fields, and stage contracts. A folder-based example runs MSP over OSP outputs. Questions and problems belong in GitHub Issues. MSP uses the MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msp_sc-0.3.1.tar.gz (114.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msp_sc-0.3.1-py3-none-any.whl (91.9 kB view details)

Uploaded Python 3

File details

Details for the file msp_sc-0.3.1.tar.gz.

File metadata

  • Download URL: msp_sc-0.3.1.tar.gz
  • Upload date:
  • Size: 114.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for msp_sc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 42969241cf44a56312ceb07042f20f81923c782d20ae38ff908d7d271a5994bd
MD5 85e2295824448eb27852ab42babdf527
BLAKE2b-256 f3a5bf5c343d01863dd0487c9a229358212d5fc1a48dd51040a2e38ba93c9ffa

See more details on using hashes here.

File details

Details for the file msp_sc-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: msp_sc-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 91.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for msp_sc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f6e425d975cce15074fdeab22edc6755cdfc085767e875eb9f0e45a80f1a9a
MD5 867af6d739925a8f96589c50e1a7debd
BLAKE2b-256 5b9f43f777ed1ee3269b3a94530f5bbd00e1f85da9d659dcc60a5f9d748c3464

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.3

2 files

0.3.2

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page