Skip to main content
Glama

compute_heritability

Rank features by heritability on a lineage tree using Moran's I or Geary's C autocorrelation. Identifies which genes are most heritable on the tree.

Instructions

Rank features by heritability on a tree (Moran's I / Geary's C autocorrelation).

Answers "which genes are most heritable on this lineage tree?". Builds tree neighbors, then computes spatial autocorrelation of each feature over that graph. Requires an expression/feature matrix in .X (or a named layer): var_names are the features scored. Results are also stored in tdata.uns["moranI"]/["gearyC"].

Args: dataset_id: Dataset handle. tree_key: Which tree in obst to use. keys: Feature names to score (default: all var_names). n_neighbors: Number of tree neighbors per cell for the connectivity graph. method: "moran" (Moran's I) or "geary" (Geary's C). layer: Optional layer to use instead of .X. top_n: Number of top-ranked features to return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysNo
layerNo
top_nNo
methodNomoran
tree_keyYes
dataset_idYes
n_neighborsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
topYesFeatures ranked by heritability (most heritable first).
methodYes'moran' or 'geary'.
tree_keyYes
dataset_idYes
n_featuresYes
Behavior4/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 discloses the computational method (spatial autocorrelation), the required data (expression matrix, tree), where results are stored (tdata.uns['moranI']/['gearyC']), and the effect of the method parameter. No destructive actions or side effects are mentioned, but the description is informative.

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

Conciseness4/5

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

The description is well-structured: a one-line summary, a brief explanation, and a parameter list. It is front-loaded with the main question. While the parameter list is somewhat lengthy, each line adds necessary detail. Minor redundancy (e.g., 'Tree neighbors' could be slightly tightened) but overall efficient.

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

Completeness3/5

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

The description explains input requirements, algorithmic steps, and output storage (in tdata). However, it does not mention the function's return value despite an output schema existing. The description could be more complete by noting what the tool returns (e.g., a table of features and scores), but it covers the essential context for use.

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

Parameters4/5

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

With 0% schema description coverage, the description must compensate. It explains each parameter's role: dataset_id, tree_key, keys, n_neighbors, method, layer, top_n. It adds context like 'var_names are the features scored' and default behavior. However, it could more explicitly state the valid values for method (e.g., 'moran' or 'geary') and that keys defaults to all var_names.

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

Purpose5/5

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

The description clearly states the tool ranks features by heritability on a tree using Moran's I or Geary's C, and it answers a specific biological question: 'which genes are most heritable on this lineage tree?'. This distinguishes it from sibling tools like calculate_parsimony or reconstruct_ancestral_states, which serve different analytical purposes.

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

Usage Guidelines4/5

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

The description explains when to use this tool: to rank features by heritability on a tree. It also specifies prerequisites (an expression matrix in .X or a layer) and the required tree. However, it does not explicitly state when not to use it or provide direct alternatives, though the context of sibling tools implies other options exist.

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/colganwi/lineageverse-mcp'

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