Skip to main content
Glama

ccc

Analyze cell-cell communication in single-cell RNA sequencing data using multiple methods to identify ligand-receptor interactions between cell types.

Instructions

Cell-cell communication analysis with one method (cellphonedb, cellchat,connectome, natmi, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNocell-cell communication methodcellphonedb
groupbyYesKey to be used for grouping cells (e.g., cell type annotations).
resource_nameNoName of the resource to be used for ligand-receptor inference. See `li.rs.show_resources()` for available resources.consensus
expr_propNoMinimum expression proportion for the ligands and receptors in the corresponding cell identities. Set to 0 to return unfiltered results.
min_cellsNoMinimum cells per cell identity to be considered for downstream analysis.
baseNoExponent base used to reverse the log-transformation of the matrix. Relevant only for the `logfc` method.
return_all_lrsNoWhether to return all ligand-receptor pairs, or only those that surpass the expr_prop threshold.
key_addedNoKey under which the results will be stored in adata.uns.liana_res
use_rawNoUse raw attribute of adata if present.
layerNoLayer in AnnData.layers to use. If None, use AnnData.X.
de_methodNoDifferential expression method used to rank genes according to 1vsRest.t-test
n_permsNoNumber of permutations for the permutation test. Relevant for CellPhoneDB method.
seedNoRandom seed for reproducibility.
n_jobsNoNumber of jobs to run in parallel.
verboseNoWhether to print verbose output.
inplaceNoWhether to store results in place, or return them.
supp_columnsNoAdditional columns to be added from methods in liana, or columns from scanpy.tl.rank_genes_groups.

Implementation Reference

  • Core handler function `run_ccc` that performs the cell-cell communication analysis by dynamically calling the specified LIANA method function.
    def run_ccc(adata, method, **kwargs):
        """Run cell-cell communication analysis with the specified method."""
        method_func = getattr(li.mt, method)
        parameters = inspect.signature(method_func).parameters
        filtered_kwargs = {k: kwargs.get(k) for k in parameters if k in kwargs}
        # filtered_kwargs["key_added"] = f"{method}_res"
        method_func(adata, **filtered_kwargs)
        add_op_log(adata, method_func, filtered_kwargs)
        return adata
  • Pydantic model defining the input schema for the 'ccc' tool, used in inputSchema=CCCModel.model_json_schema().
    class CCCModel(JSONParsingModel):
        """Input schema for LIANA's cell-cell communication analysis."""
        
        method: Literal[
            "singlecellsignalr", 
            "connectome", 
            "cellphonedb", 
            "natmi", 
            "logfc", 
            "cellchat", 
            "geometric_mean", 
            "scseqcomm"
        ] = Field(
            default="cellphonedb",
            description="cell-cell communication method"
        )
        
        groupby: str = Field(
            ...,  # Required field
            description="Key to be used for grouping cells (e.g., cell type annotations)."
        )
        
        resource_name: str = Field(
            default="consensus",
            description="Name of the resource to be used for ligand-receptor inference. See `li.rs.show_resources()` for available resources."
        )
        
        expr_prop: float = Field(
            default=0.1,
            description="Minimum expression proportion for the ligands and receptors in the corresponding cell identities. Set to 0 to return unfiltered results."
        )
        
        min_cells: int = Field(
            default=5,
            description="Minimum cells per cell identity to be considered for downstream analysis."
        )
        
        base: float = Field(
            default=2.718281828459045,  # e
            description="Exponent base used to reverse the log-transformation of the matrix. Relevant only for the `logfc` method."
        )
        
        return_all_lrs: bool = Field(
            default=False,
            description="Whether to return all ligand-receptor pairs, or only those that surpass the expr_prop threshold."
        )
        
        key_added: str = Field(
            default="liana_res",
            description="Key under which the results will be stored in adata.uns."
        )
        
        use_raw: Optional[bool] = Field(
            default=True,
            description="Use raw attribute of adata if present."
        )
        
        layer: Optional[str] = Field(
            default=None,
            description="Layer in AnnData.layers to use. If None, use AnnData.X."
        )
        
        de_method: str = Field(
            default="t-test",
            description="Differential expression method used to rank genes according to 1vsRest."
        )
        
        n_perms: int = Field(
            default=1000,
            description="Number of permutations for the permutation test. Relevant for CellPhoneDB method."
        )
        
        seed: int = Field(
            default=1337,
            description="Random seed for reproducibility."
        )
        
        n_jobs: int = Field(
            default=1,
            description="Number of jobs to run in parallel."
        )
        
        verbose: Optional[bool] = Field(
            default=False,
            description="Whether to print verbose output."
        )
        
        inplace: bool = Field(
            default=True,
            description="Whether to store results in place, or return them."
        )
        
        supp_columns: Optional[List[str]] = Field(
            default=None,
            description="Additional columns to be added from methods in liana, or columns from scanpy.tl.rank_genes_groups."
        )
  • Tool object registration for the 'ccc' tool.
    # Add general CCC tool
    ccc_tool = types.Tool(
        name="ccc",
        description="Cell-cell communication analysis with one method (cellphonedb, cellchat,connectome, natmi, etc.)",
        inputSchema=CCCModel.model_json_schema(),
    )
  • Mapping of 'ccc' tool to ccc_tools dictionary, which is used for registration in server.list_tools().
    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,
    }
  • Server tool listing function that includes ccc_tools.values(), registering the 'ccc' tool.
    @server.list_tools()
    async def list_tools() -> list[types.Tool]:
        if MODULE == "io":
            tools = io_tools.values()
        elif MODULE == "pp":
            tools = pp_tools.values()
        elif MODULE == "tl":
            tools = tl_tools.values()
        elif MODULE == "pl":
            tools = pl_tools.values()
        elif MODULE == "util":
            tools = util_tools.values()
        else:
            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?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions analysis but doesn't describe what the tool actually does behaviorally - whether it modifies data in place (the 'inplace' parameter suggests it might), what kind of output it produces, computational requirements, or error conditions. The description is too vague about the actual analysis process and results.

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

Conciseness3/5

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

The description is extremely concise (one sentence) but under-specified rather than efficiently informative. While it doesn't waste words, it fails to provide essential context that would help an agent understand when and how to use this tool effectively. The single sentence doesn't earn its place by providing sufficient guidance.

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?

For a complex tool with 17 parameters, no annotations, and no output schema, the description is severely inadequate. It doesn't explain what the analysis produces, how results are stored/returned, what the 'inplace' parameter fundamentally means for data modification, or provide any context about the biological analysis being performed. The agent would struggle to use this tool correctly based solely on this description.

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?

With 100% schema description coverage, the baseline is 3. The description adds no parameter-specific information beyond what's already in the comprehensive schema. It mentions 'one method' which aligns with the 'method' parameter but provides no additional context about method selection, parameter interactions, or practical usage considerations.

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 performs 'cell-cell communication analysis' with a specific method, providing a verb ('analysis') and resource ('cell-cell communication'). It distinguishes from some siblings like visualization tools (ccc_circle_plot, ccc_dot_plot) but doesn't explicitly differentiate from ccc_rank_aggregate or ls_ccc_method, which are related to communication analysis methods.

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. It mentions 'one method' but doesn't explain when to choose this over other analysis tools like ccc_rank_aggregate or when to use specific methods listed. There's no mention of prerequisites, input data requirements, or typical workflow context.

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