single-cell-cellphonedb-communication-mapping
FreeNo executable scriptsNot checkedCellPhoneDB v5 ligand-receptor analysis, CellChatViz plots, and the newer ccc_heatmap / ccc_network_plot / ccc_stat_plot communication visualizations in…
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
- 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:
marsileafor heatmap and bubble matrix plotters.mpl-chord-diagramfor chord diagrams.networkxfor diffusion and network-style plots.adjustTextif the user wants improved automatic label repulsion.
- Activate OmicVerse plotting defaults with
ov.plot_set().
- Use an environment with
- 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.
- Read the normalized expression matrix with
- 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_resultsandadata_cpdbso downstream plotting can be repeated without rerunning permutations. - CellChat alternative (no R, no extra install beyond PyTorch):
ov.single.run_cellchatreproduces R CellChat 2.2 (identical over-expressed genes/LR pairs, probabilities to ~1e-15) and storesadata.uns['cellchat_res'], which everyov.pl.ccc_*call reads directly:
CellChat scores are probabilities (~1e-3), not expression; pathway summaries pick scale-aware thresholds automatically. Groups withov.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<= min_cells(default 10) cells are removed, as in RfilterCommunication. - Unified entry point / several methods at once:
ov.single.run_cccruns any registered method (ov.single.available_ccc_methods():cellchat,cellphonedb,liana,fastccc,secact, and the spatialcytosignal/commot) and always returns the same communication AnnData:
Interactions are matched across databases ocomm = 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'])
- Use
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
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
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
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic