Skip to main content
Glama

diversity_pca

Run principal component analysis on genotype dosage data to evaluate population structure, detect outliers, and generate PCA coordinates with variance explained.

Instructions

Principal component analysis of population structure.

Runs PCA on the alt-allele dosage matrix (monomorphic markers dropped, missing mean-imputed, Patterson scaling). Writes pca_coords.csv (per-sample PC coordinates) and reports variance explained plus any PC1/PC2 outlier samples (beyond outlier_sd SD). Pass metadata_tsv + group_column to add a group column (population label per sample) for colouring the PC plot. For large sets pass method="allelematrix" + max_markers to avoid a full VCF export.

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
outlier_sdNoFlag points more than this many standard deviations from the mean.
output_dirNoDirectory for the output CSV(s) (default ./gigwa_results/<module>/).
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.
n_componentsNoNumber of principal components to compute.
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 carries full burden. It discloses data processing steps (dropping monomorphic, imputation, scaling), output files, variance explained reporting, and outlier detection. It does not mention any destructive actions, which aligns with a read-only analysis tool.

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?

Description is concise, covering key processing steps and outputs in a few sentences. It front-loads the main purpose. Minor inefficiency: could use bullet points for output files, but overall efficient.

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 the tool has 10 parameters and an output schema (though not shown), the description is complete: covers input, processing, output, and optional metadata integration. It addresses outlier detection and scaling, leaving little ambiguity.

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%, baseline 3. The description adds value by explaining the purpose of metadata_tsv and group_column for PC plot coloring, and the method parameter for large datasets. It also notes the format of variant_set_db_id, 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?

Description clearly states tool runs PCA on population structure with specific data processing (monomorphic markers dropped, missing mean-imputed, Patterson scaling) and outputs pca_coords.csv. It distinguishes from sibling tools like diversity_by_group and diversity_summary by specifying the PCA scope and details.

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?

Description provides clear context for use (population structure PCA) and gives guidance for large sets (method="allelematrix" + max_markers to avoid full VCF export). However, it does not explicitly exclude alternatives or state when not to use this tool.

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