Inferensys

Glossary

GMT File Format

A tab-delimited text file format for storing gene set databases where each row contains a gene set name, a description, and the list of gene identifiers belonging to the set.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
GENE MATRIX TRANSPOSED

What is GMT File Format?

The GMT file format is the standard tab-delimited text format for storing gene set databases used in pathway enrichment analysis.

The GMT (Gene Matrix Transposed) file format is a tab-delimited text file where each row defines a single gene set using three required columns: the gene set name, a brief description, and a list of gene identifiers belonging to that set. This flat-file structure serves as the primary input for tools like GSEA and Enrichr.

Each row in a GMT file is variable-length, with the gene identifier list extending across an arbitrary number of tab-separated columns. The format is the backbone of the Molecular Signatures Database (MSigDB) and enables the storage of curated pathway definitions, Gene Ontology annotations, and computationally derived gene set collections for functional class scoring and over-representation analysis.

FORMAT SPECIFICATION

Key Characteristics of GMT Files

The GMT (Gene Matrix Transposed) file format is the universal standard for storing and distributing gene set databases. Its simple tab-delimited structure enables seamless interoperability between pathway enrichment tools like GSEA, Enrichr, and custom analysis pipelines.

01

Tab-Delimited Row Structure

Each line in a GMT file represents a single gene set and is composed of three required columns separated by tab characters. The first column contains the gene set name (a unique identifier), the second column provides a description (often a URL or free text), and all subsequent columns list the gene identifiers (e.g., HGNC symbols, Entrez IDs) belonging to that set. This flat, line-oriented structure makes the format trivially parseable by standard Unix tools like awk and cut.

02

Variable-Length Gene Membership

Unlike fixed-width matrix formats, GMT files accommodate gene sets of arbitrary size. A pathway like 'Apoptosis' may contain 80 genes, while 'Ribosome' may contain 150. The tab-delimited format naturally handles this variability because each line simply continues until the final gene identifier. Parsers read until the newline character, making the format inherently schema-flexible without requiring a predefined column count.

03

Identifier Consistency Requirement

The gene identifiers used within a GMT file must match the identifier namespace of the expression dataset being analyzed. Common namespaces include:

  • HGNC gene symbols (e.g., TP53, BRCA1)
  • Entrez Gene IDs (e.g., 7157, 672)
  • Ensembl Gene IDs (e.g., ENSG00000141510) Mismatched namespaces are a primary source of enrichment analysis failure, as the tool cannot map gene sets to the ranked expression list.
05

Human-Readable and Editable

Because GMT files are plain text, they can be opened, inspected, and modified in any text editor. Researchers frequently create custom GMT files by subsetting existing databases, merging gene sets from multiple sources, or defining entirely novel gene sets based on experimental data. This transparency contrasts with binary or database-locked formats and supports FAIR data principles (Findable, Accessible, Interoperable, Reusable).

06

GMT vs. GMX Format

The GMX (Gene Matrix eXpanded) format is a closely related alternative where each gene set occupies its own column in a tab-delimited file, with the gene set name in the first row and member genes listed below. While GMX is more convenient for visual inspection in spreadsheet software, GMT is preferred for programmatic processing because each gene set is an independent record, enabling line-by-line streaming for memory-efficient parsing of large collections containing thousands of gene sets.

GMT FILE FORMAT

Frequently Asked Questions

A technical deep dive into the Gene Matrix Transposed file format, the universal standard for storing and distributing gene set collections in bioinformatics enrichment analysis.

A GMT (Gene Matrix Transposed) file is a tab-delimited text format for storing gene set databases where each row represents a single gene set. The structure consists of three required columns followed by a variable number of gene identifier columns. The first column contains the gene set name (a unique identifier), the second column contains a description (often a URL or free-text annotation), and all subsequent columns contain the gene identifiers belonging to that set. Each row is terminated by a newline character. Critically, the number of gene columns varies per row—there is no requirement for uniform width. This sparse, row-oriented design makes GMT files human-readable and easily parseable by standard bioinformatics tools like GSEA, Enrichr, and clusterProfiler. The format's simplicity is its strength: it imposes no schema beyond the tab delimiter, allowing it to represent any collection of named sets, from Gene Ontology categories to custom CRISPR screen hits.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.