Skip to main content
Glama

diversity_by_group

Compute per-population genetic diversity metrics including observed/expected heterozygosity, Fis, MAF, polymorphic markers, and allelic richness for user-defined groups to compare populations.

Instructions

Per-population diversity: He, Ho, Fis, MAF, % polymorphic, allelic richness.

Define groups the same way as diversity_fst — either groups_json {group: [names]} or metadata_tsv + group_column. For each group computes n, % polymorphic markers, mean MAF, Nei's He, observed Ho, Fis (1−Ho/He), mean observed allelic richness, and rarefied allelic richness (rarefied to the smallest group's gene-copy count so unequal group sizes are comparable). Writes diversity_by_group.csv.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoGenotype source: 'vcf' (full export, cached) or 'allelematrix' (paged, server-side subset).vcf
regionNoRestrict analysis to a genomic window: 'chrom' or 'chrom:start-end' (1-based).
id_columnNoColumn in the metadata TSV holding the individual/accession id (default 'individual').individual
output_dirNoDirectory for the output CSV(s) (default ./gigwa_results/<module>/).
groups_jsonNoJSON object mapping each group name to a list of accession names/ids.
max_markersNoCap analysis to the first N markers in canonical Gigwa search order; omit to use all.
group_columnNoColumn in the metadata TSV holding the group/population label.
metadata_tsvNoPath to a metadata TSV (import_metadata format) used to define groups.
variant_set_db_idYesBrAPI variantSetDbId identifying the run (MODULE§project§run) -- copy the exact string from list_variant_sets / list_content, never assemble one by hand: the middle segment is a numeric project index, not the project's name, and a wrong guess fails with an opaque HTTP 500 rather than a clear error.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.9.1
    • changedInput schema / properties / max_markers / description
      Previous value: -"Cap the number of markers analysed (evenly-spaced subsample); omit to use all."New value: +"Cap analysis to the first N markers in canonical Gigwa search order; omit to use all."
    • changedInput schema / properties / variant_set_db_id / description
      Previous value: -"BrAPI variantSetDbId identifying the run (MODULE§project§run); from list_variant_sets / list_content."New value: +"BrAPI variantSetDbId identifying the run (MODULE§project§run) -- copy the exact string from list_variant_sets / list_content, never assemble one by hand: the middle segment is a numeric project index, not the project's name, and a wrong guess fails with an opaque HTTP 500 rather than a clear error."
  2. First observedv1.4.16

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral disclosure burden. It discloses the exact computed metrics, the rarefaction adjustment based on the smallest group, the two valid group-definition mechanisms, and the output file name. It does not mention computational cost or failure modes, but for a non-destructive analysis tool this is a reasonably complete behavioral picture.

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 compact and front-loaded with the tool's purpose, followed by grouping instructions, the detailed metric list, and the output artifact. Every sentence contributes information, with no filler or repetition of schema fields.

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

Completeness4/5

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

For a tool with nine parameters, the description plus full schema coverage provides enough to use it correctly: required variant set ID is documented in the schema, grouping options are explained, and output is named. It does not explicitly describe what happens when no group definition is supplied, but this is a minor edge case and the output schema likely fills remaining gaps.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful cross-parameter semantics by explaining that groups_json and metadata_tsv + group_column are alternate ways to define groups, and it clarifies the rarefaction behavior tied to group sizes. This goes beyond what the individual parameter descriptions state.

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 opens with a specific summary—'Per-population diversity: He, Ho, Fis, MAF, % polymorphic, allelic richness'—which clearly identifies the tool's resource and outputs. It does not explicitly contrast this tool with close siblings like diversity_fst, though it references diversity_fst for grouping, so the differentiation is left somewhat implicit.

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

Usage Guidelines3/5

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

The description implies when to use the tool: whenever per-population diversity statistics are needed. It explains how to define groups and points to diversity_fst as a behavioral reference, but it does not state when to choose diversity_by_group over alternatives such as diversity_summary or diversity_fst, nor does it give explicit when-not-to-use conditions.

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

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/gkanogiannis/Gigwa-MCP'

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