Skip to main content
Glama

ccc_circle_plot

Visualize cell-cell communication networks with circular plots to analyze signaling interactions between cell types in single-cell RNA sequencing data.

Instructions

Visualize cell-cell communication network using a circular plot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uns_keyNoKey in adata.uns that contains the LIANA results.liana_res
groupbyNoKey to be used for grouping or clustering cells.
source_keyNoColumn name of the sender/source cell types in liana_res.source
target_keyNoColumn name of the receiver/target cell types in liana_res.target
score_keyNoColumn name of the score in liana_res. If None, the score is inferred from the method.
inverse_scoreNoWhether to invert the score. If True, the score will be -log10(score).
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.
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.
ligand_complexNoList of ligand complexes to filter the interactions to be plotted.
receptor_complexNoList of receptor complexes to filter the interactions to be plotted.
pivot_modeNoThe mode of the pivot table: 'counts' for number of connections, 'mean' for mean of score values.counts
mask_modeNoThe mode of the mask: 'or' to include source or target, 'and' to include source and target.or
specificity_cutoffNospecificity or pval threshold for filtering results.
figure_sizeNoFigure x,y size.
edge_alphaNoThe transparency of the edges.
edge_arrow_sizeNoThe size of the arrow.
edge_width_scaleNoThe scale of the edge width.
node_alphaNoThe transparency of the nodes.
node_size_scaleNoThe scale of the node size.
node_label_offsetNoThe offset of the node label.
node_label_sizeNoThe size of the node label.
node_label_alphaNoThe transparency of the node label.

Implementation Reference

  • Handler function that implements the ccc_circle_plot tool logic: filters results by specificity cutoff, prepares parameters, and calls liana's circle_plot.
    def plot_circleplot(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
        parameters = inspect.signature( li.pl.circle_plot).parameters
        kwargs = {k: kwargs.get(k) for k in parameters if k in kwargs}    
        ax = li.pl.circle_plot(adata, **kwargs)
        return ax
  • Pydantic model defining the input schema and parameters for the ccc_circle_plot tool.
    class CirclePlotModel(JSONParsingModel):
        """Input schema for LIANA's circle_plot visualization for cell-cell communication networks."""
        
        uns_key: Optional[str] = Field(
            default="liana_res",
            description="Key in adata.uns that contains the LIANA results."
        )
        
        groupby: Optional[str] = Field(
            default=None,
            description="Key to be used for grouping or clustering cells."
        )
        
        source_key: str = Field(
            default="source",
            description="Column name of the sender/source cell types in liana_res."
        )
        
        target_key: str = Field(
            default="target",
            description="Column name of the receiver/target cell types in liana_res."
        )
        
        score_key: Optional[str] = Field(
            default=None,
            description="Column name of the score in liana_res. If None, the score is inferred from the method."
        )
        
        inverse_score: bool = Field(
            default=False,
            description="Whether to invert the score. If True, the score will be -log10(score)."
        )
        
        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."
        )
        
        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."
        )
        
        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."
        )
        
        pivot_mode: Literal["counts", "mean"] = Field(
            default="counts",
            description="The mode of the pivot table: 'counts' for number of connections, 'mean' for mean of score values."
        )
        
        mask_mode: Literal["and", "or"] = Field(
            default="or",
            description="The mode of the mask: 'or' to include source or target, 'and' to include source and target."
        )
        
        specificity_cutoff: float = Field(
            default=0.05,
            description="specificity or pval threshold for filtering results. "
        )
        
        figure_size: Tuple[float, float] = Field(
            default=(5, 5),
            description="Figure x,y size."
        )
        
        edge_alpha: float = Field(
            default=0.5,
            description="The transparency of the edges."
        )
        
        edge_arrow_size: int = Field(
            default=10,
            description="The size of the arrow."
        )
        
        edge_width_scale: Tuple[float, float] = Field(
            default=(1, 5),
            description="The scale of the edge width."
        )
        
        node_alpha: float = Field(
            default=1.0,
            description="The transparency of the nodes."
        )
        
        node_size_scale: Tuple[float, float] = Field(
            default=(100, 400),
            description="The scale of the node size."
        )
        
        node_label_offset: Tuple[float, float] = Field(
            default=(0.1, -0.2),
            description="The offset of the node label."
        )
        
        node_label_size: int = Field(
            default=8,
            description="The size of the node label."
        )
        
        node_label_alpha: float = Field(
            default=0.7,
            description="The transparency of the node label."
        )
  • MCP Tool object registration with name, description, and schema for ccc_circle_plot.
    circle_plot_tool = types.Tool(
        name="ccc_circle_plot",
        description="Visualize cell-cell communication network using a circular plot.",
        inputSchema=CirclePlotModel.model_json_schema(),
    )
  • ccc_tools dictionary that maps tool name to Tool object, including ccc_circle_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(), includes ccc_tools.values() to register ccc_circle_plot among available tools.
        tools = [
            *io_tools.values(),
            *pp_tools.values(),
            *tl_tools.values(),
            *pl_tools.values(),
            *util_tools.values(),
            *ccc_tools.values(),
        ]
    return tools
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool creates a visualization (a circular plot), implying it's a read-only operation that generates output, but doesn't disclose critical behavioral traits: whether it modifies input data, returns a plot object or file, has performance characteristics, or requires specific data preprocessing. For a complex visualization tool with 26 parameters, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary elaboration. It's appropriately sized for a tool where detailed parameter semantics are handled by the schema. Every word earns its place, and the structure is front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (26 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what the tool returns (plot object, file path, display?), how it integrates with the data pipeline, or typical workflow context. The agent must rely entirely on the schema for parameter understanding and guess about behavioral aspects and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed parameter documentation in the schema itself. The description adds no parameter information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description. The description doesn't compensate but doesn't need to since the schema is comprehensive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Visualize cell-cell communication network using a circular plot.' It specifies the verb ('visualize'), resource ('cell-cell communication network'), and visualization type ('circular plot'). However, it doesn't differentiate from sibling tools like 'ccc_dot_plot' or 'ccc_rank_aggregate', which likely serve similar visualization purposes for the same data domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (e.g., needing LIANA results in adata.uns), comparison to sibling visualization tools like 'ccc_dot_plot', or typical use cases. The agent must infer usage from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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