Skip to main content
Glama

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
NameRequiredDescriptionDefault
uns_keyNoKey in adata.uns that contains the LIANA results.liana_res
specificity_cutoffNoSpecificity or p-value threshold for filtering results.
colourNoColumn in liana_res to define the colours of the dots.
sizeNoColumn in liana_res to define the size of the dots.
source_labelsNoList of labels to use as source, the rest are filtered out.
target_labelsNoList of labels to use as target, the rest are filtered out.
top_nNoTop N entities to plot.
orderbyNoIf top_n is not None, order the interactions by this column.
orderby_ascendingNoIf top_n is not None, specify how to order the interactions.
orderby_absoluteNoIf top_n is not None, whether to order by the absolute value of the orderby column.
ligand_complexNoList of ligand complexes to filter the interactions to be plotted.
receptor_complexNoList of receptor complexes to filter the interactions to be plotted.
inverse_colourNoWhether to -log10 the colour column for plotting.
inverse_sizeNoWhether to -log10 the size column for plotting.
cmapNoColour map to use for plotting.viridis
size_rangeNoDefine size range. Tuple of (min, max) integers.
figure_sizeNoFigure x,y size.

Implementation Reference

  • 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
  • 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."
        )
  • 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(),
    )
  • 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,
    }
  • 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(),
    ]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huang-sh/scmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server