Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

single-cell-cellphonedb-communication-mapping

FreeNo executable scriptsNot checked

CellPhoneDB v5 ligand-receptor analysis, CellChatViz plots, and the newer ccc_heatmap / ccc_network_plot / ccc_stat_plot communication visualizations in…

omicverseby omicverse★ 1,402 GitHub stars17 installs in other catalogs

About this skill

Single-cell CellPhoneDB communication mapping

Overview

Apply this skill when a user wants to quantify ligand-receptor communication between annotated single-cell populations and visualize the result with OmicVerse's CellPhoneDB plotting stack. This skill now covers both the original low-level ov.pl.CellChatViz workflow and the newer public plotting APIs:

  • ov.pl.ccc_heatmap(...)
  • ov.pl.ccc_network_plot(...)
  • ov.pl.ccc_stat_plot(...)

Use the ccc_* functions by default when the goal is to quickly generate publication-ready plots with a stable public API. Drop down to CellChatViz when the user needs method-level control or wants to combine several custom visualizations in one notebook.

Instructions

  1. Prepare the environment
    • Use an environment with omicverse>=0.2, scanpy, anndata, pandas, matplotlib, seaborn, and CellPhoneDB resources.
    • For the newer visualizations, also ensure these optional plotting dependencies are available when needed:
      • marsilea for heatmap and bubble matrix plotters.
      • mpl-chord-diagram for chord diagrams.
      • networkx for diffusion and network-style plots.
      • adjustText if the user wants improved automatic label repulsion.
    • Activate OmicVerse plotting defaults with ov.plot_set().
  2. Load and validate the annotated AnnData
    • Read the normalized expression matrix with ov.read(...).
    • Keep the communication grouping column clean, categorical, and aligned with the intended identities.
    • Recommended checks:
      celltype_key = "cell_labels"
      assert celltype_key in adata.obs.columns, f"{celltype_key} missing from adata.obs"
      adata.obs[celltype_key] = adata.obs[celltype_key].astype("category").cat.remove_unused_categories()
      assert not adata.obs[celltype_key].isna().any(), f"NaN values found in {celltype_key}"
      min_per_group = adata.obs[celltype_key].value_counts().min()
      if min_per_group < 10:
          print(f"WARNING: smallest group has {min_per_group} cells; sparse groups may destabilize permutations")
      
    • Confirm the matrix is log-normalized before running CellPhoneDB. Raw counts can distort permutation-based significance.
  3. Run CellPhoneDB through OmicVerse
    • Use ov.single.run_cellphonedb_v5(...) and persist the outputs:
      cpdb_results, adata_cpdb = ov.single.run_cellphonedb_v5(
          adata,
          cpdb_file_path="./cellphonedb.zip",
          celltype_key="cell_labels",
          min_cell_fraction=0.005,
          min_genes=200,
          min_cells=3,
          iterations=1000,
          threshold=0.1,
          pvalue=0.05,
          threads=10,
          output_dir="./cpdb_results",
          cleanup_temp=True,
      )
      
    • Save cpdb_results and adata_cpdb so downstream plotting can be repeated without rerunning permutations.
    • CellChat alternative (no R, no extra install beyond PyTorch): ov.single.run_cellchat reproduces R CellChat 2.2 (identical over-expressed genes/LR pairs, probabilities to ~1e-15) and stores adata.uns['cellchat_res'], which every ov.pl.ccc_* call reads directly:
      ov.single.run_cellchat(adata, groupby="cell_labels", species="human")  # log-normalised X
      comm = ov.single.format_cellchat_results(adata)                         # optional explicit comm AnnData
      df = ov.single.cellchat_subset_communication(adata, signaling=["TGFb"])  # significant LR table
      centr = ov.single.cellchat_centrality(adata)                             # sender/receiver/mediator/influencer
      
      CellChat scores are probabilities (~1e-3), not expression; pathway summaries pick scale-aware thresholds automatically. Groups with <= min_cells (default 10) cells are removed, as in R filterCommunication.
    • Unified entry point / several methods at once: ov.single.run_ccc runs any registered method (ov.single.available_ccc_methods(): cellchat, cellphonedb, liana, fastccc, secact, and the spatial cytosignal / commot) and always returns the same communication AnnData:
      comm = ov.single.run_ccc(adata, "cell_labels", method="cellchat")
      comm = ov.single.run_ccc(adata, "cell_labels", method=["cellchat", "cellphonedb", "liana"],
                               consensus="rra",                     # or "vote" (min_methods=...)
                               method_kwargs={"cellphonedb": {"cpdb_file_path": "./cellphonedb.zip"}})
      res = ov.single.compare_ccc(adata)                          # Jaccard / recall / rank correlations on shared-DB LR pairs
      ov.pl.ccc_compare(res, plot_type="upset")                   # also "jaccard", "recall", "score_corr", "top_lr", "cellpair"
      cp = ov.single.get_ccc(adata, method="cellphonedb")          # any single method's comm AnnData
      comm = ov.space.run_ccc(adata, "cell_type", method="cytosignal")  # spatial (needs obsm['spatial'])
      
      Interactions are matched across databases o
Full SKILL.md on GitHub

Install single-cell-cellphonedb-communication-mapping in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

reference.md

FAQ

What does the single-cell-cellphonedb-communication-mapping skill do?

CellPhoneDB v5 ligand-receptor analysis, CellChatViz plots, and the newer ccc_heatmap / ccc_network_plot / ccc_stat_plot communication visualizations in OmicVerse.

How do I install the single-cell-cellphonedb-communication-mapping skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the single-cell-cellphonedb-communication-mapping skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare single-cell-cellphonedb-communication-mapping with