ccc_dot_plot
Visualize cell-cell communication interactions from single-cell RNA sequencing data using a dot plot to analyze signaling pathways between cell types.
Instructions
Visualize cell-cell communication interactions using a dotplot.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uns_key | No | Key in adata.uns that contains the LIANA results. | liana_res |
| specificity_cutoff | No | Specificity or p-value threshold for filtering results. | |
| colour | No | Column in liana_res to define the colours of the dots. | |
| size | No | Column in liana_res to define the size of the dots. | |
| source_labels | No | List of labels to use as source, the rest are filtered out. | |
| target_labels | No | List of labels to use as target, the rest are filtered out. | |
| top_n | No | Top N entities to plot. | |
| orderby | No | If top_n is not None, order the interactions by this column. | |
| orderby_ascending | No | If top_n is not None, specify how to order the interactions. | |
| orderby_absolute | No | If top_n is not None, whether to order by the absolute value of the orderby column. | |
| ligand_complex | No | List of ligand complexes to filter the interactions to be plotted. | |
| receptor_complex | No | List of receptor complexes to filter the interactions to be plotted. | |
| inverse_colour | No | Whether to -log10 the colour column for plotting. | |
| inverse_size | No | Whether to -log10 the size column for plotting. | |
| cmap | No | Colour map to use for plotting. | viridis |
| size_range | No | Define size range. Tuple of (min, max) integers. | |
| figure_size | No | Figure x,y size. |
Implementation Reference
- src/scmcp/tool/ccc.py:75-89 (handler)The handler function that executes the ccc_dot_plot tool logic. It prepares filtered kwargs and calls liana.pl.dotplot to generate the dotplot visualization.def plot_dotplot(adata, **kwargs): pval = kwargs.pop("specificity_cutoff", 0.05) res_key = kwargs.get("uns_key", "liana_res") pval_col = adata.uns[res_key].columns[-1] kwargs["filter_fun"] = lambda x: x[pval_col] <= pval if kwargs.get("colour", None) is None: kwargs["colour"] = adata.uns[res_key].columns[-2] if kwargs.get("size", None) is None: kwargs["size"] = adata.uns[res_key].columns[-1] parameters = inspect.signature(li.pl.dotplot).parameters kwargs = {k: kwargs.get(k) for k in parameters if k in kwargs} fig = li.pl.dotplot(adata, **kwargs) return fig
- src/scmcp/schema/ccc.py:315-408 (schema)Pydantic model defining the input schema for the ccc_dot_plot tool, including parameters like uns_key, specificity_cutoff, colour, size, etc.class DotPlotModel(JSONParsingModel): """Input schema for LIANA's dotplot visualization for cell-cell communication networks.""" uns_key: str = Field( default="liana_res", description="Key in adata.uns that contains the LIANA results." ) specificity_cutoff: float = Field( default=0.05, description="specificity or pval threshold for filtering results. " ) colour: Optional[str] = Field( default=None, description="Column in liana_res to define the colours of the dots." ) size: Optional[str] = Field( default=None, description="Column in liana_res to define the size of the dots." ) source_labels: Optional[Union[List[str], str]] = Field( default=None, description="List of labels to use as source, the rest are filtered out." ) target_labels: Optional[Union[List[str], str]] = Field( default=None, description="List of labels to use as target, the rest are filtered out." ) top_n: Optional[int] = Field( default=None, description="Top N entities to plot." ) orderby: Optional[str] = Field( default=None, description="If top_n is not None, order the interactions by this column." ) orderby_ascending: Optional[bool] = Field( default=None, description="If top_n is not None, specify how to order the interactions." ) orderby_absolute: bool = Field( default=False, description="If top_n is not None, whether to order by the absolute value of the orderby column." ) ligand_complex: Optional[Union[List[str], str]] = Field( default=None, description="List of ligand complexes to filter the interactions to be plotted." ) receptor_complex: Optional[Union[List[str], str]] = Field( default=None, description="List of receptor complexes to filter the interactions to be plotted." ) inverse_colour: bool = Field( default=False, description="Whether to -log10 the colour column for plotting." ) inverse_size: bool = Field( default=False, description="Whether to -log10 the size column for plotting." ) cmap: str = Field( default="viridis", description="Colour map to use for plotting." ) size_range: Tuple[int, int] = Field( default=(2, 9), description="Define size range. Tuple of (min, max) integers." ) figure_size: Tuple[float, float] = Field( default=(8, 6), description="Figure x,y size." ) specificity_cutoff: float = Field( default=0.05, description="Specificity or p-value threshold for filtering results." )
- src/scmcp/tool/ccc.py:36-40 (registration)Definition of the MCP Tool object for ccc_dot_plot, including name, description, and input schema.dot_plot_tool = types.Tool( name="ccc_dot_plot", description="Visualize cell-cell communication interactions using a dotplot.", inputSchema=DotPlotModel.model_json_schema(), )
- src/scmcp/tool/ccc.py:100-106 (registration)ccc_tools dictionary that maps tool names to Tool objects, including ccc_dot_plot.ccc_tools = { "ls_ccc_method": ls_ccc_method_tool, "ccc_rank_aggregate": rank_aggregate_tool, "ccc_circle_plot": circle_plot_tool, "ccc_dot_plot": dot_plot_tool, "ccc": ccc_tool, }
- src/scmcp/server.py:48-55 (registration)In list_tools(), the ccc_tools are included in the list of available tools returned by the MCP server.tools = [ *io_tools.values(), *pp_tools.values(), *tl_tools.values(), *pl_tools.values(), *util_tools.values(), *ccc_tools.values(), ]