Skip to main content
Glama

Jean — Molecular Biology & Genomics

gene_set_enrichment

Read-only

Preranked gene set enrichment analysis (GSEA; Subramanian et al. 2005) with fgsea's multilevel p-values (Korotkevich et al.), either as clusterProfiler's GSEA() runs it (enrichit 0.2.6, with q-values; or its fixed-count or adaptive sample and permute tests) or as fgsea 1.38 itself runs it (fgseaMultilevel, or fgseaSimple with a permutation count): weighted running-sum enrichment score, normalized ES against size-matched permutations, multilevel Monte Carlo p-values down to eps, adjusted p, log2err, rank at maximum, leading-edge genes.

Input Schema

NameRequiredDescriptionDefault
epsNofloor for multilevel p-values; 0 estimates them however small. Only applies when method is multilevel.
seedNoseeds the permutations; the same seed gives the same p-values as the chosen engine in R (fgsea: set.seed(seed) before the call).
npermNofgsea: run fgseaSimple with this many permutations (p-values no smaller than 1/(nperm + 1)); 0 keeps the multilevel estimate. Only applies when engine is fgsea.
_filesNoThe project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name.
engineNoclusterProfiler: enrichit 0.2.6's GSEA, what clusterProfiler 4.20's GSEA() runs, with q-values. fgsea: fgsea 1.38's own, a different random stream and arithmetic, so the same seed gives fgsea's p-values; BH only, no q-value.clusterProfiler
methodNoclusterProfiler's p-value: multilevel Monte Carlo (fgsea-derived, down to eps); sample: a fixed count of random gene samples of each set's size; permute: that count of relabellings of the whole ranked list (slower: every set is re-scored along every permuted list). The permutation methods score both tails whatever the score type. Only applies when engine is clusterProfiler.multilevel
rankedYesthe ranked list: 'gene statistic' per line (tab, comma or space), e.g. a DE run's Wald statistic; sorted decreasing here if it is not.
maxPermNoadaptive: the most draws any set gets. Only applies when adaptive is true.
minPermNoadaptive: the first batch for every set. Only applies when adaptive is true.
_subjectNoThe record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several.
adaptiveNosample or permute: draw per set in batches from minPerm, doubling while its p-value is at most pvalThreshold, up to maxPerm, instead of a fixed count. Only applies when method is sample or permute.
exponentNoweight of each gene's statistic in the running sum: 0 is the unweighted Kolmogorov-Smirnov form, 1 classic GSEA.
geneSetsYesthe gene sets, as GMT text (MSigDB, GO or WikiPathways exports): one set per line, tab-separated ID, description, then member gene IDs. IDs must be the same kind as the genes'.
maxGSSizeNolargest set tested, counted among the ranked genes.
minGSSizeNosmallest set tested, counted among the ranked genes.
scoreTypeNostd: both tails; pos or neg: one-tailed, for a statistic with one meaningful sign (the multilevel estimate only). Only applies when method is multilevel.std
sampleSizeNomultilevel samples per level (made odd). Only applies when method is multilevel.
nPermSimpleNomultilevel: permutations for the first, simple p-value estimate and the NES. Only applies when method is multilevel.
permutationsNosample or permute: null draws per set (p-values no smaller than 1/(same-side draws + 1)). Only applies when method is sample or permute.
pvalueCutoffNoa set is significant when p and adjusted p are at most this.
pAdjustMethodNomultiple-testing adjustment across the tested sets (R `p.adjust`).BH
pvalThresholdNoadaptive: a set whose p-value rises above this stops drawing. Only applies when adaptive is true.

Output Schema

NameRequiredDescriptionDefault
termsYesevery set in the size range, by |NES|: ES, NES, p, adjusted p, q-value, log2err, rank at maximum, leading-edge statistics and genes, and the ranks of the set's members
summaryYesranked genes, ties, whether the list was re-sorted, sets supplied and in range, significant sets, q-value route
enrichedYesthe sets passing the p and adjusted-p cutoff
runningScoreYesthe running enrichment score along the ranked list for the top set, with its hits

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedInput schema / properties / adaptive
      Added value: +{
      +  "default": false,
      +  "description": "sample or permute: draw per set in batches from minPerm, doubling while its p-value is at most pvalThreshold, up to maxPerm, instead of a fixed count. Only applies when method is sample or permute.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / engine
      Added value: +{
      +  "default": "clusterProfiler",
      +  "description": "clusterProfiler: enrichit 0.2.6's GSEA, what clusterProfiler 4.20's GSEA() runs, with q-values. fgsea: fgsea 1.38's own, a different random stream and arithmetic, so the same seed gives fgsea's p-values; BH only, no q-value.",
      +  "enum": [
      +    "clusterProfiler",
      +    "fgsea"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / eps / description
      Previous value: -"floor for multilevel p-values; 0 estimates them however small."New value: +"floor for multilevel p-values; 0 estimates them however small. Only applies when method is multilevel."
    • addedInput schema / properties / maxPerm
      Added value: +{
      +  "default": 100000,
      +  "description": "adaptive: the most draws any set gets. Only applies when adaptive is true.",
      +  "minimum": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / method
      Added value: +{
      +  "default": "multilevel",
      +  "description": "clusterProfiler's p-value: multilevel Monte Carlo (fgsea-derived, down to eps); sample: a fixed count of random gene samples of each set's size; permute: that count of relabellings of the whole ranked list (slower: every set is re-scored along every permuted list). The permutation methods score both tails whatever the score type. Only applies when engine is clusterProfiler.",
      +  "enum": [
      +    "multilevel",
      +    "sample",
      +    "permute"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / minPerm
      Added value: +{
      +  "default": 101,
      +  "description": "adaptive: the first batch for every set. Only applies when adaptive is true.",
      +  "minimum": 1,
      +  "type": "number"
      +}
    • changedInput schema / properties / nPermSimple / description
      Previous value: -"permutations for the first, simple p-value estimate and the NES."New value: +"multilevel: permutations for the first, simple p-value estimate and the NES. Only applies when method is multilevel."
    • addedInput schema / properties / nperm
      Added value: +{
      +  "default": 0,
      +  "description": "fgsea: run fgseaSimple with this many permutations (p-values no smaller than 1/(nperm + 1)); 0 keeps the multilevel estimate. Only applies when engine is fgsea.",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / permutations
      Added value: +{
      +  "default": 1000,
      +  "description": "sample or permute: null draws per set (p-values no smaller than 1/(same-side draws + 1)). Only applies when method is sample or permute.",
      +  "minimum": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / pvalThreshold
      Added value: +{
      +  "default": 0.1,
      +  "description": "adaptive: a set whose p-value rises above this stops drawing. Only applies when adaptive is true.",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • changedInput schema / properties / sampleSize / description
      Previous value: -"multilevel samples per level (made odd)."New value: +"multilevel samples per level (made odd). Only applies when method is multilevel."
    • changedInput schema / properties / scoreType / description
      Previous value: -"std: both tails; pos or neg: one-tailed, for a statistic with one meaningful sign."New value: +"std: both tails; pos or neg: one-tailed, for a statistic with one meaningful sign (the multilevel estimate only). Only applies when method is multilevel."
    • changedInput schema / properties / seed / description
      Previous value: -"seeds the permutations; the same seed gives the same p-values as enrichit."New value: +"seeds the permutations; the same seed gives the same p-values as the chosen engine in R (fgsea: set.seed(seed) before the call)."
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and destructiveHint=false, so safety is covered by structured data. The description goes further by disclosing the statistical behavior an agent needs to interpret results — size-matched permutation normalization, Monte Carlo p-values floored at eps, one- vs two-tailed scoring — which is genuine added context beyond the annotations.

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?

All content is packed into a single run-on sentence with nested parentheticals and two literature citations, which makes it dense and hard to scan even though the core method is front-loaded. The substance earns its place, but the structure does not; splitting engine, method, and outputs into distinct statements would read far better.

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 22-parameter statistical tool with an output schema and full schema coverage, the description supplies the conceptual model (preranked GSEA, multilevel p-values, NES, leading edge) that lets an agent interpret the call. It omits practical notes such as runtime cost for permutation methods or output ordering, but nothing essential to invoking it correctly is missing.

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 schema already documents every one of the 22 parameters including their conditional applicability. The description adds conceptual framing (what the enrichment score and leading edge mean) but no parameter-level meaning beyond the schema, so the baseline of 3 applies.

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 names a specific technique — 'Preranked gene set enrichment analysis (GSEA)' — and enumerates the algorithmic outputs (running-sum ES, NES, multilevel p, log2err, leading-edge genes), which is far more than a restatement of the name. The word 'preranked' distinguishes it from list-based siblings such as gene_set_overrepresentation, but no sibling is named explicitly, so differentiation is implied rather than stated.

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?

Usage context is implied by the requirement that the input be a ranked list, and the description does clarify which engine/method combinations apply (clusterProfiler vs fgsea, multilevel vs sample/permute). It never states when to choose this over gene_set_camera or gene_set_overrepresentation, nor any prerequisites for producing the ranked input, leaving the agent to infer the selection criteria.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources