Skip to main content
Glama

diversity_by_group

Compute per-population genetic diversity metrics including heterozygosity, FIS, MAF, and rarefied allelic richness. Groups can be defined via JSON or metadata file, and results are saved as a CSV.

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 the number of markers analysed (evenly-spaced subsample); 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); from list_variant_sets / list_content.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description bears full burden. It describes computations (including rarefied allelic richness for comparability) and output file (diversity_by_group.csv). Lacks details on performance or side effects, but sufficiently transparent for a computation tool.

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?

Concise and well-structured: front-loaded with purpose, then group definition, then specific computed metrics. No unnecessary words.

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?

Given 9 parameters, no annotations, but an output schema exists, the description covers main functionality and output. Slightly incomplete about return structure beyond file name, but sufficient for an experienced user.

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 coverage is 100%, so baseline is 3. Description adds value by explaining the rarefied metric and group definition methods, going beyond schema descriptions.

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 it computes per-population diversity metrics (He, Ho, Fis, MAF, % polymorphic, allelic richness) and defines groups similarly to diversity_fst, distinguishing it clearly from siblings like diversity_fst (between-group) and diversity_summary (overall).

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?

Explains two ways to define groups (groups_json or metadata_tsv + group_column) and references diversity_fst for consistency. While it doesn't explicitly state when not to use this tool, the context makes its purpose clear relative to siblings.

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

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